From 81ca025255c1eca8f4011ec9ead4bbce7471dff8 Mon Sep 17 00:00:00 2001 From: wenyuanhust Date: Tue, 19 Dec 2023 09:44:13 +0800 Subject: [PATCH] test: mock ckbMbtVerify by ckbMbtTestVerify --- contracts/clients/CkbTestProof.sol | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/contracts/clients/CkbTestProof.sol b/contracts/clients/CkbTestProof.sol index cb1034d..3a89376 100644 --- a/contracts/clients/CkbTestProof.sol +++ b/contracts/clients/CkbTestProof.sol @@ -23,6 +23,11 @@ function getTestHeader() pure returns (CKBHeader memory) { return ckbHeader; } +// counterpart for test case verifyTestProof to CkbProof::ckbMbtVerify +function ckbMbtTestVerify() pure returns (bool) { + return true; +} + library CkbTestProof { // !!!must be idenfical to CkbProof verifyProof except using getTestHeader to replace CkbLightClient::getHeader function verifyTestProof( @@ -56,18 +61,18 @@ library CkbTestProof { ); // Create the VerifyProofPayload - VerifyProofPayload memory payload = VerifyProofPayload({ - verifyType: axonObjProof.proofPayload.verifyType, - // transactionsRoot: header.transactionsRoot, - transactionsRoot: 0x7c57536c95df426f5477c344f8f949e4dfd25443d6f586b4f350ae3e4b870433, - witnessesRoot: axonObjProof.proofPayload.witnessesRoot, - rawTransactionsRoot: axonObjProof.proofPayload.rawTransactionsRoot, - proof: axonObjProof.proofPayload.proof - }); + // VerifyProofPayload memory payload = VerifyProofPayload({ + // verifyType: axonObjProof.proofPayload.verifyType, + // // transactionsRoot: header.transactionsRoot, + // transactionsRoot: 0x7c57536c95df426f5477c344f8f949e4dfd25443d6f586b4f350ae3e4b870433, + // witnessesRoot: axonObjProof.proofPayload.witnessesRoot, + // rawTransactionsRoot: axonObjProof.proofPayload.rawTransactionsRoot, + // proof: axonObjProof.proofPayload.proof + // }); // require(false, "after VerifyProofPayload"); // Verify the proof - if (!ckbMbtVerify(payload)) { + if (!ckbMbtTestVerify()) { return false; } // require(false, "after ckbMbtVerify");