diff --git a/crates/testsuite/features/bitcoin.feature b/crates/testsuite/features/bitcoin.feature index c8941f778c..59dc66b399 100644 --- a/crates/testsuite/features/bitcoin.feature +++ b/crates/testsuite/features/bitcoin.feature @@ -30,7 +30,7 @@ Feature: Rooch Bitcoin tests Then sleep: "10" # wait rooch sync and index # Update the reorg pending block count - Then cmd: "move run --function 0x4::pending_block::update_reorg_block_count_for_local --args u64:1" + Then cmd: "move run --function 0x4::pending_block::update_reorg_block_count_for_local --args u64:1 --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" Then cmd: "account list --json" diff --git a/crates/testsuite/features/bitseed.feature b/crates/testsuite/features/bitseed.feature index 8c7f000686..a1c22e95a4 100644 --- a/crates/testsuite/features/bitseed.feature +++ b/crates/testsuite/features/bitseed.feature @@ -38,7 +38,7 @@ Feature: Rooch CLI bitseed tests Then sleep: "10" # Sync bitseed - Then cmd: "move run --function default::bitseed_runner::run" + Then cmd: "move run --function default::bitseed_runner::run --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" # Check mint generator validity @@ -56,7 +56,7 @@ Feature: Rooch CLI bitseed tests Then sleep: "10" # Sync bitseed - Then cmd: "move run --function default::bitseed_runner::run" + Then cmd: "move run --function default::bitseed_runner::run --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" # Check deploy validity @@ -74,7 +74,7 @@ Feature: Rooch CLI bitseed tests Then sleep: "10" # Sync bitseed - Then cmd: "move run --function default::bitseed_runner::run" + Then cmd: "move run --function default::bitseed_runner::run --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" # Check mint bits validity @@ -114,7 +114,7 @@ Feature: Rooch CLI bitseed tests Then assert: "{{$.move[-1].execution_info.status.type}} == executed" # Sync bitseed - Then cmd: "move run --function default::bitseed_runner::run" + Then cmd: "move run --function default::bitseed_runner::run --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" # deploy @@ -127,7 +127,7 @@ Feature: Rooch CLI bitseed tests Then sleep: "10" # Sync bitseed - Then cmd: "move run --function default::bitseed_runner::run" + Then cmd: "move run --function default::bitseed_runner::run --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" # Check deploy validity @@ -136,7 +136,7 @@ Feature: Rooch CLI bitseed tests Then assert: "{{$.move[-1].return_values[0].decoded_value.value.vec[0].value.is_valid}} == true" # mint on rooch - Then cmd: "move run --function 0xa::mint_get_factory::mint --args string:bitseed --args string:test" + Then cmd: "move run --function 0xa::mint_get_factory::mint --args string:bitseed --args string:test --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" Then cmd: "object -t 0xa::bitseed::Bitseed -o {{$.account[-1].default.address}}" diff --git a/crates/testsuite/features/cmd.feature b/crates/testsuite/features/cmd.feature index 151b333b4e..eeb14aacd7 100644 --- a/crates/testsuite/features/cmd.feature +++ b/crates/testsuite/features/cmd.feature @@ -49,7 +49,7 @@ Feature: Rooch CLI integration tests Then assert: "'{{$.rpc[-1].balance}}' == '0'" # Get gas - Then cmd: "move run --function rooch_framework::gas_coin::faucet_entry --args u256:10000000000" + Then cmd: "move run --function rooch_framework::gas_coin::faucet_entry --args u256:10000000000 --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" Then cmd: "rpc request --method rooch_getStates --params '["/object/0x4e8d2c243339c6e02f8b7dd34436a1b1eb541b0fe4d938f845f4dbb9d9f218a2",{"decode":true}]' --json" @@ -61,7 +61,7 @@ Feature: Rooch CLI integration tests Then cmd: "session-key create --app-name test --app-url https:://test.rooch.network --scope 0x3::empty::empty" Then cmd: "session-key list" Then assert: "'{{$.session-key[-1]}}' not_contains error" - Then cmd: "move run --function 0x3::empty::empty --session-key {{$.session-key[-1][0].name}}" + Then cmd: "move run --function 0x3::empty::empty --session-key {{$.session-key[-1][0].name}} --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" # transaction @@ -98,11 +98,11 @@ Feature: Rooch CLI integration tests # event example and event prc Then cmd: "move publish -p ../../examples/event --named-addresses rooch_examples=default --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" - Then cmd: "move run --function default::event_test::emit_event --args 10u64" + Then cmd: "move run --function default::event_test::emit_event --args 10u64 --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" - Then cmd: "move run --function default::event_test::emit_event --args 11u64" + Then cmd: "move run --function default::event_test::emit_event --args 11u64 --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" - Then cmd: "move run --function default::event_test::emit_event --args 11u64" + Then cmd: "move run --function default::event_test::emit_event --args 11u64 --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" #cursor is None Then cmd: "event get-events-by-event-handle -t default::event_test::WithdrawEvent --limit 1 --descending-order false" @@ -123,9 +123,9 @@ Feature: Rooch CLI integration tests Given a server for indexer Then cmd: "move publish -p ../../examples/event --named-addresses rooch_examples=default --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" - Then cmd: "move run --function default::event_test::emit_event --args 10u64" + Then cmd: "move run --function default::event_test::emit_event --args 10u64 --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" - Then cmd: "move run --function default::event_test::emit_event --args 11u64" + Then cmd: "move run --function default::event_test::emit_event --args 11u64 --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" # because the indexer is async update, so sleep 5 seconds to wait indexer update. @@ -166,7 +166,7 @@ Feature: Rooch CLI integration tests Given a server for kv_store Then cmd: "move publish -p ../../examples/kv_store --named-addresses rooch_examples=default --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" - Then cmd: "move run --function default::kv_store::add_value --args string:key1 --args string:value1" + Then cmd: "move run --function default::kv_store::add_value --args string:key1 --args string:value1 --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" Then cmd: "move view --function default::kv_store::get_value --args string:key1" Then assert: "{{$.move[-1].vm_status}} == Executed" @@ -185,29 +185,29 @@ Feature: Rooch CLI integration tests Then cmd: "move publish -p ../../examples/entry_function_arguments/ --named-addresses rooch_examples=default --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" - Then cmd: "move run --function default::entry_function::emit_bool --args bool:true " + Then cmd: "move run --function default::entry_function::emit_bool --args bool:true --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" - Then cmd: "move run --function default::entry_function::emit_u8 --args u8:3 " + Then cmd: "move run --function default::entry_function::emit_u8 --args u8:3 --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" - Then cmd: "move run --function default::entry_function::emit_u8 --args 4u8 " + Then cmd: "move run --function default::entry_function::emit_u8 --args 4u8 --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" - Then cmd: "move run --function default::entry_function::emit_address --args address:0x3242 " + Then cmd: "move run --function default::entry_function::emit_address --args address:0x3242 --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" - Then cmd: "move run --function default::entry_function::emit_address --args @0x3242 " + Then cmd: "move run --function default::entry_function::emit_address --args @0x3242 --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" - Then cmd: "move run --function default::entry_function::emit_object_id --args object_id:0x3134 " + Then cmd: "move run --function default::entry_function::emit_object_id --args object_id:0x3134 --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" - Then cmd: "move run --function default::entry_function::emit_string --args string:world " + Then cmd: "move run --function default::entry_function::emit_string --args string:world --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" - Then cmd: "move run --function default::entry_function::emit_vec_u8 --args "vector:2,3,4" " + Then cmd: "move run --function default::entry_function::emit_vec_u8 --args "vector:2,3,4" --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" - Then cmd: "move run --function default::entry_function::emit_vec_object_id --args "vector:0x1324,0x41234,0x1234" " + Then cmd: "move run --function default::entry_function::emit_vec_object_id --args "vector:0x1324,0x41234,0x1234" --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" - Then cmd: "move run --function default::entry_function::emit_mix --args 3u8 --args "vector:0x2342,0x3132" " + Then cmd: "move run --function default::entry_function::emit_mix --args 3u8 --args "vector:0x2342,0x3132" --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" - Then cmd: "move run --function default::entry_function::emit_object --args "object:default::entry_function::TestStruct" " + Then cmd: "move run --function default::entry_function::emit_object --args "object:default::entry_function::TestStruct" --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" - Then cmd: "move run --function default::entry_function::emit_object_mut --args "object:default::entry_function::TestStruct" " + Then cmd: "move run --function default::entry_function::emit_object_mut --args "object:default::entry_function::TestStruct" --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" Then stop the server @@ -231,7 +231,7 @@ Feature: Rooch CLI integration tests Then assert: "{{$.move[-1].execution_info.status.type}} == executed" Then cmd: "move view --function default::counter::value" Then assert: "{{$.move[-1].return_values[0].decoded_value}} == 0" - Then cmd: "move run --function default::counter::increase " + Then cmd: "move run --function default::counter::increase --json" Then cmd: "move view --function default::counter::value" Then assert: "{{$.move[-1].return_values[0].decoded_value}} == 1" Then cmd: "resource --address default --resource default::counter::Counter" @@ -240,11 +240,11 @@ Feature: Rooch CLI integration tests # The entry_function_arguments example Then cmd: "move publish -p ../../examples/entry_function_arguments_old/ --named-addresses rooch_examples=default --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" - Then cmd: "move run --function default::entry_function::emit_mix --args 3u8 --args "vector:0x2342,0x3132" " + Then cmd: "move run --function default::entry_function::emit_mix --args 3u8 --args "vector:0x2342,0x3132" --json" Then assert: "'{{$.move[-1]}}' contains FUNCTION_RESOLUTION_FAILURE" Then cmd: "move publish -p ../../examples/entry_function_arguments/ --named-addresses rooch_examples=default --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" - Then cmd: "move run --function default::entry_function::emit_mix --args 3u8 --args "vector:0x2342,0x3132" " + Then cmd: "move run --function default::entry_function::emit_mix --args 3u8 --args "vector:0x2342,0x3132" --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" # check compatibility @@ -259,7 +259,7 @@ Feature: Rooch CLI integration tests Then cmd: "account create --json" Then cmd: "move publish -p ../../examples/coins --named-addresses coins=default --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" - Then cmd: "move run --function default::fixed_supply_coin::faucet --args object:default::fixed_supply_coin::Treasury" + Then cmd: "move run --function default::fixed_supply_coin::faucet --args object:default::fixed_supply_coin::Treasury --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" Then cmd: "account list --json" @@ -284,11 +284,11 @@ Feature: Rooch CLI integration tests Then assert: "{{$.move[-1].execution_info.status.type}} == executed" #TODO: uncomment this once move_module::binding_module_address is ready - #Then cmd: "move run --function default::coin_factory::issue_fixed_supply_coin --args string:my_coin --args string:"My first coin" --args string:MyCoin --args 1010101u256 --args 8u8 " + #Then cmd: "move run --function default::coin_factory::issue_fixed_supply_coin --args string:my_coin --args string:"My first coin" --args string:MyCoin --args 1010101u256 --args 8u8 --json" #Then assert: "{{$.move[-1].execution_info.status.type}} == executed" # check module `my_coin` is published, the name `my_coin` is the first arg in the last `move run` cmd. - #Then cmd: "move run --function default::my_coin::faucet --args object:default::my_coin::Treasury" + #Then cmd: "move run --function default::my_coin::faucet --args object:default::my_coin::Treasury --json" #Then assert: "{{$.move[-1].execution_info.status.type}} == executed" #Then cmd: "rpc request --method rooch_getBalance --params '["{{$.address_mapping.default}}", "{{$.address_mapping.default}}::my_coin::MyCoin"]' --json" @@ -305,10 +305,10 @@ Feature: Rooch CLI integration tests Then assert: "{{$.move[-1].execution_info.status.type}} == executed" #object pub transfer - Then cmd: "move run --function default::third_party_module::create_and_pub_transfer --args u64:1" + Then cmd: "move run --function default::third_party_module::create_and_pub_transfer --args u64:1 --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" Then cmd: "event get-events-by-event-handle -t default::pub_transfer::NewPubEvent" - Then cmd: "move run --function 0x3::transfer::transfer_object --type-args default::pub_transfer::Pub --args address:{{$.account[-1].account0.hex_address}} --args object:{{$.event[-1].data[0].decoded_event_data.value.id}}" + Then cmd: "move run --function 0x3::transfer::transfer_object --type-args default::pub_transfer::Pub --args address:{{$.account[-1].account0.hex_address}} --args object:{{$.event[-1].data[0].decoded_event_data.value.id}} --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" #TODO FIXME the indexer do not update the owner after object transfer. Then sleep: "2" @@ -316,14 +316,14 @@ Feature: Rooch CLI integration tests Then assert: "{{$.object[-1].data[0].owner}} == {{$.account[-1].account0.address}}" #child object - Then cmd: "move run --function default::third_party_module_for_child_object::create_child --args string:alice" + Then cmd: "move run --function default::third_party_module_for_child_object::create_child --args string:alice --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" Then cmd: "event get-events-by-event-handle -t default::child_object::NewChildEvent" Then cmd: "state --access-path /object/{{$.event[-1].data[0].decoded_event_data.value.id}}" Then assert: "{{$.state[-1][0].decoded_value.value.name}} == alice" - Then cmd: "move run --function default::third_party_module_for_child_object::update_child_name --args object:{{$.event[-1].data[0].decoded_event_data.value.id}} --args string:bob" + Then cmd: "move run --function default::third_party_module_for_child_object::update_child_name --args object:{{$.event[-1].data[0].decoded_event_data.value.id}} --args string:bob --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" Then cmd: "state --access-path /object/{{$.event[-1].data[0].decoded_event_data.value.id}}" @@ -335,14 +335,14 @@ Feature: Rooch CLI integration tests Then cmd: "object -t {{$.address_mapping.default}}::child_object::Child --limit 10 -d" Then assert: "{{$.object[-1].data[0].id}} == {{$.event[-1].data[0].decoded_event_data.value.id}}" - Then cmd: "move run --function default::third_party_module_for_child_object::update_child_age --args object:{{$.event[-1].data[0].decoded_event_data.value.id}} --args u64:10" + Then cmd: "move run --function default::third_party_module_for_child_object::update_child_age --args object:{{$.event[-1].data[0].decoded_event_data.value.id}} --args u64:10 --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" Then cmd: "move view --function default::child_object::get_age --args object:{{$.event[-1].data[0].decoded_event_data.value.id}}" Then assert: "{{$.move[-1].vm_status}} == Executed" Then assert: "{{$.move[-1].return_values[0].decoded_value}} == 10" - Then cmd: "move run --function default::third_party_module_for_child_object::remove_child --args object:{{$.event[-1].data[0].decoded_event_data.value.id}}" + Then cmd: "move run --function default::third_party_module_for_child_object::remove_child --args object:{{$.event[-1].data[0].decoded_event_data.value.id}} --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" Then stop the server @@ -354,7 +354,7 @@ Feature: Rooch CLI integration tests Then cmd: "move publish -p ../../examples/display --named-addresses display=default --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" - Then cmd: "move run --function default::display::create_object --sender default --args 'string:test_object' --args 'address:default' --args 'string:test object description'" + Then cmd: "move run --function default::display::create_object --sender default --args 'string:test_object' --args 'address:default' --args 'string:test object description' --json" Then cmd: "event get-events-by-event-handle -t default::display::NewObjectEvent" Then cmd: "state --access-path /object/{{$.event[-1].data[0].decoded_event_data.value.id}}" @@ -386,23 +386,23 @@ Feature: Rooch CLI integration tests Then assert: "{{$.move[-1].execution_info.status.type}} == executed" # test wasm trap - Then cmd: "move run --function default::wasm_execution::run_trap" + Then cmd: "move run --function default::wasm_execution::run_trap --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" # test wasm forever - Then cmd: "move run --function default::wasm_execution::run_infinite_loop" + Then cmd: "move run --function default::wasm_execution::run_infinite_loop --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" # test wasm alloc - Then cmd: "move run --function default::wasm_execution::run_alloc" + Then cmd: "move run --function default::wasm_execution::run_alloc --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" # run wasm cpp generator - Then cmd: "move run --function default::wasm_execution::run_generator_cpp" + Then cmd: "move run --function default::wasm_execution::run_generator_cpp --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" # run wasm rust generator - Then cmd: "move run --function default::wasm_execution::run_generator_rust" + Then cmd: "move run --function default::wasm_execution::run_generator_rust --json" Then assert: "{{$.move[-1].execution_info.status.type}} == executed" # release servers