Skip to content

Commit

Permalink
GH-54 Remove mostly unused CORE_SYM_STR and just use CORE_SYMBOL
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Jan 3, 2023
1 parent 4dc4296 commit 6c17992
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 25 deletions.
19 changes: 1 addition & 18 deletions libraries/testing/contracts.hpp.in
Original file line number Diff line number Diff line change
@@ -1,24 +1,7 @@
#pragma once

#include <vector>

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

// CN -> contract C++ name, C -> contract name, D -> top level directory
#define MAKE_READ_WASM_ABI(CN,C, D) \
Expand Down
5 changes: 1 addition & 4 deletions plugins/chain_plugin/test/test_chain_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@
#include <eosio/chain/resource_limits.hpp>
#include <eosio/chain/wast_to_wasm.hpp>
#include <cstdlib>
#include <iostream>
#include <sstream>
#include <fc/log/logger.hpp>
#include <eosio/chain/exceptions.hpp>
#include <Runtime/Runtime.h>

#ifdef NON_VALIDATING_TEST
#define TESTER tester
Expand Down Expand Up @@ -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<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_SYM_STR)
("core", symbol(CORE_SYMBOL).to_string())
);
}
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_SYM_STR));
("core", symbol(CORE_SYMBOL).to_string()));

{
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_SYM_STR));
("core", symbol(CORE_SYMBOL).to_string()));

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

0 comments on commit 6c17992

Please sign in to comment.