1
0
Fork 0
forked from lthn/blockchain

coretests: gen_crypted_attachments, gen_tx_extra_double_entry, gen_wallet_decrypted_attachments fixed

This commit is contained in:
sowle 2021-03-12 07:14:28 +03:00
parent ff445036cc
commit 2271ce03b1
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC
2 changed files with 13 additions and 5 deletions

View file

@ -774,9 +774,10 @@ gen_crypted_attachments::gen_crypted_attachments()
REGISTER_CALLBACK("set_crypted_tx_height", gen_crypted_attachments::set_crypted_tx_height);
REGISTER_CALLBACK("check_offers_count_befor_cancel", gen_crypted_attachments::check_offers_count_befor_cancel);
REGISTER_CALLBACK("check_offers_count_after_cancel", gen_crypted_attachments::check_offers_count_after_cancel);
}
m_hardfork_01_height = 0;
m_hardfork_02_height = 0; // tx_payer is allowed only after HF2
}
bool gen_crypted_attachments::generate(std::vector<test_event_entry>& events) const
{
@ -784,6 +785,8 @@ bool gen_crypted_attachments::generate(std::vector<test_event_entry>& events) co
GENERATE_ACCOUNT(miner_account);
//
MAKE_GENESIS_BLOCK(events, blk_0, miner_account, ts_start);
set_hard_fork_heights_to_generator(generator);
DO_CALLBACK(events, "configure_core");
MAKE_ACCOUNT(events, bob_account);
MAKE_NEXT_BLOCK(events, blk_1, blk_0, miner_account);
@ -926,7 +929,7 @@ bool gen_crypted_attachments::check_crypted_tx(currency::core& c, size_t ev_inde
const currency::transaction& tx = boost::get<currency::transaction>(events[crypted_tx_height]);
const currency::account_base& bob_acc = boost::get<currency::account_base>(events[1]);
const currency::account_base& bob_acc = boost::get<currency::account_base>(events[2]);
CHECK_EQ(c.get_current_blockchain_size(), bc_height_before+1);
@ -999,8 +1002,8 @@ bool gen_tx_extra_double_entry::generate(std::vector<test_event_entry>& events)
GENERATE_ACCOUNT(miner_account);
MAKE_GENESIS_BLOCK(events, blk_0, miner_account, ts_start);
generator.set_hardfork_height(0, 0);
generator.set_hardfork_height(1, 0); // extra_alias_entry is only allowed after HF2, so switch it on here
generator.set_hardfork_height(1, 0);
generator.set_hardfork_height(2, 0); // extra_alias_entry is only allowed after HF2, so switch it on here
DO_CALLBACK(events, "configure_core");
REWIND_BLOCKS_N(events, blk_0r, blk_0, miner_account, CURRENCY_MINED_MONEY_UNLOCK_WINDOW + 2);

View file

@ -1381,6 +1381,8 @@ bool gen_wallet_transfers_and_chain_switch::generate(std::vector<test_event_entr
gen_wallet_decrypted_attachments::gen_wallet_decrypted_attachments()
: m_on_transfer2_called(false)
{
m_hardfork_01_height = 0;
m_hardfork_02_height = 0; // tx_payer requires HF2
}
bool gen_wallet_decrypted_attachments::generate(std::vector<test_event_entry>& events) const
@ -1417,6 +1419,9 @@ bool gen_wallet_decrypted_attachments::generate(std::vector<test_event_entry>& e
generator.construct_genesis_block(blk_0, miner_acc, test_core_time::get_time());
events.push_back(blk_0);
set_hard_fork_heights_to_generator(generator);
DO_CALLBACK(events, "configure_core");
REWIND_BLOCKS_N(events, blk_0r, blk_0, miner_acc, CURRENCY_MINED_MONEY_UNLOCK_WINDOW);
CREATE_TEST_WALLET(alice_wlt, alice_acc, blk_0);