-
Notifications
You must be signed in to change notification settings - Fork 290
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mpm] add some integration test (#3635)
- Loading branch information
Showing
6 changed files
with
64 additions
and
14 deletions.
There are no files selected for viewing
8 changes: 7 additions & 1 deletion
8
vm/starcoin-transactional-test-harness/tests/cases/call_api_cmd.exp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
24 changes: 11 additions & 13 deletions
24
vm/starcoin-transactional-test-harness/tests/cases/call_api_cmd.move
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
vm/starcoin-transactional-test-harness/tests/cases/call_api_cmd_halley.exp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
14 changes: 14 additions & 0 deletions
14
vm/starcoin-transactional-test-harness/tests/cases/call_api_cmd_halley.move
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
vm/starcoin-transactional-test-harness/tests/cases/package_deploy_cmd.exp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
18 changes: 18 additions & 0 deletions
18
vm/starcoin-transactional-test-harness/tests/cases/package_deploy_cmd.move
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |