Skip to content

Commit

Permalink
[mpm] add some integration test (#3635)
Browse files Browse the repository at this point in the history
  • Loading branch information
jolestar authored Aug 10, 2022
1 parent 3bba812 commit b6aa4f3
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
processed 1 task
processed 5 tasks

task 4 'run'. lines 9-16:
{
"gas_used": 10457,
"status": "Executed"
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
//# init -n dev

// TODO: this test need the new StateApi `get_state_node_by_node_hash` updated on main net.
// //# init --rpc http://main.seed.starcoin.org --block-number 6860000
//# faucet --addr creator --amount 100000000000

// //# faucet --addr creator --amount 100000000000
//# block --author=0x2

// //# call-api chain.get_block_by_number [6860000]
//# 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}}
// script{
// use StarcoinFramework::Vector;
// fun main(_sender: signer, block_number: u64, block_hash: vector<u8>){
// assert!(block_number == 6860000, 1000);
// assert!(Vector::length(&block_hash) == 32, 1001);
// assert!(x"9b53ef17647e66b8946e2b766f6ec8c3c948c5ff07f7f583890548cd7afba7f5" == block_hash, 1002);
// }
// }
//# run --signers creator --args {{$.call-api[0].header.number}}u64 --args {{$.call-api[0].header.block_hash}}
script{
use StarcoinFramework::Vector;
fun main(_sender: signer, block_number: u64, block_hash: vector<u8>){
assert!(block_number == 1, 1000);
assert!(Vector::length(&block_hash) == 32, 1001);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
processed 4 tasks

task 3 'run'. lines 7-14:
{
"gas_used": 10457,
"status": "Executed"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//# init --rpc http://halley.seed.starcoin.org --block-number 1

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

//# 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}}
script{
use StarcoinFramework::Vector;
fun main(_sender: signer, block_number: u64, block_hash: vector<u8>){
assert!(block_number == 1, 1000);
assert!(Vector::length(&block_hash) == 32, 1001);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
processed 5 tasks

task 4 'run'. lines 12-18:
{
"gas_used": 11344,
"status": "Executed"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//# init -n dev

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

//# package
module creator::test {
public fun hello(){}
}

//# deploy {{$.package[0].file}}

//# run --signers creator
script{
use creator::test;
fun main(_sender: signer){
test::hello();
}
}

0 comments on commit b6aa4f3

Please sign in to comment.