diff --git a/libraries/chain/apply_context.cpp b/libraries/chain/apply_context.cpp index 30eb3bbf39..69d3e7ef13 100644 --- a/libraries/chain/apply_context.cpp +++ b/libraries/chain/apply_context.cpp @@ -1092,7 +1092,7 @@ action_name apply_context::get_sender() const { bool apply_context::is_eos_vm_oc_whitelisted() const { return receiver.prefix() == config::system_account_name || // "eosio"_n - control.is_eos_vm_oc_whitelisted(receiver.suffix()); + control.is_eos_vm_oc_whitelisted(receiver); } // Context | OC? diff --git a/libraries/chain/controller.cpp b/libraries/chain/controller.cpp index 95f6220b35..6f332a7737 100644 --- a/libraries/chain/controller.cpp +++ b/libraries/chain/controller.cpp @@ -5702,8 +5702,8 @@ bool controller::is_profiling(account_name account) const { return my->conf.profile_accounts.find(account) != my->conf.profile_accounts.end(); } -bool controller::is_eos_vm_oc_whitelisted(account_name suffix) const { - return my->conf.eos_vm_oc_whitelist_suffixes.count(suffix) > 0; +bool controller::is_eos_vm_oc_whitelisted(account_name n) const { + return my->conf.eos_vm_oc_whitelist_suffixes.count(n.suffix()) > 0; } chain_id_type controller::get_chain_id()const { diff --git a/libraries/chain/include/eosio/chain/controller.hpp b/libraries/chain/include/eosio/chain/controller.hpp index dca7044997..2a4cb5742e 100644 --- a/libraries/chain/include/eosio/chain/controller.hpp +++ b/libraries/chain/include/eosio/chain/controller.hpp @@ -418,7 +418,7 @@ namespace eosio::chain { bool is_profiling(account_name name) const; - bool is_eos_vm_oc_whitelisted(account_name suffix) const; + bool is_eos_vm_oc_whitelisted(account_name n) const; chain_id_type get_chain_id()const; diff --git a/plugins/chain_plugin/test/plugin_config_test.cpp b/plugins/chain_plugin/test/plugin_config_test.cpp index b4a5111c9c..14ab1bfc45 100644 --- a/plugins/chain_plugin/test/plugin_config_test.cpp +++ b/plugins/chain_plugin/test/plugin_config_test.cpp @@ -36,5 +36,6 @@ BOOST_AUTO_TEST_CASE(chain_plugin_eos_vm_oc_whitelist) { BOOST_CHECK(app->initialize(args.size(), const_cast(args.data()))); auto& plugin = app->get_plugin(); BOOST_CHECK(plugin.chain().is_eos_vm_oc_whitelisted(eosio::chain::name{"hello"})); + BOOST_CHECK(plugin.chain().is_eos_vm_oc_whitelisted(eosio::chain::name{"xs.hello"})); BOOST_CHECK(!plugin.chain().is_eos_vm_oc_whitelisted(eosio::chain::name{"xsat"})); } diff --git a/unittests/misc_tests.cpp b/unittests/misc_tests.cpp index 5d54a1767c..a48232242f 100644 --- a/unittests/misc_tests.cpp +++ b/unittests/misc_tests.cpp @@ -124,6 +124,8 @@ BOOST_AUTO_TEST_CASE(name_suffix_additional_tests) { BOOST_CHECK_EQUAL( name{"eosioacco.unj"}.suffix(), name{"unj"} ); BOOST_CHECK_EQUAL( name{"eosioaccou.nj"}.suffix(), name{"nj"} ); BOOST_CHECK_EQUAL( name{"eosioaccoun.j"}.suffix(), name{"j"} ); + BOOST_CHECK_EQUAL( name{"eosioaccounja"}.suffix(), name{"eosioaccounja"} ); + BOOST_CHECK_EQUAL( name{"eosioaccounj"}.suffix(), name{"eosioaccounj"} ); BOOST_CHECK_EQUAL( name{"e.o.s.i.o.a.c"}.suffix(), name{"c"} ); BOOST_CHECK_EQUAL( name{"eos.ioa.cco"}.suffix(), name{"cco"} );