diff --git a/tests/core_tests/chaingen_main.cpp b/tests/core_tests/chaingen_main.cpp index e1930227..ff4b4b9f 100644 --- a/tests/core_tests/chaingen_main.cpp +++ b/tests/core_tests/chaingen_main.cpp @@ -1240,6 +1240,9 @@ int main(int argc, char* argv[]) GENERATE_AND_PLAY(hard_fork_2_incorrect_alias_update); GENERATE_AND_PLAY(hard_fork_2_incorrect_alias_update); + // HF4 + // GENERATE_AND_PLAY_HF(hard_fork_4_consolidated_txs, "4"); TODO, doesn't work atm -- sowle + // atomics GENERATE_AND_PLAY(atomic_simple_test); GENERATE_AND_PLAY(atomic_test_wrong_redeem_wrong_refund); diff --git a/tests/core_tests/hard_fork_4.cpp b/tests/core_tests/hard_fork_4.cpp index 0ce910ad..2c4a7fd3 100644 --- a/tests/core_tests/hard_fork_4.cpp +++ b/tests/core_tests/hard_fork_4.cpp @@ -51,6 +51,11 @@ namespace currency } } // namespace currency +void add_flags_to_all_destination_entries(const uint64_t flags, std::vector& destinations) +{ + for(auto& de : destinations) + de.flags |= flags; +} //------------------------------- @@ -116,13 +121,15 @@ bool hard_fork_4_consolidated_txs::generate(std::vector& event destinations.push_back(tx_destination_entry(miner_change, miner_acc.get_public_address())); destinations.push_back(tx_destination_entry(bob_amount, bob_acc.get_public_address())); + add_flags_to_all_destination_entries(tx_destination_entry_flags::tdef_explicit_native_asset_id, destinations); r = construct_tx(miner_acc.get_keys(), sources, destinations, empty_extra, empty_attachment, tx_1, get_tx_version_from_events(events), one_time_secret_key, 0, 0, 0, true, TX_FLAG_SIGNATURE_MODE_SEPARATE, TX_DEFAULT_FEE, gen_context); CHECK_AND_ASSERT_MES(r, false, "construct_tx failed"); // partially completed tx_1 shouldn't be accepted - DO_CALLBACK(events, "mark_invalid_tx"); + //DO_CALLBACK(events, "mark_invalid_tx"); ADD_CUSTOM_EVENT(events, tx_1); + MAKE_NEXT_BLOCK_TX1(events, blk_2a, blk_1r, miner_acc, tx_1); } @@ -144,12 +151,12 @@ bool hard_fork_4_consolidated_txs::generate(std::vector& event } MAKE_NEXT_BLOCK_TX1(events, blk_2, blk_1r, miner_acc, tx_1); - std::shared_ptr bob_wlt; - r = generator.init_test_wallet(bob_acc, get_block_hash(blk_0), bob_wlt); - CHECK_AND_ASSERT_MES(r, false, "init_test_wallet failed"); - r = generator.refresh_test_wallet(events, bob_wlt.get(), get_block_hash(blk_2), 2 * CURRENCY_MINED_MONEY_UNLOCK_WINDOW + 2); - CHECK_AND_ASSERT_MES(r, false, "refresh_test_wallet failed"); - CHECK_AND_ASSERT_MES(check_balance_via_wallet(*bob_wlt.get(), "Bob", bob_amount, 0, 0, 0, 0), false, ""); + //std::shared_ptr bob_wlt; + //r = generator.init_test_wallet(bob_acc, get_block_hash(blk_0), bob_wlt); + //CHECK_AND_ASSERT_MES(r, false, "init_test_wallet failed"); + //r = generator.refresh_test_wallet(events, bob_wlt.get(), get_block_hash(blk_2), 2 * CURRENCY_MINED_MONEY_UNLOCK_WINDOW + 2); + //CHECK_AND_ASSERT_MES(r, false, "refresh_test_wallet failed"); + //CHECK_AND_ASSERT_MES(check_balance_via_wallet(*bob_wlt.get(), "Bob", bob_amount, 0, 0, 0, 0), false, ""); return true;