tests for getting MoM in Eval and fixes

This commit is contained in:
Scott Sadler
2018-04-06 03:52:30 -03:00
parent e625be68a9
commit 9bf132a5a8
9 changed files with 307 additions and 91 deletions

View File

@@ -69,10 +69,10 @@ bool Eval::ImportPayout(const CC *cond, const CTransaction &payoutTx, unsigned i
if (!CheckDeserialize(vProof, proof))
return Invalid("invalid-mom-proof-payload");
uint256 MoM;
if (!GetMoM(proof.notarisationHash, MoM)) return Invalid("coudnt-load-mom");
NotarisationData data;
if (!GetNotarisationData(proof.notarisationHash, data)) return Invalid("coudnt-load-mom");
if (MoM != ExecMerkle(disputeTx.GetHash(), proof.branch, proof.nIndex))
if (data.MoM != proof.Exec(disputeTx.GetHash()))
return Invalid("mom-check-fail");
}