Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

Commit

Permalink
fix eosio.msig tests; cleanup symbol macros
Browse files Browse the repository at this point in the history
  • Loading branch information
arhag committed Oct 1, 2018
1 parent 00bfdfb commit 89b419b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
10 changes: 6 additions & 4 deletions tests/eosio.msig_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,9 @@ BOOST_FIXTURE_TEST_CASE( update_system_contract_all_approve, eosio_msig_tester )

set_code( config::system_account_name, contracts::system_wasm() );
set_abi( config::system_account_name, contracts::system_abi().data() );
base_tester::push_action(config::system_account_name, N(init),
config::system_account_name, mutable_variant_object()
("core", CORE_SYM_STR));
base_tester::push_action( config::system_account_name, N(init),
config::system_account_name, mutable_variant_object()
("core", CORE_SYM_STR) );
produce_blocks();
create_account_with_resources( N(alice1111111), N(eosio), core_sym::from_string("1.0000"), false );
create_account_with_resources( N(bob111111111), N(eosio), core_sym::from_string("0.4500"), false );
Expand Down Expand Up @@ -525,7 +525,9 @@ BOOST_FIXTURE_TEST_CASE( update_system_contract_major_approve, eosio_msig_tester

set_code( config::system_account_name, contracts::system_wasm() );
set_abi( config::system_account_name, contracts::system_abi().data() );

base_tester::push_action( config::system_account_name, N(init),
config::system_account_name, mutable_variant_object()
("core", CORE_SYM_STR) );
produce_blocks();

create_account_with_resources( N(alice1111111), N(eosio), core_sym::from_string("1.0000"), false );
Expand Down
11 changes: 8 additions & 3 deletions tests/test_symbol.hpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
#pragma once
#define CORE_SYM SY(4, TST)

#define CORE_SYM_NAME "TST"
#define CORE_SYM_STR "4,TST"
#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);
}
};

0 comments on commit 89b419b

Please sign in to comment.