From 6c17992d6bfaa9232f24ccd24d51ae6a35b214b9 Mon Sep 17 00:00:00 2001 From: Kevin Heifner Date: Tue, 3 Jan 2023 16:58:51 -0600 Subject: [PATCH] GH-54 Remove mostly unused CORE_SYM_STR and just use CORE_SYMBOL --- libraries/testing/contracts.hpp.in | 19 +------------------ .../chain_plugin/test/test_chain_plugin.cpp | 5 +---- unittests/bootseq_tests.cpp | 2 +- unittests/eosio_system_tester.hpp | 2 +- unittests/state_history_tests.cpp | 2 +- 5 files changed, 5 insertions(+), 25 deletions(-) diff --git a/libraries/testing/contracts.hpp.in b/libraries/testing/contracts.hpp.in index 343fdac7be..eb7b1e53ea 100644 --- a/libraries/testing/contracts.hpp.in +++ b/libraries/testing/contracts.hpp.in @@ -1,24 +1,7 @@ #pragma once -#include - -#include #include - -#define CORE_SYM_NAME "${CORE_SYMBOL_NAME}" -#define CORE_SYM_PRECISION 4 - -#define _STRINGIZE1(x) #x -#define _STRINGIZE2(x) _STRINGIZE1(x) - -#define CORE_SYM_STR ( _STRINGIZE2(CORE_SYM_PRECISION) "," CORE_SYM_NAME ) -#define CORE_SYM ( ::eosio::chain::string_to_symbol_c( CORE_SYM_PRECISION, CORE_SYM_NAME ) ) - -struct core_sym { - static inline eosio::chain::asset from_string(const std::string& s) { - return eosio::chain::asset::from_string(s + " " CORE_SYM_NAME); - } -}; +#include // CN -> contract C++ name, C -> contract name, D -> top level directory #define MAKE_READ_WASM_ABI(CN,C, D) \ diff --git a/plugins/chain_plugin/test/test_chain_plugin.cpp b/plugins/chain_plugin/test/test_chain_plugin.cpp index 15b7533aa2..d83f1eaccf 100644 --- a/plugins/chain_plugin/test/test_chain_plugin.cpp +++ b/plugins/chain_plugin/test/test_chain_plugin.cpp @@ -11,11 +11,8 @@ #include #include #include -#include -#include #include #include -#include #ifdef NON_VALIDATING_TEST #define TESTER tester @@ -221,7 +218,7 @@ class chain_plugin_tester : public TESTER { base_tester::push_action(config::system_account_name, "init"_n, config::system_account_name, mutable_variant_object() ("version", 0) - ("core", CORE_SYM_STR)); + ("core", symbol(CORE_SYMBOL).to_string())); { const auto& accnt = control->db().get( config::system_account_name ); diff --git a/unittests/bootseq_tests.cpp b/unittests/bootseq_tests.cpp index efc1487c23..9699f3eb50 100644 --- a/unittests/bootseq_tests.cpp +++ b/unittests/bootseq_tests.cpp @@ -72,7 +72,7 @@ class bootseq_tester : public TESTER { base_tester::push_action(config::system_account_name, "init"_n, config::system_account_name, mutable_variant_object() ("version", 0) - ("core", CORE_SYM_STR) + ("core", symbol(CORE_SYMBOL).to_string()) ); } const auto& accnt = control->db().get( config::system_account_name ); diff --git a/unittests/eosio_system_tester.hpp b/unittests/eosio_system_tester.hpp index 17425fdb19..cb87112481 100644 --- a/unittests/eosio_system_tester.hpp +++ b/unittests/eosio_system_tester.hpp @@ -60,7 +60,7 @@ class eosio_system_tester : public TESTER { base_tester::push_action(config::system_account_name, "init"_n, config::system_account_name, mutable_variant_object() ("version", 0) - ("core", CORE_SYM_STR)); + ("core", symbol(CORE_SYMBOL).to_string())); { const auto& accnt = control->db().get( config::system_account_name ); diff --git a/unittests/state_history_tests.cpp b/unittests/state_history_tests.cpp index d97822c63d..9d9c4b00e2 100644 --- a/unittests/state_history_tests.cpp +++ b/unittests/state_history_tests.cpp @@ -376,7 +376,7 @@ BOOST_AUTO_TEST_CASE(test_deltas_resources_history) { chain.push_action(config::system_account_name, "init"_n, config::system_account_name, mutable_variant_object() ("version", 0) - ("core", CORE_SYM_STR)); + ("core", symbol(CORE_SYMBOL).to_string())); signed_transaction trx; chain.set_transaction_headers(trx);