diff --git a/nano/qt_test/qt.cpp b/nano/qt_test/qt.cpp index 8eea1763ad..6472b37362 100644 --- a/nano/qt_test/qt.cpp +++ b/nano/qt_test/qt.cpp @@ -486,11 +486,12 @@ TEST (history, short_text) auto transaction (store.tx_begin_write ()); store.initialize (transaction, genesis); nano::keypair key; - nano::send_block send (ledger.latest (transaction, nano::test_genesis_key.pub), nano::test_genesis_key.pub, 0, nano::test_genesis_key.prv, nano::test_genesis_key.pub, 0); + auto latest (ledger.latest (transaction, nano::test_genesis_key.pub)); + nano::send_block send (latest, nano::test_genesis_key.pub, 0, nano::test_genesis_key.prv, nano::test_genesis_key.pub, system.work.generate (latest)); ASSERT_EQ (nano::process_result::progress, ledger.process (transaction, send).code); - nano::receive_block receive (send.hash (), send.hash (), nano::test_genesis_key.prv, nano::test_genesis_key.pub, 0); + nano::receive_block receive (send.hash (), send.hash (), nano::test_genesis_key.prv, nano::test_genesis_key.pub, system.work.generate (send.hash ())); ASSERT_EQ (nano::process_result::progress, ledger.process (transaction, receive).code); - nano::change_block change (receive.hash (), key.pub, nano::test_genesis_key.prv, nano::test_genesis_key.pub, 0); + nano::change_block change (receive.hash (), key.pub, nano::test_genesis_key.prv, nano::test_genesis_key.pub, system.work.generate (receive.hash ())); ASSERT_EQ (nano::process_result::progress, ledger.process (transaction, change).code); } nano_qt::history history (ledger, nano::test_genesis_key.pub, *wallet); @@ -598,7 +599,8 @@ TEST (wallet, republish) nano::block_hash hash; { auto transaction (system.nodes[0]->store.tx_begin_write ()); - nano::send_block block (system.nodes[0]->ledger.latest (transaction, nano::test_genesis_key.pub), key.pub, 0, nano::test_genesis_key.prv, nano::test_genesis_key.pub, 0); + auto latest (system.nodes[0]->ledger.latest (transaction, nano::test_genesis_key.pub)); + nano::send_block block (latest, key.pub, 0, nano::test_genesis_key.prv, nano::test_genesis_key.pub, system.work.generate (latest)); hash = block.hash (); ASSERT_EQ (nano::process_result::progress, system.nodes[0]->ledger.process (transaction, block).code); } diff --git a/nano/rpc_test/rpc.cpp b/nano/rpc_test/rpc.cpp index a5e4e449c4..551852551a 100644 --- a/nano/rpc_test/rpc.cpp +++ b/nano/rpc_test/rpc.cpp @@ -1333,9 +1333,9 @@ TEST (rpc, history) ASSERT_NE (nullptr, receive); auto node0 (system.nodes[0]); nano::genesis genesis; - nano::state_block usend (nano::genesis_account, node0->latest (nano::genesis_account), nano::genesis_account, nano::genesis_amount - nano::Gxrb_ratio, nano::genesis_account, nano::test_genesis_key.prv, nano::test_genesis_key.pub, 0); - nano::state_block ureceive (nano::genesis_account, usend.hash (), nano::genesis_account, nano::genesis_amount, usend.hash (), nano::test_genesis_key.prv, nano::test_genesis_key.pub, 0); - nano::state_block uchange (nano::genesis_account, ureceive.hash (), nano::keypair ().pub, nano::genesis_amount, 0, nano::test_genesis_key.prv, nano::test_genesis_key.pub, 0); + nano::state_block usend (nano::genesis_account, node0->latest (nano::genesis_account), nano::genesis_account, nano::genesis_amount - nano::Gxrb_ratio, nano::genesis_account, nano::test_genesis_key.prv, nano::test_genesis_key.pub, system.nodes[0]->work_generate_blocking (node0->latest (nano::genesis_account))); + nano::state_block ureceive (nano::genesis_account, usend.hash (), nano::genesis_account, nano::genesis_amount, usend.hash (), nano::test_genesis_key.prv, nano::test_genesis_key.pub, system.nodes[0]->work_generate_blocking (usend.hash ())); + nano::state_block uchange (nano::genesis_account, ureceive.hash (), nano::keypair ().pub, nano::genesis_amount, 0, nano::test_genesis_key.prv, nano::test_genesis_key.pub, system.nodes[0]->work_generate_blocking (ureceive.hash ())); { auto transaction (node0->store.tx_begin_write ()); ASSERT_EQ (nano::process_result::progress, node0->ledger.process (transaction, usend).code); @@ -1402,9 +1402,9 @@ TEST (rpc, account_history) ASSERT_NE (nullptr, receive); auto node0 (system.nodes[0]); nano::genesis genesis; - nano::state_block usend (nano::genesis_account, node0->latest (nano::genesis_account), nano::genesis_account, nano::genesis_amount - nano::Gxrb_ratio, nano::genesis_account, nano::test_genesis_key.prv, nano::test_genesis_key.pub, 0); - nano::state_block ureceive (nano::genesis_account, usend.hash (), nano::genesis_account, nano::genesis_amount, usend.hash (), nano::test_genesis_key.prv, nano::test_genesis_key.pub, 0); - nano::state_block uchange (nano::genesis_account, ureceive.hash (), nano::keypair ().pub, nano::genesis_amount, 0, nano::test_genesis_key.prv, nano::test_genesis_key.pub, 0); + nano::state_block usend (nano::genesis_account, node0->latest (nano::genesis_account), nano::genesis_account, nano::genesis_amount - nano::Gxrb_ratio, nano::genesis_account, nano::test_genesis_key.prv, nano::test_genesis_key.pub, system.nodes[0]->work_generate_blocking (node0->latest (nano::genesis_account))); + nano::state_block ureceive (nano::genesis_account, usend.hash (), nano::genesis_account, nano::genesis_amount, usend.hash (), nano::test_genesis_key.prv, nano::test_genesis_key.pub, system.nodes[0]->work_generate_blocking (usend.hash ())); + nano::state_block uchange (nano::genesis_account, ureceive.hash (), nano::keypair ().pub, nano::genesis_amount, 0, nano::test_genesis_key.prv, nano::test_genesis_key.pub, system.nodes[0]->work_generate_blocking (ureceive.hash ())); { auto transaction (node0->store.tx_begin_write ()); ASSERT_EQ (nano::process_result::progress, node0->ledger.process (transaction, usend).code); @@ -4960,7 +4960,7 @@ TEST (rpc, block_create_state_open) request.put ("representative", nano::test_genesis_key.pub.to_account ()); request.put ("balance", nano::Gxrb_ratio.convert_to ()); request.put ("link", send_block->hash ().to_string ()); - request.put ("work", nano::to_string_hex (system.nodes[0]->work_generate_blocking (send_block->hash ()))); + request.put ("work", nano::to_string_hex (system.nodes[0]->work_generate_blocking (key.pub))); auto node = system.nodes.front (); enable_ipc_transport_tcp (node->config.ipc_config.transport_tcp); nano::node_rpc_config node_rpc_config;