mirror of
https://github.com/pezkuwichain/pezkuwi-runtime-templates.git
synced 2026-04-22 02:07:55 +00:00
cdba7fea87
* Added RPC testing toolkit with docs * Add documentation * fix comments --------- Co-authored-by: Amar Singh <asinghchrony@protonmail.com>
1.5 KiB
1.5 KiB
RPC Testing Toolkit
This is a Postman collection to test your the RPC deployment of you smart contract. To use it you should prepare your environment and test toolkit for testing:
- Open the collection in Postman, and open the variables in it.
- Fill the
urlwith HTTP RPC url andchain_idwith your chain's chain id. - Obtain three funded accounts. You may provide them through the chainspec.
- Put first address to the
alice_addrvariable and their balance to thealice_balance. - Make a transfer transaction from the second address to any address.
- Put its hash to the
tx_hashvariable - Put the block number of this transaction to
tx_block_numberandblock_number. Put the number of transactions in this block (highly likely it will be 1) to theblock_tx_count. - Put the hash of the block with this transaction to
tx_block_hashandblock_hash. - Put the index of the transaction in the block to
tx_index. Highly likely it will be 0. - Put the address you have sent the transaction from to
tx_fromvariable.
- Put its hash to the
- Take a third address and deploy the smart contract
TestContract.solfrom it.- Put the address of the deployed contract to the
test_contractvariable. - Put the code from the compiled contract to the
contract_codevariable. It can be found in a resulting JSON file underdeployedBytecodekey.
- Put the address of the deployed contract to the
- Put first address to the
When you complete these preparation steps, run the requests from the collection. If some of them are not passing, run them as a single request and see what the request have returned to debug it.