tests for ship & snapshots with jumbo rows
This commit is contained in:
@@ -155,6 +155,22 @@ try:
|
||||
Print("Shutdown unneeded bios node")
|
||||
cluster.biosNode.kill(signal.SIGTERM)
|
||||
|
||||
Print("Create a jumbo row")
|
||||
contract = "jumborow"
|
||||
contractDir = "unittests/contracts/%s" % (contract)
|
||||
wasmFile = "%s.wasm" % (contract)
|
||||
abiFile = "%s.abi" % (contract)
|
||||
|
||||
nonProdNode.publishContract(accounts[0], contractDir, wasmFile, abiFile)
|
||||
jumbotxn = {
|
||||
|
||||
"actions": [{"account": "testeraaaaaa","name": "jumbotime",
|
||||
"authorization": [{"actor": "testeraaaaaa","permission": "active"}],
|
||||
"data": "",
|
||||
"compression": "none"}]
|
||||
}
|
||||
nonProdNode.pushTransaction(jumbotxn)
|
||||
|
||||
Print("Configure and launch txn generators")
|
||||
targetTpsPerGenerator = 10
|
||||
testTrxGenDurationSec=60*60
|
||||
|
||||
@@ -26,3 +26,4 @@ add_subdirectory(eosio.system)
|
||||
add_subdirectory(eosio.token)
|
||||
add_subdirectory(eosio.wrap)
|
||||
add_subdirectory(eosio.mechanics)
|
||||
add_subdirectory(jumborow)
|
||||
@@ -0,0 +1,2 @@
|
||||
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/jumborow.wasm ${CMAKE_CURRENT_BINARY_DIR}/jumborow.wasm COPYONLY )
|
||||
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/jumborow.abi ${CMAKE_CURRENT_BINARY_DIR}/jumborow.abi COPYONLY )
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"version": "eosio::abi/1.0",
|
||||
"types": [],
|
||||
"structs": [{
|
||||
"name": "jumbo",
|
||||
"base": "",
|
||||
"fields": []
|
||||
}
|
||||
],
|
||||
"actions": [{
|
||||
"name": "jumbotime",
|
||||
"type": "jumbo",
|
||||
"ricardian_contract": ""
|
||||
}
|
||||
],
|
||||
"tables": [],
|
||||
"ricardian_clauses": [],
|
||||
"error_messages": [],
|
||||
"abi_extensions": [],
|
||||
"variants": [],
|
||||
"action_results": []
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,8 @@
|
||||
(module
|
||||
(import "env" "db_store_i64" (func $db_store_i64 (param i64 i64 i64 i64 i32 i32) (result i32)))
|
||||
(memory $0 528)
|
||||
(export "apply" (func $apply))
|
||||
(func $apply (param $receiver i64) (param $account i64) (param $action_name i64)
|
||||
(drop (call $db_store_i64 (local.get $receiver) (local.get $receiver) (local.get $receiver) (i64.const 0) (i32.const 1) (i32.const 34603007)))
|
||||
)
|
||||
)
|
||||
@@ -990,4 +990,15 @@ static const char negative_memory_grow_trap_wast[] = R"=====(
|
||||
)
|
||||
)
|
||||
)
|
||||
)=====";
|
||||
|
||||
static const char set_jumbo_row_wast[] = R"=====(
|
||||
(module
|
||||
(import "env" "db_store_i64" (func $db_store_i64 (param i64 i64 i64 i64 i32 i32) (result i32)))
|
||||
(memory $0 528)
|
||||
(export "apply" (func $apply))
|
||||
(func $apply (param $receiver i64) (param $account i64) (param $action_name i64)
|
||||
(drop (call $db_store_i64 (get_local $receiver) (get_local $receiver) (get_local $receiver) (i64.const 0) (i32.const 1) (i32.const 34603007)))
|
||||
)
|
||||
)
|
||||
)=====";
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
#include <test_contracts.hpp>
|
||||
#include <snapshots.hpp>
|
||||
#include "test_wasts.hpp"
|
||||
|
||||
using namespace eosio;
|
||||
using namespace testing;
|
||||
@@ -653,4 +654,37 @@ BOOST_AUTO_TEST_CASE(json_snapshot_validity_test)
|
||||
remove(json_snap_path);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE_TEMPLATE(jumbo_row, SNAPSHOT_SUITE, snapshot_suites)
|
||||
{
|
||||
fc::temp_directory tempdir;
|
||||
auto config = tester::default_config(tempdir);
|
||||
config.first.state_size = 64*1024*1024;
|
||||
tester chain(config.first, config.second);
|
||||
chain.execute_setup_policy(setup_policy::full);
|
||||
|
||||
chain.create_accounts({"jumbo"_n});
|
||||
chain.set_code("jumbo"_n, set_jumbo_row_wast);
|
||||
chain.produce_blocks(1);
|
||||
|
||||
signed_transaction trx;
|
||||
action act;
|
||||
act.account = "jumbo"_n;
|
||||
act.name = "jumbo"_n;
|
||||
act.authorization = vector<permission_level>{{"jumbo"_n,config::active_name}};
|
||||
trx.actions.push_back(act);
|
||||
|
||||
chain.set_transaction_headers(trx);
|
||||
trx.sign(tester::get_private_key("jumbo"_n, "active"), chain.control->get_chain_id());
|
||||
chain.push_transaction(trx);
|
||||
chain.produce_blocks(1);
|
||||
|
||||
chain.control->abort_block();
|
||||
|
||||
auto writer = SNAPSHOT_SUITE::get_writer();
|
||||
chain.control->write_snapshot(writer);
|
||||
auto snapshot = SNAPSHOT_SUITE::finalize(writer);
|
||||
|
||||
snapshotted_tester sst(chain.get_config(), SNAPSHOT_SUITE::get_reader(snapshot), 0);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
Reference in New Issue
Block a user