[EOSIO/eos] Refactor max_serialization_time to be passed as argument instead (#4463)

andriantolie commented on this pull request.

> @@ -252,7 +252,8 @@ namespace {
abi = chain::eosio_contract_abi(abi);
}
abis.set_abi(abi);
– auto v = abis.binary_to_variant(abis.get_action_type(msg.name), msg.data);
+ chain_plugin* chain_plug = app().find_plugin();
+ auto v = abis.binary_to_variant(abis.get_action_type(msg.name), msg.data, chain_plug.chain().get_abi_serializer_max_time_ms());

get_abi_serializer_max_time_ms of chain_controller is already removed

> @@ -638,7 +639,8 @@ void mongo_db_plugin_impl::update_account(const chain::action& msg) {
auto eosio_account = find_account(accounts, msg.account);
auto abi = fc::json::from_string(bsoncxx::to_json(eosio_account.view()[“abi”].get_document())).as();
abis.set_abi(abi);
– auto transfer = abis.binary_to_variant(abis.get_action_type(msg.name), msg.data);
+ chain_plugin* chain_plug = app().find_plugin();
+ auto transfer = abis.binary_to_variant(abis.get_action_type(msg.name), msg.data, chain_plug.chain().get_abi_serializer_max_time_ms());

get_abi_serializer_max_time_ms of chain_controller is already removed

> @@ -443,7 +443,7 @@ fc::variant account_history_plugin_impl::transaction_to_variant(const packed_tra
};

fc::variant pretty_output;
– abi_serializer::to_variant(ptrx, pretty_output, resolver);
+ abi_serializer::to_variant(ptrx, pretty_output, resolver, chain_plug->chain().get_abi_serializer_max_time_ms());

get_abi_serializer_max_time_ms of chain_controller is already removed. But I guess, we won’t need to use account_history_plugin anymore since we have history_plugin now.

> @@ -437,7 +437,7 @@ class eosio_system_tester : public TESTER {
action act;
act.account = N(eosio.msig);
act.name = name;
– act.data = msig_abi_ser.variant_to_binary( action_type_name, data );
+ act.data = msig_abi_ser.variant_to_binary( action_type_name, data, control->get_abi_serializer_max_time_ms() );

get_abi_serializer_max_time_ms of chain_controller is already removed (this piece of code is actually just inside a comment)

> @@ -151,19 +151,19 @@ class eosio_msig_tester : public tester {
action act;
act.account = N(eosio.msig);
act.name = name;
– act.data = abi_ser.variant_to_binary( action_type_name, data );
+ act.data = abi_ser.variant_to_binary( action_type_name, data, control->get_abi_serializer_max_time_ms() );

get_abi_serializer_max_time_ms of chain_controller is already removed (this piece of code is actually just inside a comment)

This post was last modified on July 6, 2018, 6:01 am