Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3724: feat: adding RPC: `get_transaction_and_witness_proof` & `verify_transaction_and_witness_proof` r=quake a=code-monad <!-- Thank you for contributing to nervosnetwork/ckb! If you haven't already, please read [CONTRIBUTING](https://github.com/nervosnetwork/ckb/blob/develop/CONTRIBUTING.md) document. If you're unsure about anything, just ask; somebody should be along to answer within a day or two. PR Title Format: 1. module [, module2, module3]: what's changed 2. *: what's changed --> ### What problem does this PR solve? Issue Number: close #3628 <!-- REMOVE this line if no issue to close --> Problem Summary: ### What is changed and how it works? What's Changed: - Introduced two new RPC method called `get_transaction_and_witness_proof ` & `verify_transaction_and_witness_proof` #### `get_transaction_and_witne_proof ` This methods accepts the same params as `get_transaction_proof`, and returns a similar structure `TransactionAndWitnessProof` ```rust struct TransactionAndWitnessProof { /// Block hash pub block_hash: H256, /// Merkle proof of all transactions' hash pub transactions_proof: MerkleProof, /// Merkle proof of transactions' witnesses pub witnesses_proof: MerkleProof, } ``` #### `verify_transaction_and_witness_proof` When we called with same valid param of `get_transaction_and_witness_proof ` & `get_transaction_proof`, use their result as param of `verify_transaction_and_witness_proof` & `verify_transaction_proof`, the final result should be the same(the hash of the transaction this proof pointed to) ### Check List <!--REMOVE the items that are not applicable--> Tests <!-- At least one of them must be included. --> - Unit test - Integration test - Manual test (add detailed scripts or steps below) - No code ci-runs-only: [ quick_checks,linters ] ### Release note <!-- Choose from None, Title Only and Note. Bugfixes or new features need a release note. --> ```release-note Note: Add a note under the PR title in the release note. ``` Co-authored-by: Code Monad <codemonad@cryptape.com>
- Loading branch information