Skip to content

Commit

Permalink
Revert "GH-54 Remove mostly unused CORE_SYM_STR and just use CORE_SYM…
Browse files Browse the repository at this point in the history
…BOL_NAME"

This reverts commit bb470fa.
  • Loading branch information
heifner committed Jan 3, 2023
1 parent c168977 commit 4dc4296
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
15 changes: 15 additions & 0 deletions libraries/testing/contracts.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@
#include <eosio/chain/asset.hpp>
#include <fc/io/fstream.hpp>

#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);
}
};

// CN -> contract C++ name, C -> contract name, D -> top level directory
#define MAKE_READ_WASM_ABI(CN,C, D) \
static std::vector<uint8_t> CN ## _wasm() { \
Expand Down
2 changes: 1 addition & 1 deletion plugins/chain_plugin/test/test_chain_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,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_SYMBOL_NAME));
("core", CORE_SYM_STR));

{
const auto& accnt = control->db().get<account_object,by_name>( config::system_account_name );
Expand Down
2 changes: 1 addition & 1 deletion unittests/bootseq_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_SYMBOL_NAME)
("core", CORE_SYM_STR)
);
}
const auto& accnt = control->db().get<account_object,by_name>( config::system_account_name );
Expand Down
2 changes: 1 addition & 1 deletion unittests/eosio_system_tester.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_SYMBOL_NAME));
("core", CORE_SYM_STR));

{
const auto& accnt = control->db().get<account_object,by_name>( config::system_account_name );
Expand Down
2 changes: 1 addition & 1 deletion unittests/state_history_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_SYMBOL_NAME));
("core", CORE_SYM_STR));

signed_transaction trx;
chain.set_transaction_headers(trx);
Expand Down

0 comments on commit 4dc4296

Please sign in to comment.