|
| #define | ELECTRONEUM_DEFAULT_LOG_CATEGORY "tests.core" |
| |
| #define | DEFAULT_HARDFORKS(HARDFORKS) |
| |
| #define | ADD_HARDFORK(HARDFORKS, FORK, HEIGHT) HARDFORKS.push_back(std::make_pair((uint8_t)FORK, (uint64_t)HEIGHT)) |
| |
| #define | GENERATE_ACCOUNT(account) |
| |
| #define | GENERATE_MULTISIG_ACCOUNT(account, threshold, total) |
| |
| #define | MAKE_ACCOUNT(VEC_EVENTS, account) |
| |
| #define | DO_CALLBACK(VEC_EVENTS, CB_NAME) |
| |
| #define | REGISTER_CALLBACK(CB_NAME, CLBACK) register_callback(CB_NAME, std::bind(&CLBACK, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); |
| |
| #define | REGISTER_CALLBACK_METHOD(CLASS, METHOD) register_callback(#METHOD, std::bind(&CLASS::METHOD, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); |
| |
| #define | MAKE_GENESIS_BLOCK(VEC_EVENTS, BLK_NAME, MINER_ACC, TS) |
| |
| #define | MAKE_NEXT_BLOCK(VEC_EVENTS, BLK_NAME, PREV_BLOCK, MINER_ACC) |
| |
| #define | MAKE_NEXT_BLOCK_HF(VEC_EVENTS, BLK_NAME, PREV_BLOCK, MINER_ACC, HF) |
| |
| #define | MAKE_NEXT_BLOCK_TX1(VEC_EVENTS, BLK_NAME, PREV_BLOCK, MINER_ACC, TX1) |
| |
| #define | MAKE_NEXT_BLOCK_TX1_HF(VEC_EVENTS, BLK_NAME, PREV_BLOCK, MINER_ACC, TX1, HF) |
| |
| #define | MAKE_NEXT_BLOCK_TX_LIST(VEC_EVENTS, BLK_NAME, PREV_BLOCK, MINER_ACC, TXLIST) |
| |
| #define | MAKE_NEXT_BLOCK_TX_LIST_HF(VEC_EVENTS, BLK_NAME, PREV_BLOCK, MINER_ACC, TXLIST, HF) |
| |
| #define | REWIND_BLOCKS_N_HF(VEC_EVENTS, BLK_NAME, PREV_BLOCK, MINER_ACC, COUNT, HF) |
| |
| #define | REWIND_BLOCKS_N(VEC_EVENTS, BLK_NAME, PREV_BLOCK, MINER_ACC, COUNT) REWIND_BLOCKS_N_HF(VEC_EVENTS, BLK_NAME, PREV_BLOCK, MINER_ACC, COUNT, boost::none) |
| |
| #define | REWIND_BLOCKS(VEC_EVENTS, BLK_NAME, PREV_BLOCK, MINER_ACC) REWIND_BLOCKS_N(VEC_EVENTS, BLK_NAME, PREV_BLOCK, MINER_ACC, CRYPTONOTE_MINED_ETN_UNLOCK_WINDOW) |
| |
| #define | REWIND_BLOCKS_HF(VEC_EVENTS, BLK_NAME, PREV_BLOCK, MINER_ACC, HF) REWIND_BLOCKS_N_HF(VEC_EVENTS, BLK_NAME, PREV_BLOCK, MINER_ACC, CRYPTONOTE_MINED_ETN_UNLOCK_WINDOW, HF) |
| |
| #define | MAKE_TX_MIX(VEC_EVENTS, TX_NAME, FROM, TO, AMOUNT, NMIX, HEAD) |
| |
| #define | MAKE_TX_MIX_RCT(VEC_EVENTS, TX_NAME, FROM, TO, AMOUNT, NMIX, HEAD) |
| |
| #define | MAKE_TX(VEC_EVENTS, TX_NAME, FROM, TO, AMOUNT, HEAD) MAKE_TX_MIX(VEC_EVENTS, TX_NAME, FROM, TO, AMOUNT, 0, HEAD) |
| |
| #define | MAKE_TX_MIX_LIST(VEC_EVENTS, SET_NAME, FROM, TO, AMOUNT, NMIX, HEAD) |
| |
| #define | MAKE_TX_MIX_LIST_RCT(VEC_EVENTS, SET_NAME, FROM, TO, AMOUNT, NMIX, HEAD) MAKE_TX_MIX_LIST_RCT_EX(VEC_EVENTS, SET_NAME, FROM, TO, AMOUNT, NMIX, HEAD, rct::RangeProofPaddedBulletproof, 1) |
| |
| #define | MAKE_TX_MIX_LIST_RCT_EX(VEC_EVENTS, SET_NAME, FROM, TO, AMOUNT, NMIX, HEAD, RCT_TYPE, BP_VER) |
| |
| #define | MAKE_TX_MIX_DEST_LIST_RCT(VEC_EVENTS, SET_NAME, FROM, TO, NMIX, HEAD) MAKE_TX_MIX_DEST_LIST_RCT_EX(VEC_EVENTS, SET_NAME, FROM, TO, NMIX, HEAD, rct::RangeProofPaddedBulletproof, 1) |
| |
| #define | MAKE_TX_MIX_DEST_LIST_RCT_EX(VEC_EVENTS, SET_NAME, FROM, TO, NMIX, HEAD, RCT_TYPE, BP_VER) |
| |
| #define | MAKE_TX_LIST(VEC_EVENTS, SET_NAME, FROM, TO, AMOUNT, HEAD) MAKE_TX_MIX_LIST(VEC_EVENTS, SET_NAME, FROM, TO, AMOUNT, 0, HEAD) |
| |
| #define | MAKE_TX_LIST_START(VEC_EVENTS, SET_NAME, FROM, TO, AMOUNT, HEAD) |
| |
| #define | MAKE_TX_LIST_START_RCT(VEC_EVENTS, SET_NAME, FROM, TO, AMOUNT, NMIX, HEAD) |
| |
| #define | MAKE_MINER_TX_AND_KEY_MANUALLY(TX, BLK, KEY) |
| |
| #define | MAKE_MINER_TX_MANUALLY(TX, BLK) MAKE_MINER_TX_AND_KEY_MANUALLY(TX, BLK, 0) |
| |
| #define | SET_EVENT_VISITOR_SETT(VEC_EVENTS, SETT, VAL) VEC_EVENTS.push_back(event_visitor_settings(SETT, VAL)); |
| |
| #define | GENERATE(filename, genclass) |
| |
| #define | PLAY(filename, genclass) |
| |
| #define | CATCH_REPLAY(genclass) |
| |
| #define | REPLAY_CORE(genclass) |
| |
| #define | REPLAY_WITH_CORE(genclass, CORE) |
| |
| #define | CATCH_GENERATE_REPLAY(genclass) |
| |
| #define | CATCH_GENERATE_REPLAY_CORE(genclass, CORE) |
| |
| #define | GENERATE_AND_PLAY(genclass) |
| |
| #define | GENERATE_AND_PLAY_INSTANCE(genclass, ins, CORE) |
| |
| #define | CALL_TEST(test_name, function) |
| |
| #define | QUOTEME(x) #x |
| |
| #define | DEFINE_TESTS_ERROR_CONTEXT(text) const char* perr_context = text; |
| |
| #define | CHECK_TEST_CONDITION(cond) CHECK_AND_ASSERT_MES(cond, false, "[" << perr_context << "] failed: \"" << QUOTEME(cond) << "\"") |
| |
| #define | CHECK_EQ(v1, v2) CHECK_AND_ASSERT_MES(v1 == v2, false, "[" << perr_context << "] failed: \"" << QUOTEME(v1) << " == " << QUOTEME(v2) << "\", " << v1 << " != " << v2) |
| |
| #define | CHECK_NOT_EQ(v1, v2) CHECK_AND_ASSERT_MES(!(v1 == v2), false, "[" << perr_context << "] failed: \"" << QUOTEME(v1) << " != " << QUOTEME(v2) << "\", " << v1 << " == " << v2) |
| |
| #define | MK_COINS(amount) (UINT64_C(amount) * COIN) |
| |
| #define | TESTS_DEFAULT_FEE ((uint64_t)10) |
| |
|
| | VARIANT_TAG (binary_archive, callback_entry, 0xcb) |
| |
| | VARIANT_TAG (binary_archive, cryptonote::account_base, 0xcc) |
| |
| | VARIANT_TAG (binary_archive, serialized_block, 0xcd) |
| |
| | VARIANT_TAG (binary_archive, serialized_transaction, 0xce) |
| |
| | VARIANT_TAG (binary_archive, event_visitor_settings, 0xcf) |
| |
| | VARIANT_TAG (binary_archive, event_replay_settings, 0xda) |
| |
| template<typename T > |
| std::string | dump_keys (T *buff32) |
| |
| std::string | dump_data (const cryptonote::transaction &tx) |
| |
| cryptonote::account_public_address | get_address (const var_addr_t &inp) |
| |
| cryptonote::account_public_address | get_address (const cryptonote::account_public_address &inp) |
| |
| cryptonote::account_public_address | get_address (const cryptonote::account_keys &inp) |
| |
| cryptonote::account_public_address | get_address (const cryptonote::account_base &inp) |
| |
| cryptonote::account_public_address | get_address (const cryptonote::tx_destination_entry &inp) |
| |
| cryptonote::difficulty_type | get_test_difficulty (const boost::optional< uint8_t > &hf_ver=boost::none) |
| |
| uint64_t | current_difficulty_window (const boost::optional< uint8_t > &hf_ver=boost::none) |
| |
| void | fill_nonce (cryptonote::block &blk, const cryptonote::difficulty_type &diffic, uint64_t height) |
| |
| cryptonote::tx_destination_entry | build_dst (const var_addr_t &to, bool is_subaddr=false, uint64_t amount=0) |
| |
| std::vector< cryptonote::tx_destination_entry > | build_dsts (const var_addr_t &to1, bool sub1=false, uint64_t am1=0) |
| |
| std::vector< cryptonote::tx_destination_entry > | build_dsts (std::initializer_list< dest_wrapper_t > inps) |
| |
| uint64_t | sum_amount (const std::vector< cryptonote::tx_destination_entry > &destinations) |
| |
| uint64_t | sum_amount (const std::vector< cryptonote::tx_source_entry > &sources) |
| |
| bool | construct_miner_tx_manually (size_t height, uint64_t already_generated_coins, const cryptonote::account_public_address &miner_address, cryptonote::transaction &tx, uint64_t fee, cryptonote::keypair *p_txkey=nullptr) |
| |
| bool | construct_tx_to_key (const std::vector< test_event_entry > &events, cryptonote::transaction &tx, const cryptonote::block &blk_head, const cryptonote::account_base &from, const var_addr_t &to, uint64_t amount, uint64_t fee, size_t nmix, bool rct=false, rct::RangeProofType range_proof_type=rct::RangeProofBorromean, int bp_version=0) |
| |
| bool | construct_tx_to_key (const std::vector< test_event_entry > &events, cryptonote::transaction &tx, const cryptonote::block &blk_head, const cryptonote::account_base &from, std::vector< cryptonote::tx_destination_entry > destinations, uint64_t fee, size_t nmix, bool rct=false, rct::RangeProofType range_proof_type=rct::RangeProofBorromean, int bp_version=0) |
| |
| bool | construct_tx_to_key (cryptonote::transaction &tx, const cryptonote::account_base &from, const var_addr_t &to, uint64_t amount, std::vector< cryptonote::tx_source_entry > &sources, uint64_t fee, bool rct=false, rct::RangeProofType range_proof_type=rct::RangeProofBorromean, int bp_version=0) |
| |
| bool | construct_tx_to_key (cryptonote::transaction &tx, const cryptonote::account_base &from, const std::vector< cryptonote::tx_destination_entry > &destinations, std::vector< cryptonote::tx_source_entry > &sources, uint64_t fee, bool rct, rct::RangeProofType range_proof_type, int bp_version=0) |
| |
| cryptonote::transaction | construct_tx_with_fee (std::vector< test_event_entry > &events, const cryptonote::block &blk_head, const cryptonote::account_base &acc_from, const var_addr_t &to, uint64_t amount, uint64_t fee) |
| |
| bool | construct_tx_rct (const cryptonote::account_keys &sender_account_keys, std::vector< cryptonote::tx_source_entry > &sources, const std::vector< cryptonote::tx_destination_entry > &destinations, const boost::optional< cryptonote::account_public_address > &change_addr, std::vector< uint8_t > extra, cryptonote::transaction &tx, uint64_t unlock_time, bool rct=false, rct::RangeProofType range_proof_type=rct::RangeProofBorromean, int bp_version=0) |
| |
| uint64_t | num_blocks (const std::vector< test_event_entry > &events) |
| |
| cryptonote::block | get_head_block (const std::vector< test_event_entry > &events) |
| |
| void | get_confirmed_txs (const std::vector< cryptonote::block > &blockchain, const map_hash2tx_t &mtx, map_hash2tx_t &confirmed_txs) |
| |
| bool | trim_block_chain (std::vector< cryptonote::block > &blockchain, const crypto::hash &tail) |
| |
| bool | trim_block_chain (std::vector< const cryptonote::block *> &blockchain, const crypto::hash &tail) |
| |
| bool | find_block_chain (const std::vector< test_event_entry > &events, std::vector< cryptonote::block > &blockchain, map_hash2tx_t &mtx, const crypto::hash &head) |
| |
| bool | find_block_chain (const std::vector< test_event_entry > &events, std::vector< const cryptonote::block *> &blockchain, map_hash2tx_t &mtx, const crypto::hash &head) |
| |
| void | fill_tx_destinations (const var_addr_t &from, const cryptonote::account_public_address &to, uint64_t amount, uint64_t fee, const std::vector< cryptonote::tx_source_entry > &sources, std::vector< cryptonote::tx_destination_entry > &destinations, bool always_change=false) |
| |
| void | fill_tx_destinations (const var_addr_t &from, const std::vector< cryptonote::tx_destination_entry > &dests, uint64_t fee, const std::vector< cryptonote::tx_source_entry > &sources, std::vector< cryptonote::tx_destination_entry > &destinations, bool always_change) |
| |
| void | fill_tx_destinations (const var_addr_t &from, const cryptonote::account_public_address &to, uint64_t amount, uint64_t fee, const std::vector< cryptonote::tx_source_entry > &sources, std::vector< cryptonote::tx_destination_entry > &destinations, std::vector< cryptonote::tx_destination_entry > &destinations_pure, bool always_change=false) |
| |
| void | fill_tx_sources_and_destinations (const std::vector< test_event_entry > &events, const cryptonote::block &blk_head, const cryptonote::account_base &from, const cryptonote::account_public_address &to, uint64_t amount, uint64_t fee, size_t nmix, std::vector< cryptonote::tx_source_entry > &sources, std::vector< cryptonote::tx_destination_entry > &destinations) |
| |
| void | fill_tx_sources_and_destinations (const std::vector< test_event_entry > &events, const cryptonote::block &blk_head, const cryptonote::account_base &from, const cryptonote::account_base &to, uint64_t amount, uint64_t fee, size_t nmix, std::vector< cryptonote::tx_source_entry > &sources, std::vector< cryptonote::tx_destination_entry > &destinations) |
| |
| uint64_t | get_balance (const cryptonote::account_base &addr, const std::vector< cryptonote::block > &blockchain, const map_hash2tx_t &mtx) |
| |
| bool | extract_hard_forks (const std::vector< test_event_entry > &events, v_hardforks_t &hard_forks) |
| |
| template<class t_test_class > |
| bool | replay_events_through_core (cryptonote::core &cr, const std::vector< test_event_entry > &events, t_test_class &validator) |
| |
| template<class t_test_class > |
| bool | replay_events_through_core_plain (cryptonote::core &cr, const std::vector< test_event_entry > &events, t_test_class &validator, bool reinit=true) |
| |
| template<class t_test_class > |
| bool | do_replay_events_get_core (std::vector< test_event_entry > &events, cryptonote::core *core) |
| |
| template<class t_test_class > |
| bool | replay_events_through_core_validate (std::vector< test_event_entry > &events, cryptonote::core &c) |
| |
| template<class t_test_class > |
| bool | do_replay_events (std::vector< test_event_entry > &events) |
| |
| template<class t_test_class > |
| bool | do_replay_file (const std::string &filename) |
| |