Skip to content

Commit

Permalink
Added plumbing to be able to set max_inline_action_size to be able to…
Browse files Browse the repository at this point in the history
… match the old default value.
  • Loading branch information
brianjohnson5972 committed Jul 6, 2020
1 parent 4364f49 commit 2963e9b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
14 changes: 9 additions & 5 deletions libraries/testing/include/eosio/testing/tester.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ namespace eosio { namespace testing {

virtual ~base_tester() {};

void init(const setup_policy policy = setup_policy::full, db_read_mode read_mode = db_read_mode::SPECULATIVE);
void init(const setup_policy policy = setup_policy::full, db_read_mode read_mode = db_read_mode::SPECULATIVE, optional<uint32_t> genesis_max_inline_action_size = optional<uint32_t>{});
void init(controller::config config, const snapshot_reader_ptr& snapshot);
void init(controller::config config, const genesis_state& genesis);
void init(controller::config config);
Expand Down Expand Up @@ -390,7 +390,7 @@ namespace eosio { namespace testing {
return genesis;
}

static std::pair<controller::config, genesis_state> default_config(const fc::temp_directory& tempdir) {
static std::pair<controller::config, genesis_state> default_config(const fc::temp_directory& tempdir, optional<uint32_t> genesis_max_inline_action_size = optional<uint32_t>{}) {
controller::config cfg;
cfg.blocks_dir = tempdir.path() / config::default_blocks_dir_name;
cfg.state_dir = tempdir.path() / config::default_state_dir_name;
Expand All @@ -411,7 +411,11 @@ namespace eosio { namespace testing {
else if(boost::unit_test::framework::master_test_suite().argv[i] == std::string("--eos-vm-oc"))
cfg.wasm_runtime = chain::wasm_interface::vm_type::eos_vm_oc;
}
return {cfg, default_genesis()};
auto gen = default_genesis();
if (genesis_max_inline_action_size) {
gen.initial_configuration.max_inline_action_size = *genesis_max_inline_action_size;
}
return {cfg, gen};
}

protected:
Expand Down Expand Up @@ -441,8 +445,8 @@ namespace eosio { namespace testing {

class tester : public base_tester {
public:
tester(setup_policy policy = setup_policy::full, db_read_mode read_mode = db_read_mode::SPECULATIVE) {
init(policy, read_mode);
tester(setup_policy policy = setup_policy::full, db_read_mode read_mode = db_read_mode::SPECULATIVE, optional<uint32_t> genesis_max_inline_action_size = optional<uint32_t>{}) {
init(policy, read_mode, genesis_max_inline_action_size);
}

tester(controller::config config, const genesis_state& genesis) {
Expand Down
4 changes: 2 additions & 2 deletions libraries/testing/tester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ namespace eosio { namespace testing {
return control->head_block_id() == other.control->head_block_id();
}

void base_tester::init(const setup_policy policy, db_read_mode read_mode) {
auto def_conf = default_config(tempdir);
void base_tester::init(const setup_policy policy, db_read_mode read_mode, optional<uint32_t> genesis_max_inline_action_size) {
auto def_conf = default_config(tempdir, genesis_max_inline_action_size);
def_conf.first.read_mode = read_mode;
cfg = def_conf.first;

Expand Down

0 comments on commit 2963e9b

Please sign in to comment.