Skip to content

Commit

Permalink
[mpm] Fix mpm integration test call api state.get_with_proof_by_root_…
Browse files Browse the repository at this point in the history
…raw (#3664)

* [mpm] Fix mpm integration test call api state.get_with_proof_by_root_raw

* fixup
  • Loading branch information
jolestar authored Aug 17, 2022
1 parent 38d1cf6 commit c4dca75
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions vm/starcoin-transactional-test-harness/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ impl ForkContext {
self.storage.apply_write_set(write_set)?;
let state_root = self.storage.commit()?;
*self.state_root.lock().unwrap() = state_root;
self.storage.flush()?;
Ok(())
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
processed 5 tasks
processed 6 tasks

task 4 'run'. lines 9-16:
task 5 'run'. lines 11-19:
{
"gas_used": 10457,
"gas_used": 15073,
"status": "Executed"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@

//# call-api chain.get_block_by_number [1]

//# run --signers creator --args {{$.call-api[0].header.number}}u64 --args {{$.call-api[0].header.block_hash}}
//# call-api state.get_with_proof_by_root_raw ["0x1/1/0x1::Account::Account","{{$.call-api[0].header.state_root}}"]

//# run --signers creator --args {{$.call-api[0].header.number}}u64 --args {{$.call-api[0].header.block_hash}} --args {{$.call-api[1]}}
script{
use StarcoinFramework::Vector;
fun main(_sender: signer, block_number: u64, block_hash: vector<u8>){
fun main(_sender: signer, block_number: u64, block_hash: vector<u8>, state_proof: vector<u8>){
assert!(block_number == 1, 1000);
assert!(Vector::length(&block_hash) == 32, 1001);
assert!(Vector::length(&state_proof) > 32, 1002);
}
}

0 comments on commit c4dca75

Please sign in to comment.