Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] mpm integration test support use block and state proof as arguments for tests function #3513

Closed
jolestar opened this issue Jul 6, 2022 · 0 comments · Fixed by #3533
Labels

Comments

@jolestar
Copy link
Member

jolestar commented Jul 6, 2022

Feature Request

Describe the Feature Request

mpm integration test support use block and state proof as arguments for the tests function

Describe Preferred Solution

Option 1: Provide integration test commands, and command template:

//# init -n dev --enable-rpc

//# faucet --addr creator --amount 100000000000

//# call_rpc --api chain.get_block_by_number --args 1 --args "{decode:true}"

//# run --signers creator --args $call_rpc[0].header.state_root

script{
   fun main(sender:signer, state_root:vector<u8>){
      
   }
}

Option 2: Provide Move native methods for Chain API

//# init -n dev --enable-rpc

//# faucet --addr creator --amount 100000000000

//# run --signers creator

script{
   fun main(sender:signer, state_root:vector<u8>){
      let block_header = Chain::get_block_header(block_number);
      let state_root = BlockHeader::state_root(&block_header);
   }
}

Related Code

Additional Context

If the feature request is approved, would you be willing to submit a PR?
Yes / No (Help can be provided if you need assistance submitting a PR)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant