m3 test proven

This commit is contained in:
Scott Sadler
2018-05-15 22:27:10 -03:00
parent 20c3ac51c2
commit 06c960d2b7
12 changed files with 249 additions and 231 deletions

View File

@@ -199,7 +199,7 @@ bool Eval::ImportPayout(const std::vector<uint8_t> params, const CTransaction &i
// Check disputeTx solves momproof from vout[0]
{
NotarisationData data;
NotarisationData data(0);
if (!GetNotarisationData(proof.notarisationHash, data))
return Invalid("coudnt-load-mom");

View File

@@ -124,11 +124,18 @@ extern char ASSETCHAINS_SYMBOL[65];
*/
class NotarisationData
{
bool IsBack()
{
if (IsBackNotarisation == 2) {
return ASSETCHAINS_SYMBOL[0] != 0;
}
return (bool) IsBackNotarisation;
}
public:
bool IsBackNotarisation = 0;
int IsBackNotarisation = 0;
uint256 blockHash;
uint32_t height;
uint256 txHash; // Only get this guy in asset chains not in KMD
uint256 txHash;
char symbol[64] = "\0";
uint256 MoM;
uint32_t MoMDepth;
@@ -136,7 +143,7 @@ public:
uint256 MoMoM;
uint32_t MoMoMDepth;
NotarisationData(bool IsBack=0) : IsBackNotarisation(IsBack) {}
NotarisationData(int IsBack=2) : IsBackNotarisation(IsBack) {}
ADD_SERIALIZE_METHODS;
@@ -144,14 +151,14 @@ public:
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
READWRITE(blockHash);
READWRITE(height);
if (IsBackNotarisation || (!ser_action.ForRead() && !txHash.IsNull()))
if (IsBack())
READWRITE(txHash);
SerSymbol(s, ser_action);
READWRITE(MoM);
READWRITE(MoMDepth);
if (s.size() == 0) return;
READWRITE(ccId);
if (IsBackNotarisation) {
if (IsBack()) {
READWRITE(MoMoM);
READWRITE(MoMoMDepth);
}

View File

@@ -56,7 +56,7 @@ bool Eval::ImportCoin(const std::vector<uint8_t> params, const CTransaction &imp
// Check proof confirms existance of burnTx
{
NotarisationData data;
NotarisationData data(1);
if (!GetNotarisationData(proof.notarisationHeight, data, true))
return Invalid("coudnt-load-momom");