aboutsummaryrefslogtreecommitdiff
path: root/tests/core_tests/chaingen001.cpp
diff options
context:
space:
mode:
authorDusan Klinec <dusan.klinec@gmail.com>2023-09-29 19:11:20 +0200
committerDusan Klinec <dusan.klinec@gmail.com>2023-09-29 19:11:20 +0200
commit056c9967036175e78b7ac1758d9a2943a9283bfc (patch)
tree97f729ef3ab44dc917f9a4975691ab3748503f64 /tests/core_tests/chaingen001.cpp
parentMerge pull request #8976 (diff)
downloadmonero-056c9967036175e78b7ac1758d9a2943a9283bfc.tar.xz
fix chaingen tests
- fix tx create from sources, input locking. Originally, creating a synthetic transactions with chaingen could create a transaction with outputs that are still locked in the current block, thus failing chain validation by the daemon. Simple unlock check was added. Some buggy tests were fixed as well as new unlock-checking version of tx creation rejected those, fixes are simple - mostly using correct block after a rewind to construct a transaction
Diffstat (limited to 'tests/core_tests/chaingen001.cpp')
-rw-r--r--tests/core_tests/chaingen001.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/core_tests/chaingen001.cpp b/tests/core_tests/chaingen001.cpp
index 8738585e0..1dde16ff5 100644
--- a/tests/core_tests/chaingen001.cpp
+++ b/tests/core_tests/chaingen001.cpp
@@ -120,18 +120,18 @@ bool gen_simple_chain_001::generate(std::vector<test_event_entry> &events)
std::cout << "BALANCE = " << get_balance(miner, chain, mtx) << std::endl;
REWIND_BLOCKS(events, blk_2r, blk_2, miner);
- MAKE_TX_LIST_START(events, txlist_0, miner, alice, MK_COINS(1), blk_2);
- MAKE_TX_LIST(events, txlist_0, miner, alice, MK_COINS(2), blk_2);
- MAKE_TX_LIST(events, txlist_0, miner, alice, MK_COINS(4), blk_2);
+ MAKE_TX_LIST_START(events, txlist_0, miner, alice, MK_COINS(1), blk_2r);
+ MAKE_TX_LIST(events, txlist_0, miner, alice, MK_COINS(2), blk_2r);
+ MAKE_TX_LIST(events, txlist_0, miner, alice, MK_COINS(4), blk_2r);
MAKE_NEXT_BLOCK_TX_LIST(events, blk_3, blk_2r, miner, txlist_0);
REWIND_BLOCKS(events, blk_3r, blk_3, miner);
- MAKE_TX(events, tx_1, miner, alice, MK_COINS(50), blk_3);
+ MAKE_TX(events, tx_1, miner, alice, MK_COINS(50), blk_3r);
MAKE_NEXT_BLOCK_TX1(events, blk_4, blk_3r, miner, tx_1);
REWIND_BLOCKS(events, blk_4r, blk_4, miner);
- MAKE_TX(events, tx_2, miner, alice, MK_COINS(50), blk_4);
+ MAKE_TX(events, tx_2, miner, alice, MK_COINS(50), blk_4r);
MAKE_NEXT_BLOCK_TX1(events, blk_5, blk_4r, miner, tx_2);
REWIND_BLOCKS(events, blk_5r, blk_5, miner);
- MAKE_TX(events, tx_3, miner, alice, MK_COINS(50), blk_5);
+ MAKE_TX(events, tx_3, miner, alice, MK_COINS(50), blk_5r);
MAKE_NEXT_BLOCK_TX1(events, blk_6, blk_5r, miner, tx_3);
DO_CALLBACK(events, "verify_callback_1");