Removing nano::genesis_account variable and replacing usages with nano::dev::genesis->account ()
This commit is contained in:
parent
0091262d96
commit
32c94550fa
20 changed files with 414 additions and 416 deletions
|
@ -584,7 +584,7 @@ TEST (active_transactions, dropped_cleanup)
|
|||
|
||||
nano::genesis genesis;
|
||||
auto block = genesis.open;
|
||||
block->sideband_set (nano::block_sideband (nano::genesis_account, 0, nano::genesis_amount, 1, nano::seconds_since_epoch (), nano::epoch::epoch_0, false, false, false, nano::epoch::epoch_0));
|
||||
block->sideband_set (nano::block_sideband (nano::dev::genesis->account (), 0, nano::genesis_amount, 1, nano::seconds_since_epoch (), nano::epoch::epoch_0, false, false, false, nano::epoch::epoch_0));
|
||||
|
||||
// Add to network filter to ensure proper cleanup after the election is dropped
|
||||
std::vector<uint8_t> block_bytes;
|
||||
|
@ -1232,7 +1232,7 @@ TEST (active_transactions, pessimistic_elections)
|
|||
ASSERT_EQ (2, node.active.expired_optimistic_election_infos.size ());
|
||||
ASSERT_EQ (2, node.active.expired_optimistic_election_infos.size ());
|
||||
auto election_started_it = node.active.expired_optimistic_election_infos.get<nano::active_transactions::tag_election_started> ().begin ();
|
||||
ASSERT_EQ (election_started_it->account, nano::genesis_account);
|
||||
ASSERT_EQ (election_started_it->account, nano::dev::genesis->account ());
|
||||
ASSERT_EQ (election_started_it->election_started, true);
|
||||
ASSERT_EQ ((++election_started_it)->election_started, false);
|
||||
|
||||
|
@ -1253,7 +1253,7 @@ TEST (active_transactions, pessimistic_elections)
|
|||
nano::confirmation_height_info key1_confirmation_height_info;
|
||||
{
|
||||
auto transaction = node.store.tx_begin_read ();
|
||||
node.store.confirmation_height.get (transaction, nano::genesis_account, genesis_confirmation_height_info);
|
||||
node.store.confirmation_height.get (transaction, nano::dev::genesis->account (), genesis_confirmation_height_info);
|
||||
ASSERT_EQ (2, genesis_confirmation_height_info.height);
|
||||
node.store.confirmation_height.get (transaction, key.pub, key1_confirmation_height_info);
|
||||
ASSERT_EQ (0, key1_confirmation_height_info.height);
|
||||
|
@ -1275,7 +1275,7 @@ TEST (active_transactions, pessimistic_elections)
|
|||
|
||||
{
|
||||
auto transaction = node.store.tx_begin_read ();
|
||||
node.store.confirmation_height.get (transaction, nano::genesis_account, genesis_confirmation_height_info);
|
||||
node.store.confirmation_height.get (transaction, nano::dev::genesis->account (), genesis_confirmation_height_info);
|
||||
ASSERT_EQ (3, genesis_confirmation_height_info.height);
|
||||
node.store.confirmation_height.get (transaction, key.pub, key1_confirmation_height_info);
|
||||
ASSERT_EQ (0, key1_confirmation_height_info.height);
|
||||
|
@ -1299,7 +1299,7 @@ TEST (active_transactions, pessimistic_elections)
|
|||
|
||||
{
|
||||
auto transaction = node.store.tx_begin_read ();
|
||||
node.store.confirmation_height.get (transaction, nano::genesis_account, genesis_confirmation_height_info);
|
||||
node.store.confirmation_height.get (transaction, nano::dev::genesis->account (), genesis_confirmation_height_info);
|
||||
ASSERT_EQ (3, genesis_confirmation_height_info.height);
|
||||
node.store.confirmation_height.get (transaction, key.pub, key1_confirmation_height_info);
|
||||
ASSERT_EQ (1, key1_confirmation_height_info.height);
|
||||
|
|
|
@ -330,7 +330,7 @@ TEST (block_store, genesis)
|
|||
auto transaction (store->tx_begin_write ());
|
||||
store->initialize (transaction, ledger_cache);
|
||||
nano::account_info info;
|
||||
ASSERT_FALSE (store->account.get (transaction, nano::genesis_account, info));
|
||||
ASSERT_FALSE (store->account.get (transaction, nano::dev::genesis->account (), info));
|
||||
ASSERT_EQ (hash, info.head);
|
||||
auto block1 (store->block.get (transaction, info.head));
|
||||
ASSERT_NE (nullptr, block1);
|
||||
|
@ -340,13 +340,13 @@ TEST (block_store, genesis)
|
|||
ASSERT_EQ (info.block_count, 1);
|
||||
// Genesis block should be confirmed by default
|
||||
nano::confirmation_height_info confirmation_height_info;
|
||||
ASSERT_FALSE (store->confirmation_height.get (transaction, nano::genesis_account, confirmation_height_info));
|
||||
ASSERT_FALSE (store->confirmation_height.get (transaction, nano::dev::genesis->account (), confirmation_height_info));
|
||||
ASSERT_EQ (confirmation_height_info.height, 1);
|
||||
ASSERT_EQ (confirmation_height_info.frontier, hash);
|
||||
auto dev_pub_text (nano::dev_genesis_key.pub.to_string ());
|
||||
auto dev_pub_account (nano::dev_genesis_key.pub.to_account ());
|
||||
auto dev_prv_text (nano::dev_genesis_key.prv.to_string ());
|
||||
ASSERT_EQ (nano::genesis_account, nano::dev_genesis_key.pub);
|
||||
ASSERT_EQ (nano::dev::genesis->account (), nano::dev_genesis_key.pub);
|
||||
}
|
||||
|
||||
TEST (bootstrap, simple)
|
||||
|
@ -689,10 +689,10 @@ TEST (mdb_block_store, supported_version_upgrades)
|
|||
store.initialize (transaction, ledger.cache);
|
||||
// Lower the database version to the minimum version supported for upgrade.
|
||||
store.version.put (transaction, store.minimum_version);
|
||||
store.confirmation_height.del (transaction, nano::genesis_account);
|
||||
store.confirmation_height.del (transaction, nano::dev::genesis->account ());
|
||||
ASSERT_FALSE (mdb_dbi_open (store.env.tx (transaction), "accounts_v1", MDB_CREATE, &store.accounts_v1_handle));
|
||||
ASSERT_FALSE (mdb_dbi_open (store.env.tx (transaction), "open", MDB_CREATE, &store.open_blocks_handle));
|
||||
modify_account_info_to_v14 (store, transaction, nano::genesis_account, 1, nano::dev::genesis->hash ());
|
||||
modify_account_info_to_v14 (store, transaction, nano::dev::genesis->account (), 1, nano::dev::genesis->hash ());
|
||||
write_block_w_sideband_v18 (store, store.open_blocks_handle, transaction, *nano::genesis ().open);
|
||||
}
|
||||
|
||||
|
@ -1285,9 +1285,9 @@ TEST (mdb_block_store, upgrade_v14_v15)
|
|||
auto transaction (store.tx_begin_write ());
|
||||
store.initialize (transaction, ledger.cache);
|
||||
nano::account_info account_info;
|
||||
ASSERT_FALSE (store.account.get (transaction, nano::genesis_account, account_info));
|
||||
ASSERT_FALSE (store.account.get (transaction, nano::dev::genesis->account (), account_info));
|
||||
nano::confirmation_height_info confirmation_height_info;
|
||||
ASSERT_FALSE (store.confirmation_height.get (transaction, nano::genesis_account, confirmation_height_info));
|
||||
ASSERT_FALSE (store.confirmation_height.get (transaction, nano::dev::genesis->account (), confirmation_height_info));
|
||||
ASSERT_EQ (confirmation_height_info.height, 1);
|
||||
ASSERT_EQ (confirmation_height_info.frontier, genesis.hash ());
|
||||
// These databases get removed after an upgrade, so readd them
|
||||
|
@ -1302,10 +1302,10 @@ TEST (mdb_block_store, upgrade_v14_v15)
|
|||
ASSERT_EQ (nano::process_result::progress, ledger.process (transaction, state_send).code);
|
||||
// Lower the database to the previous version
|
||||
store.version.put (transaction, 14);
|
||||
store.confirmation_height.del (transaction, nano::genesis_account);
|
||||
modify_account_info_to_v14 (store, transaction, nano::genesis_account, confirmation_height_info.height, state_send.hash ());
|
||||
store.confirmation_height.del (transaction, nano::dev::genesis->account ());
|
||||
modify_account_info_to_v14 (store, transaction, nano::dev::genesis->account (), confirmation_height_info.height, state_send.hash ());
|
||||
|
||||
store.pending.del (transaction, nano::pending_key (nano::genesis_account, state_send.hash ()));
|
||||
store.pending.del (transaction, nano::pending_key (nano::dev::genesis->account (), state_send.hash ()));
|
||||
|
||||
write_sideband_v14 (store, transaction, state_send, store.state_blocks_v1_handle);
|
||||
write_sideband_v14 (store, transaction, epoch, store.state_blocks_v1_handle);
|
||||
|
@ -1317,18 +1317,18 @@ TEST (mdb_block_store, upgrade_v14_v15)
|
|||
store.block.del (transaction, epoch.hash ());
|
||||
|
||||
// Turn pending into v14
|
||||
ASSERT_FALSE (mdb_put (store.env.tx (transaction), store.pending_v0_handle, nano::mdb_val (nano::pending_key (nano::dev_genesis_key.pub, send.hash ())), nano::mdb_val (nano::pending_info_v14 (nano::genesis_account, nano::Gxrb_ratio, nano::epoch::epoch_0)), 0));
|
||||
ASSERT_FALSE (mdb_put (store.env.tx (transaction), store.pending_v1_handle, nano::mdb_val (nano::pending_key (nano::dev_genesis_key.pub, state_send.hash ())), nano::mdb_val (nano::pending_info_v14 (nano::genesis_account, nano::Gxrb_ratio, nano::epoch::epoch_1)), 0));
|
||||
ASSERT_FALSE (mdb_put (store.env.tx (transaction), store.pending_v0_handle, nano::mdb_val (nano::pending_key (nano::dev_genesis_key.pub, send.hash ())), nano::mdb_val (nano::pending_info_v14 (nano::dev::genesis->account (), nano::Gxrb_ratio, nano::epoch::epoch_0)), 0));
|
||||
ASSERT_FALSE (mdb_put (store.env.tx (transaction), store.pending_v1_handle, nano::mdb_val (nano::pending_key (nano::dev_genesis_key.pub, state_send.hash ())), nano::mdb_val (nano::pending_info_v14 (nano::dev::genesis->account (), nano::Gxrb_ratio, nano::epoch::epoch_1)), 0));
|
||||
|
||||
// This should fail as sizes are no longer correct for account_info
|
||||
nano::mdb_val value;
|
||||
ASSERT_FALSE (mdb_get (store.env.tx (transaction), store.accounts_v1_handle, nano::mdb_val (nano::genesis_account), value));
|
||||
ASSERT_FALSE (mdb_get (store.env.tx (transaction), store.accounts_v1_handle, nano::mdb_val (nano::dev::genesis->account ()), value));
|
||||
nano::account_info info;
|
||||
ASSERT_NE (value.size (), info.db_size ());
|
||||
store.account.del (transaction, nano::genesis_account);
|
||||
store.account.del (transaction, nano::dev::genesis->account ());
|
||||
|
||||
// Confirmation height for the account should be deleted
|
||||
ASSERT_TRUE (mdb_get (store.env.tx (transaction), store.confirmation_height_handle, nano::mdb_val (nano::genesis_account), value));
|
||||
ASSERT_TRUE (mdb_get (store.env.tx (transaction), store.confirmation_height_handle, nano::mdb_val (nano::dev::genesis->account ()), value));
|
||||
}
|
||||
|
||||
// Now do the upgrade
|
||||
|
@ -1339,18 +1339,18 @@ TEST (mdb_block_store, upgrade_v14_v15)
|
|||
|
||||
// Size of account_info should now equal that set in db
|
||||
nano::mdb_val value;
|
||||
ASSERT_FALSE (mdb_get (store.env.tx (transaction), store.accounts_handle, nano::mdb_val (nano::genesis_account), value));
|
||||
ASSERT_FALSE (mdb_get (store.env.tx (transaction), store.accounts_handle, nano::mdb_val (nano::dev::genesis->account ()), value));
|
||||
nano::account_info info (value);
|
||||
ASSERT_EQ (value.size (), info.db_size ());
|
||||
|
||||
// Confirmation height should exist
|
||||
nano::confirmation_height_info confirmation_height_info;
|
||||
ASSERT_FALSE (store.confirmation_height.get (transaction, nano::genesis_account, confirmation_height_info));
|
||||
ASSERT_FALSE (store.confirmation_height.get (transaction, nano::dev::genesis->account (), confirmation_height_info));
|
||||
ASSERT_EQ (confirmation_height_info.height, 1);
|
||||
ASSERT_EQ (confirmation_height_info.frontier, genesis.hash ());
|
||||
|
||||
// accounts_v1, state_blocks_v1 & pending_v1 tables should be deleted
|
||||
auto error_get_accounts_v1 (mdb_get (store.env.tx (transaction), store.accounts_v1_handle, nano::mdb_val (nano::genesis_account), value));
|
||||
auto error_get_accounts_v1 (mdb_get (store.env.tx (transaction), store.accounts_v1_handle, nano::mdb_val (nano::dev::genesis->account ()), value));
|
||||
ASSERT_NE (error_get_accounts_v1, MDB_SUCCESS);
|
||||
auto error_get_pending_v1 (mdb_get (store.env.tx (transaction), store.pending_v1_handle, nano::mdb_val (nano::pending_key (nano::dev_genesis_key.pub, state_send.hash ())), value));
|
||||
ASSERT_NE (error_get_pending_v1, MDB_SUCCESS);
|
||||
|
@ -1395,15 +1395,15 @@ TEST (mdb_block_store, upgrade_v15_v16)
|
|||
// The representation table should get removed after, so readd it so that we can later confirm this actually happens
|
||||
auto txn = store.env.tx (transaction);
|
||||
ASSERT_FALSE (mdb_dbi_open (txn, "representation", MDB_CREATE, &store.representation_handle));
|
||||
auto weight = ledger.cache.rep_weights.representation_get (nano::genesis_account);
|
||||
ASSERT_EQ (MDB_SUCCESS, mdb_put (txn, store.representation_handle, nano::mdb_val (nano::genesis_account), nano::mdb_val (nano::uint128_union (weight)), 0));
|
||||
auto weight = ledger.cache.rep_weights.representation_get (nano::dev::genesis->account ());
|
||||
ASSERT_EQ (MDB_SUCCESS, mdb_put (txn, store.representation_handle, nano::mdb_val (nano::dev::genesis->account ()), nano::mdb_val (nano::uint128_union (weight)), 0));
|
||||
ASSERT_FALSE (mdb_dbi_open (store.env.tx (transaction), "open", MDB_CREATE, &store.open_blocks_handle));
|
||||
write_block_w_sideband_v18 (store, store.open_blocks_handle, transaction, *genesis.open);
|
||||
// Lower the database to the previous version
|
||||
store.version.put (transaction, 15);
|
||||
// Confirm the rep weight exists in the database
|
||||
ASSERT_EQ (MDB_SUCCESS, mdb_get (store.env.tx (transaction), store.representation_handle, nano::mdb_val (nano::genesis_account), value));
|
||||
store.confirmation_height.del (transaction, nano::genesis_account);
|
||||
ASSERT_EQ (MDB_SUCCESS, mdb_get (store.env.tx (transaction), store.representation_handle, nano::mdb_val (nano::dev::genesis->account ()), value));
|
||||
store.confirmation_height.del (transaction, nano::dev::genesis->account ());
|
||||
}
|
||||
|
||||
// Now do the upgrade
|
||||
|
@ -1413,7 +1413,7 @@ TEST (mdb_block_store, upgrade_v15_v16)
|
|||
auto transaction (store.tx_begin_read ());
|
||||
|
||||
// The representation table should now be deleted
|
||||
auto error_get_representation (mdb_get (store.env.tx (transaction), store.representation_handle, nano::mdb_val (nano::genesis_account), value));
|
||||
auto error_get_representation (mdb_get (store.env.tx (transaction), store.representation_handle, nano::mdb_val (nano::dev::genesis->account ()), value));
|
||||
ASSERT_NE (MDB_SUCCESS, error_get_representation);
|
||||
ASSERT_EQ (store.representation_handle, 0);
|
||||
|
||||
|
@ -1448,7 +1448,7 @@ TEST (mdb_block_store, upgrade_v16_v17)
|
|||
ASSERT_EQ (nano::process_result::progress, ledger.process (transaction, block1).code);
|
||||
ASSERT_EQ (nano::process_result::progress, ledger.process (transaction, block2).code);
|
||||
ASSERT_EQ (nano::process_result::progress, ledger.process (transaction, block3).code);
|
||||
modify_confirmation_height_to_v15 (store, transaction, nano::genesis_account, confirmation_height);
|
||||
modify_confirmation_height_to_v15 (store, transaction, nano::dev::genesis->account (), confirmation_height);
|
||||
|
||||
ASSERT_FALSE (mdb_dbi_open (store.env.tx (transaction), "open", MDB_CREATE, &store.open_blocks_handle));
|
||||
write_block_w_sideband_v18 (store, store.open_blocks_handle, transaction, *genesis.open);
|
||||
|
@ -1468,7 +1468,7 @@ TEST (mdb_block_store, upgrade_v16_v17)
|
|||
auto transaction (store.tx_begin_read ());
|
||||
|
||||
nano::confirmation_height_info confirmation_height_info;
|
||||
ASSERT_FALSE (store.confirmation_height.get (transaction, nano::genesis_account, confirmation_height_info));
|
||||
ASSERT_FALSE (store.confirmation_height.get (transaction, nano::dev::genesis->account (), confirmation_height_info));
|
||||
ASSERT_EQ (confirmation_height_info.height, confirmation_height);
|
||||
|
||||
// Check confirmation height frontier is correct
|
||||
|
|
|
@ -1867,9 +1867,9 @@ TEST (bulk_pull_account, basics)
|
|||
nano::keypair key1;
|
||||
system.wallet (0)->insert_adhoc (nano::dev_genesis_key.prv);
|
||||
system.wallet (0)->insert_adhoc (key1.prv);
|
||||
auto send1 (system.wallet (0)->send_action (nano::genesis_account, key1.pub, 25));
|
||||
auto send2 (system.wallet (0)->send_action (nano::genesis_account, key1.pub, 10));
|
||||
auto send3 (system.wallet (0)->send_action (nano::genesis_account, key1.pub, 2));
|
||||
auto send1 (system.wallet (0)->send_action (nano::dev::genesis->account (), key1.pub, 25));
|
||||
auto send2 (system.wallet (0)->send_action (nano::dev::genesis->account (), key1.pub, 10));
|
||||
auto send3 (system.wallet (0)->send_action (nano::dev::genesis->account (), key1.pub, 2));
|
||||
ASSERT_TIMELY (5s, system.nodes[0]->balance (key1.pub) == 25);
|
||||
auto connection (std::make_shared<nano::bootstrap_server> (std::make_shared<nano::socket> (*system.nodes[0]), system.nodes[0]));
|
||||
|
||||
|
@ -1888,7 +1888,7 @@ TEST (bulk_pull_account, basics)
|
|||
auto block_data (request->get_next ());
|
||||
ASSERT_EQ (send2->hash (), block_data.first.get ()->hash);
|
||||
ASSERT_EQ (nano::uint128_union (10), block_data.second.get ()->amount);
|
||||
ASSERT_EQ (nano::genesis_account, block_data.second.get ()->source);
|
||||
ASSERT_EQ (nano::dev::genesis->account (), block_data.second.get ()->source);
|
||||
ASSERT_EQ (nullptr, request->get_next ().first.get ());
|
||||
}
|
||||
|
||||
|
@ -1902,7 +1902,7 @@ TEST (bulk_pull_account, basics)
|
|||
auto block_data (request->get_next ());
|
||||
ASSERT_NE (nullptr, block_data.first.get ());
|
||||
ASSERT_NE (nullptr, block_data.second.get ());
|
||||
ASSERT_EQ (nano::genesis_account, block_data.second.get ()->source);
|
||||
ASSERT_EQ (nano::dev::genesis->account (), block_data.second.get ()->source);
|
||||
block_data = request->get_next ();
|
||||
ASSERT_EQ (nullptr, block_data.first.get ());
|
||||
ASSERT_EQ (nullptr, block_data.second.get ());
|
||||
|
|
|
@ -98,9 +98,9 @@ TEST (confirmation_height, multiple_accounts)
|
|||
nano::send_block send3 (send2.hash (), key3.pub, node->online_reps.delta () + 100, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *system.work.generate (send2.hash ()));
|
||||
|
||||
// Open all accounts
|
||||
nano::open_block open1 (send1.hash (), nano::genesis_account, key1.pub, key1.prv, key1.pub, *system.work.generate (key1.pub));
|
||||
nano::open_block open2 (send2.hash (), nano::genesis_account, key2.pub, key2.prv, key2.pub, *system.work.generate (key2.pub));
|
||||
nano::open_block open3 (send3.hash (), nano::genesis_account, key3.pub, key3.prv, key3.pub, *system.work.generate (key3.pub));
|
||||
nano::open_block open1 (send1.hash (), nano::dev::genesis->account (), key1.pub, key1.prv, key1.pub, *system.work.generate (key1.pub));
|
||||
nano::open_block open2 (send2.hash (), nano::dev::genesis->account (), key2.pub, key2.prv, key2.pub, *system.work.generate (key2.pub));
|
||||
nano::open_block open3 (send3.hash (), nano::dev::genesis->account (), key3.pub, key3.prv, key3.pub, *system.work.generate (key3.pub));
|
||||
|
||||
// Send and receive various blocks to these accounts
|
||||
nano::send_block send4 (open1.hash (), key2.pub, 50, key1.prv, key1.pub, *system.work.generate (open1.hash ()));
|
||||
|
@ -225,11 +225,11 @@ TEST (confirmation_height, gap_bootstrap)
|
|||
auto & node1 = *system.add_node (node_flags);
|
||||
nano::genesis genesis;
|
||||
nano::keypair destination;
|
||||
auto send1 (std::make_shared<nano::state_block> (nano::genesis_account, genesis.hash (), nano::genesis_account, nano::genesis_amount - nano::Gxrb_ratio, destination.pub, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, 0));
|
||||
auto send1 (std::make_shared<nano::state_block> (nano::dev::genesis->account (), genesis.hash (), nano::dev::genesis->account (), nano::genesis_amount - nano::Gxrb_ratio, destination.pub, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, 0));
|
||||
node1.work_generate_blocking (*send1);
|
||||
auto send2 (std::make_shared<nano::state_block> (nano::genesis_account, send1->hash (), nano::genesis_account, nano::genesis_amount - 2 * nano::Gxrb_ratio, destination.pub, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, 0));
|
||||
auto send2 (std::make_shared<nano::state_block> (nano::dev::genesis->account (), send1->hash (), nano::dev::genesis->account (), nano::genesis_amount - 2 * nano::Gxrb_ratio, destination.pub, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, 0));
|
||||
node1.work_generate_blocking (*send2);
|
||||
auto send3 (std::make_shared<nano::state_block> (nano::genesis_account, send2->hash (), nano::genesis_account, nano::genesis_amount - 3 * nano::Gxrb_ratio, destination.pub, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, 0));
|
||||
auto send3 (std::make_shared<nano::state_block> (nano::dev::genesis->account (), send2->hash (), nano::dev::genesis->account (), nano::genesis_amount - 3 * nano::Gxrb_ratio, destination.pub, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, 0));
|
||||
node1.work_generate_blocking (*send3);
|
||||
auto open1 (std::make_shared<nano::open_block> (send1->hash (), destination.pub, destination.pub, destination.prv, destination.pub, 0));
|
||||
node1.work_generate_blocking (*open1);
|
||||
|
@ -311,11 +311,11 @@ TEST (confirmation_height, gap_live)
|
|||
system.wallet (1)->insert_adhoc (destination.prv);
|
||||
|
||||
nano::genesis genesis;
|
||||
auto send1 (std::make_shared<nano::state_block> (nano::genesis_account, genesis.hash (), nano::genesis_account, nano::genesis_amount - 1, destination.pub, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, 0));
|
||||
auto send1 (std::make_shared<nano::state_block> (nano::dev::genesis->account (), genesis.hash (), nano::dev::genesis->account (), nano::genesis_amount - 1, destination.pub, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, 0));
|
||||
node->work_generate_blocking (*send1);
|
||||
auto send2 (std::make_shared<nano::state_block> (nano::genesis_account, send1->hash (), nano::genesis_account, nano::genesis_amount - 2, destination.pub, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, 0));
|
||||
auto send2 (std::make_shared<nano::state_block> (nano::dev::genesis->account (), send1->hash (), nano::dev::genesis->account (), nano::genesis_amount - 2, destination.pub, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, 0));
|
||||
node->work_generate_blocking (*send2);
|
||||
auto send3 (std::make_shared<nano::state_block> (nano::genesis_account, send2->hash (), nano::genesis_account, nano::genesis_amount - 3, destination.pub, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, 0));
|
||||
auto send3 (std::make_shared<nano::state_block> (nano::dev::genesis->account (), send2->hash (), nano::dev::genesis->account (), nano::genesis_amount - 3, destination.pub, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, 0));
|
||||
node->work_generate_blocking (*send3);
|
||||
|
||||
auto open1 (std::make_shared<nano::open_block> (send1->hash (), destination.pub, destination.pub, destination.prv, destination.pub, 0));
|
||||
|
@ -396,10 +396,10 @@ TEST (confirmation_height, send_receive_between_2_accounts)
|
|||
|
||||
nano::send_block send1 (latest, key1.pub, node->online_reps.delta () + 2, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *system.work.generate (latest));
|
||||
|
||||
nano::open_block open1 (send1.hash (), nano::genesis_account, key1.pub, key1.prv, key1.pub, *system.work.generate (key1.pub));
|
||||
nano::send_block send2 (open1.hash (), nano::genesis_account, 1000, key1.prv, key1.pub, *system.work.generate (open1.hash ()));
|
||||
nano::send_block send3 (send2.hash (), nano::genesis_account, 900, key1.prv, key1.pub, *system.work.generate (send2.hash ()));
|
||||
nano::send_block send4 (send3.hash (), nano::genesis_account, 500, key1.prv, key1.pub, *system.work.generate (send3.hash ()));
|
||||
nano::open_block open1 (send1.hash (), nano::dev::genesis->account (), key1.pub, key1.prv, key1.pub, *system.work.generate (key1.pub));
|
||||
nano::send_block send2 (open1.hash (), nano::dev::genesis->account (), 1000, key1.prv, key1.pub, *system.work.generate (open1.hash ()));
|
||||
nano::send_block send3 (send2.hash (), nano::dev::genesis->account (), 900, key1.prv, key1.pub, *system.work.generate (send2.hash ()));
|
||||
nano::send_block send4 (send3.hash (), nano::dev::genesis->account (), 500, key1.prv, key1.pub, *system.work.generate (send3.hash ()));
|
||||
|
||||
nano::receive_block receive1 (send1.hash (), send2.hash (), nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *system.work.generate (send1.hash ()));
|
||||
nano::receive_block receive2 (receive1.hash (), send3.hash (), nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *system.work.generate (receive1.hash ()));
|
||||
|
@ -569,7 +569,7 @@ TEST (confirmation_height, all_block_types)
|
|||
nano::state_block state_send3 (key2.pub, state_send2->hash (), 0, nano::Gxrb_ratio - 1, key1.pub, key2.prv, key2.pub, *system.work.generate (state_send2->hash ()));
|
||||
|
||||
nano::state_block state_send4 (key1.pub, state_send1.hash (), 0, nano::Gxrb_ratio - 2, nano::dev_genesis_key.pub, key1.prv, key1.pub, *system.work.generate (state_send1.hash ()));
|
||||
nano::state_block state_receive3 (nano::genesis_account, send1.hash (), nano::genesis_account, nano::genesis_amount - nano::Gxrb_ratio * 2 + 1, state_send4.hash (), nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *system.work.generate (send1.hash ()));
|
||||
nano::state_block state_receive3 (nano::dev::genesis->account (), send1.hash (), nano::dev::genesis->account (), nano::genesis_amount - nano::Gxrb_ratio * 2 + 1, state_send4.hash (), nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *system.work.generate (send1.hash ()));
|
||||
|
||||
{
|
||||
auto transaction (store.tx_begin_write ());
|
||||
|
@ -683,12 +683,12 @@ TEST (confirmation_height, conflict_rollback_cemented)
|
|||
{
|
||||
auto transaction (node1->store.tx_begin_write ());
|
||||
ASSERT_TRUE (node1->store.block.exists (transaction, publish1.block->hash ()));
|
||||
node1->store.confirmation_height.put (transaction, nano::genesis_account, nano::confirmation_height_info{ 2, send2->hash () });
|
||||
node1->store.confirmation_height.put (transaction, nano::dev::genesis->account (), nano::confirmation_height_info{ 2, send2->hash () });
|
||||
}
|
||||
{
|
||||
auto transaction (node2->store.tx_begin_write ());
|
||||
ASSERT_TRUE (node2->store.block.exists (transaction, publish2.block->hash ()));
|
||||
node2->store.confirmation_height.put (transaction, nano::genesis_account, nano::confirmation_height_info{ 2, send2->hash () });
|
||||
node2->store.confirmation_height.put (transaction, nano::dev::genesis->account (), nano::confirmation_height_info{ 2, send2->hash () });
|
||||
}
|
||||
|
||||
auto rollback_log_entry = boost::str (boost::format ("Failed to roll back %1%") % send2->hash ().to_string ());
|
||||
|
@ -832,7 +832,7 @@ TEST (confirmation_heightDeathTest, modified_chain)
|
|||
}
|
||||
|
||||
ASSERT_EQ (nano::process_result::progress, ledger.process (store->tx_begin_write (), *send).code);
|
||||
store->confirmation_height.put (store->tx_begin_write (), nano::genesis_account, { 1, nano::dev::genesis->hash () });
|
||||
store->confirmation_height.put (store->tx_begin_write (), nano::dev::genesis->account (), { 1, nano::dev::genesis->hash () });
|
||||
|
||||
nano::confirmation_height_unbounded unbounded_processor (
|
||||
ledger, write_database_queue, 10ms, logging, logger, stopped, batch_write_size, [] (auto const &) {}, [] (auto const &) {}, [] () { return 0; });
|
||||
|
@ -906,7 +906,7 @@ TEST (confirmation_heightDeathTest, modified_chain_account_removed)
|
|||
|
||||
// Reset conditions and test with the bounded processor
|
||||
ASSERT_EQ (nano::process_result::progress, ledger.process (store->tx_begin_write (), *open).code);
|
||||
store->confirmation_height.put (store->tx_begin_write (), nano::genesis_account, { 1, nano::dev::genesis->hash () });
|
||||
store->confirmation_height.put (store->tx_begin_write (), nano::dev::genesis->account (), { 1, nano::dev::genesis->hash () });
|
||||
|
||||
nano::confirmation_height_bounded bounded_processor (
|
||||
ledger, write_database_queue, 10ms, logging, logger, stopped, batch_write_size, [] (auto const &) {}, [] (auto const &) {}, [] () { return 0; });
|
||||
|
@ -1120,7 +1120,7 @@ TEST (confirmation_height, cemented_gap_below_receive)
|
|||
nano::keypair dummy_key;
|
||||
nano::send_block dummy_send (send1.hash (), dummy_key.pub, nano::genesis_amount - nano::Gxrb_ratio * 3, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *system.work.generate (send1.hash ()));
|
||||
|
||||
nano::open_block open (send.hash (), nano::genesis_account, key1.pub, key1.prv, key1.pub, *system.work.generate (key1.pub));
|
||||
nano::open_block open (send.hash (), nano::dev::genesis->account (), key1.pub, key1.prv, key1.pub, *system.work.generate (key1.pub));
|
||||
nano::receive_block receive1 (open.hash (), send1.hash (), key1.prv, key1.pub, *system.work.generate (open.hash ()));
|
||||
nano::send_block send2 (receive1.hash (), nano::dev_genesis_key.pub, nano::Gxrb_ratio, key1.prv, key1.pub, *system.work.generate (receive1.hash ()));
|
||||
|
||||
|
@ -1132,7 +1132,7 @@ TEST (confirmation_height, cemented_gap_below_receive)
|
|||
nano::send_block send3 (dummy_send1.hash (), key2.pub, nano::genesis_amount - nano::Gxrb_ratio * 4, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *system.work.generate (dummy_send1.hash ()));
|
||||
nano::send_block dummy_send2 (send3.hash (), dummy_key.pub, nano::genesis_amount - nano::Gxrb_ratio * 5, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *system.work.generate (send3.hash ()));
|
||||
|
||||
auto open1 = std::make_shared<nano::open_block> (send3.hash (), nano::genesis_account, key2.pub, key2.prv, key2.pub, *system.work.generate (key2.pub));
|
||||
auto open1 = std::make_shared<nano::open_block> (send3.hash (), nano::dev::genesis->account (), key2.pub, key2.prv, key2.pub, *system.work.generate (key2.pub));
|
||||
|
||||
{
|
||||
auto transaction = node->store.tx_begin_write ();
|
||||
|
@ -1205,7 +1205,7 @@ TEST (confirmation_height, cemented_gap_below_no_cache)
|
|||
nano::keypair dummy_key;
|
||||
nano::send_block dummy_send (send1.hash (), dummy_key.pub, nano::genesis_amount - nano::Gxrb_ratio * 3, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *system.work.generate (send1.hash ()));
|
||||
|
||||
nano::open_block open (send.hash (), nano::genesis_account, key1.pub, key1.prv, key1.pub, *system.work.generate (key1.pub));
|
||||
nano::open_block open (send.hash (), nano::dev::genesis->account (), key1.pub, key1.prv, key1.pub, *system.work.generate (key1.pub));
|
||||
nano::receive_block receive1 (open.hash (), send1.hash (), key1.prv, key1.pub, *system.work.generate (open.hash ()));
|
||||
nano::send_block send2 (receive1.hash (), nano::dev_genesis_key.pub, nano::Gxrb_ratio, key1.prv, key1.pub, *system.work.generate (receive1.hash ()));
|
||||
|
||||
|
@ -1217,7 +1217,7 @@ TEST (confirmation_height, cemented_gap_below_no_cache)
|
|||
nano::send_block send3 (dummy_send1.hash (), key2.pub, nano::genesis_amount - nano::Gxrb_ratio * 4, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *system.work.generate (dummy_send1.hash ()));
|
||||
nano::send_block dummy_send2 (send3.hash (), dummy_key.pub, nano::genesis_amount - nano::Gxrb_ratio * 5, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *system.work.generate (send3.hash ()));
|
||||
|
||||
auto open1 = std::make_shared<nano::open_block> (send3.hash (), nano::genesis_account, key2.pub, key2.prv, key2.pub, *system.work.generate (key2.pub));
|
||||
auto open1 = std::make_shared<nano::open_block> (send3.hash (), nano::dev::genesis->account (), key2.pub, key2.prv, key2.pub, *system.work.generate (key2.pub));
|
||||
|
||||
{
|
||||
auto transaction = node->store.tx_begin_write ();
|
||||
|
@ -1241,7 +1241,7 @@ TEST (confirmation_height, cemented_gap_below_no_cache)
|
|||
// Force some blocks to be cemented so that the cached confirmed info variable is empty
|
||||
{
|
||||
auto transaction (node->store.tx_begin_write ());
|
||||
node->store.confirmation_height.put (transaction, nano::genesis_account, nano::confirmation_height_info{ 3, send1.hash () });
|
||||
node->store.confirmation_height.put (transaction, nano::dev::genesis->account (), nano::confirmation_height_info{ 3, send1.hash () });
|
||||
node->store.confirmation_height.put (transaction, key1.pub, nano::confirmation_height_info{ 2, receive1.hash () });
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ TEST (election, construction)
|
|||
nano::system system (1);
|
||||
nano::genesis genesis;
|
||||
auto & node = *system.nodes[0];
|
||||
genesis.open->sideband_set (nano::block_sideband (nano::genesis_account, 0, nano::genesis_amount, 1, nano::seconds_since_epoch (), nano::epoch::epoch_0, false, false, false, nano::epoch::epoch_0));
|
||||
genesis.open->sideband_set (nano::block_sideband (nano::dev::genesis->account (), 0, nano::genesis_amount, 1, nano::seconds_since_epoch (), nano::epoch::epoch_0, false, false, false, nano::epoch::epoch_0));
|
||||
node.block_confirm (genesis.open);
|
||||
node.scheduler.flush ();
|
||||
auto election = node.active.election (genesis.open->qualified_root ());
|
||||
|
|
|
@ -31,16 +31,16 @@ TEST (frontiers_confirmation, prioritize_frontiers)
|
|||
nano::send_block send6 (send5.hash (), key4.pub, node->config.online_weight_minimum.number () + 6000, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *system.work.generate (send5.hash ()));
|
||||
|
||||
// Open all accounts and add other sends to get different uncemented counts (as well as some which are the same)
|
||||
nano::open_block open1 (send1.hash (), nano::genesis_account, key1.pub, key1.prv, key1.pub, *system.work.generate (key1.pub));
|
||||
nano::open_block open1 (send1.hash (), nano::dev::genesis->account (), key1.pub, key1.prv, key1.pub, *system.work.generate (key1.pub));
|
||||
nano::send_block send7 (open1.hash (), nano::dev_genesis_key.pub, 500, key1.prv, key1.pub, *system.work.generate (open1.hash ()));
|
||||
|
||||
nano::open_block open2 (send4.hash (), nano::genesis_account, key2.pub, key2.prv, key2.pub, *system.work.generate (key2.pub));
|
||||
nano::open_block open2 (send4.hash (), nano::dev::genesis->account (), key2.pub, key2.prv, key2.pub, *system.work.generate (key2.pub));
|
||||
|
||||
nano::open_block open3 (send5.hash (), nano::genesis_account, key3.pub, key3.prv, key3.pub, *system.work.generate (key3.pub));
|
||||
nano::open_block open3 (send5.hash (), nano::dev::genesis->account (), key3.pub, key3.prv, key3.pub, *system.work.generate (key3.pub));
|
||||
nano::send_block send8 (open3.hash (), nano::dev_genesis_key.pub, 500, key3.prv, key3.pub, *system.work.generate (open3.hash ()));
|
||||
nano::send_block send9 (send8.hash (), nano::dev_genesis_key.pub, 200, key3.prv, key3.pub, *system.work.generate (send8.hash ()));
|
||||
|
||||
nano::open_block open4 (send6.hash (), nano::genesis_account, key4.pub, key4.prv, key4.pub, *system.work.generate (key4.pub));
|
||||
nano::open_block open4 (send6.hash (), nano::dev::genesis->account (), key4.pub, key4.prv, key4.pub, *system.work.generate (key4.pub));
|
||||
nano::send_block send10 (open4.hash (), nano::dev_genesis_key.pub, 500, key4.prv, key4.pub, *system.work.generate (open4.hash ()));
|
||||
nano::send_block send11 (send10.hash (), nano::dev_genesis_key.pub, 200, key4.prv, key4.pub, *system.work.generate (send10.hash ()));
|
||||
|
||||
|
@ -78,8 +78,8 @@ TEST (frontiers_confirmation, prioritize_frontiers)
|
|||
node->active.prioritize_frontiers_for_confirmation (transaction, std::chrono::seconds (1), std::chrono::seconds (1));
|
||||
ASSERT_EQ (node->active.priority_cementable_frontiers_size (), num_accounts);
|
||||
// Check the order of accounts is as expected (greatest number of uncemented blocks at the front). key3 and key4 have the same value, the order is unspecified so check both
|
||||
std::array<nano::account, num_accounts> desired_order_1{ nano::genesis_account, key3.pub, key4.pub, key1.pub, key2.pub };
|
||||
std::array<nano::account, num_accounts> desired_order_2{ nano::genesis_account, key4.pub, key3.pub, key1.pub, key2.pub };
|
||||
std::array<nano::account, num_accounts> desired_order_1{ nano::dev::genesis->account (), key3.pub, key4.pub, key1.pub, key2.pub };
|
||||
std::array<nano::account, num_accounts> desired_order_2{ nano::dev::genesis->account (), key4.pub, key3.pub, key1.pub, key2.pub };
|
||||
ASSERT_TRUE (priority_orders_match (node->active.priority_cementable_frontiers, desired_order_1) || priority_orders_match (node->active.priority_cementable_frontiers, desired_order_2));
|
||||
}
|
||||
|
||||
|
@ -91,7 +91,7 @@ TEST (frontiers_confirmation, prioritize_frontiers)
|
|||
node->active.prioritize_frontiers_for_confirmation (transaction, std::chrono::seconds (1), std::chrono::seconds (1));
|
||||
ASSERT_EQ (node->active.priority_cementable_frontiers_size (), num_accounts - 3);
|
||||
ASSERT_EQ (node->active.priority_wallet_cementable_frontiers_size (), num_accounts - 2);
|
||||
std::array<nano::account, 3> local_desired_order{ nano::genesis_account, key1.pub, key2.pub };
|
||||
std::array<nano::account, 3> local_desired_order{ nano::dev::genesis->account (), key1.pub, key2.pub };
|
||||
ASSERT_TRUE (priority_orders_match (node->active.priority_wallet_cementable_frontiers, local_desired_order));
|
||||
std::array<nano::account, 2> desired_order_1{ key3.pub, key4.pub };
|
||||
std::array<nano::account, 2> desired_order_2{ key4.pub, key3.pub };
|
||||
|
@ -105,8 +105,8 @@ TEST (frontiers_confirmation, prioritize_frontiers)
|
|||
node->active.prioritize_frontiers_for_confirmation (transaction, std::chrono::seconds (1), std::chrono::seconds (1));
|
||||
ASSERT_EQ (node->active.priority_cementable_frontiers_size (), 0);
|
||||
ASSERT_EQ (node->active.priority_wallet_cementable_frontiers_size (), num_accounts);
|
||||
std::array<nano::account, num_accounts> desired_order_1{ nano::genesis_account, key3.pub, key4.pub, key1.pub, key2.pub };
|
||||
std::array<nano::account, num_accounts> desired_order_2{ nano::genesis_account, key4.pub, key3.pub, key1.pub, key2.pub };
|
||||
std::array<nano::account, num_accounts> desired_order_1{ nano::dev::genesis->account (), key3.pub, key4.pub, key1.pub, key2.pub };
|
||||
std::array<nano::account, num_accounts> desired_order_2{ nano::dev::genesis->account (), key4.pub, key3.pub, key1.pub, key2.pub };
|
||||
ASSERT_TRUE (priority_orders_match (node->active.priority_wallet_cementable_frontiers, desired_order_1) || priority_orders_match (node->active.priority_wallet_cementable_frontiers, desired_order_2));
|
||||
}
|
||||
|
||||
|
@ -128,7 +128,7 @@ TEST (frontiers_confirmation, prioritize_frontiers)
|
|||
}
|
||||
transaction.refresh ();
|
||||
node->active.prioritize_frontiers_for_confirmation (transaction, std::chrono::seconds (1), std::chrono::seconds (1));
|
||||
ASSERT_TRUE (priority_orders_match (node->active.priority_wallet_cementable_frontiers, std::array<nano::account, num_accounts>{ key3.pub, nano::genesis_account, key4.pub, key1.pub, key2.pub }));
|
||||
ASSERT_TRUE (priority_orders_match (node->active.priority_wallet_cementable_frontiers, std::array<nano::account, num_accounts>{ key3.pub, nano::dev::genesis->account (), key4.pub, key1.pub, key2.pub }));
|
||||
uint64_t election_count = 0;
|
||||
node->active.confirm_prioritized_frontiers (transaction, 100, election_count);
|
||||
|
||||
|
@ -159,11 +159,11 @@ TEST (frontiers_confirmation, prioritize_frontiers_max_optimistic_elections)
|
|||
for (auto i = 0; i < max_optimistic_election_count * 2; ++i)
|
||||
{
|
||||
auto transaction = node->store.tx_begin_write ();
|
||||
auto latest = node->latest (nano::genesis_account);
|
||||
auto latest = node->latest (nano::dev::genesis->account ());
|
||||
nano::keypair key;
|
||||
nano::send_block send (latest, key.pub, node->config.online_weight_minimum.number () + 10000, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *system.work.generate (latest));
|
||||
ASSERT_EQ (nano::process_result::progress, node->ledger.process (transaction, send).code);
|
||||
nano::open_block open (send.hash (), nano::genesis_account, key.pub, key.prv, key.pub, *system.work.generate (key.pub));
|
||||
nano::open_block open (send.hash (), nano::dev::genesis->account (), key.pub, key.prv, key.pub, *system.work.generate (key.pub));
|
||||
ASSERT_EQ (nano::process_result::progress, node->ledger.process (transaction, open).code);
|
||||
}
|
||||
|
||||
|
|
|
@ -69,8 +69,8 @@ TEST (gap_cache, gap_bootstrap)
|
|||
nano::keypair key;
|
||||
auto send (std::make_shared<nano::send_block> (latest, key.pub, nano::genesis_amount - 100, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *system.work.generate (latest)));
|
||||
node1.process (*send);
|
||||
ASSERT_EQ (nano::genesis_amount - 100, node1.balance (nano::genesis_account));
|
||||
ASSERT_EQ (nano::genesis_amount, node2.balance (nano::genesis_account));
|
||||
ASSERT_EQ (nano::genesis_amount - 100, node1.balance (nano::dev::genesis->account ()));
|
||||
ASSERT_EQ (nano::genesis_amount, node2.balance (nano::dev::genesis->account ()));
|
||||
// Confirm send block, allowing voting on the upcoming block
|
||||
node1.block_confirm (send);
|
||||
auto election = node1.active.election (send->qualified_root ());
|
||||
|
@ -81,9 +81,9 @@ TEST (gap_cache, gap_bootstrap)
|
|||
system.wallet (0)->insert_adhoc (nano::dev_genesis_key.prv);
|
||||
auto latest_block (system.wallet (0)->send_action (nano::dev_genesis_key.pub, key.pub, 100));
|
||||
ASSERT_NE (nullptr, latest_block);
|
||||
ASSERT_EQ (nano::genesis_amount - 200, node1.balance (nano::genesis_account));
|
||||
ASSERT_EQ (nano::genesis_amount, node2.balance (nano::genesis_account));
|
||||
ASSERT_TIMELY (10s, node2.balance (nano::genesis_account) == nano::genesis_amount - 200);
|
||||
ASSERT_EQ (nano::genesis_amount - 200, node1.balance (nano::dev::genesis->account ()));
|
||||
ASSERT_EQ (nano::genesis_amount, node2.balance (nano::dev::genesis->account ()));
|
||||
ASSERT_TIMELY (10s, node2.balance (nano::dev::genesis->account ()) == nano::genesis_amount - 200);
|
||||
}
|
||||
|
||||
TEST (gap_cache, two_dependencies)
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -2073,16 +2073,16 @@ TEST (node, DISABLED_unconfirmed_send)
|
|||
nano::keypair key0;
|
||||
wallet1->insert_adhoc (key0.prv);
|
||||
wallet0->insert_adhoc (nano::dev_genesis_key.prv);
|
||||
auto send1 (wallet0->send_action (nano::genesis_account, key0.pub, 2 * nano::Mxrb_ratio));
|
||||
auto send1 (wallet0->send_action (nano::dev::genesis->account (), key0.pub, 2 * nano::Mxrb_ratio));
|
||||
ASSERT_TIMELY (10s, node1.balance (key0.pub) == 2 * nano::Mxrb_ratio && !node1.bootstrap_initiator.in_progress ());
|
||||
auto latest (node1.latest (key0.pub));
|
||||
nano::state_block send2 (key0.pub, latest, nano::genesis_account, nano::Mxrb_ratio, nano::genesis_account, key0.prv, key0.pub, *node0.work_generate_blocking (latest));
|
||||
nano::state_block send2 (key0.pub, latest, nano::dev::genesis->account (), nano::Mxrb_ratio, nano::dev::genesis->account (), key0.prv, key0.pub, *node0.work_generate_blocking (latest));
|
||||
{
|
||||
auto transaction (node1.store.tx_begin_write ());
|
||||
ASSERT_EQ (nano::process_result::progress, node1.ledger.process (transaction, send2).code);
|
||||
}
|
||||
auto send3 (wallet1->send_action (key0.pub, nano::genesis_account, nano::Mxrb_ratio));
|
||||
ASSERT_TIMELY (10s, node0.balance (nano::genesis_account) == nano::genesis_amount);
|
||||
auto send3 (wallet1->send_action (key0.pub, nano::dev::genesis->account (), nano::Mxrb_ratio));
|
||||
ASSERT_TIMELY (10s, node0.balance (nano::dev::genesis->account ()) == nano::genesis_amount);
|
||||
}
|
||||
|
||||
// Test that nodes can track nodes that have rep weight for priority broadcasting
|
||||
|
@ -3059,9 +3059,9 @@ TEST (node, vote_by_hash_epoch_block_republish)
|
|||
.work (*system.work.generate (genesis.hash ()))
|
||||
.build_shared ();
|
||||
auto epoch1 = nano::state_block_builder ()
|
||||
.account (nano::genesis_account)
|
||||
.account (nano::dev::genesis->account ())
|
||||
.previous (genesis.hash ())
|
||||
.representative (nano::genesis_account)
|
||||
.representative (nano::dev::genesis->account ())
|
||||
.balance (nano::genesis_amount)
|
||||
.link (node1.ledger.epoch_link (nano::epoch::epoch_1))
|
||||
.sign (nano::dev_genesis_key.prv, nano::dev_genesis_key.pub)
|
||||
|
|
|
@ -29,7 +29,7 @@ TEST (system, system_genesis)
|
|||
for (auto & i : system.nodes)
|
||||
{
|
||||
auto transaction (i->store.tx_begin_read ());
|
||||
ASSERT_EQ (nano::genesis_amount, i->ledger.account_balance (transaction, nano::genesis_account));
|
||||
ASSERT_EQ (nano::genesis_amount, i->ledger.account_balance (transaction, nano::dev::genesis->account ()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ TEST (system, DISABLED_generate_send_existing)
|
|||
nano::thread_runner runner (system.io_ctx, node1.config.io_threads);
|
||||
system.wallet (0)->insert_adhoc (nano::dev_genesis_key.prv);
|
||||
nano::keypair stake_preserver;
|
||||
auto send_block (system.wallet (0)->send_action (nano::genesis_account, stake_preserver.pub, nano::genesis_amount / 3 * 2, true));
|
||||
auto send_block (system.wallet (0)->send_action (nano::dev::genesis->account (), stake_preserver.pub, nano::genesis_amount / 3 * 2, true));
|
||||
nano::account_info info1;
|
||||
{
|
||||
auto transaction (node1.store.tx_begin_read ());
|
||||
|
@ -52,11 +52,11 @@ TEST (system, DISABLED_generate_send_existing)
|
|||
// Have stake_preserver receive funds after generate_send_existing so it isn't chosen as the destination
|
||||
{
|
||||
auto transaction (node1.store.tx_begin_write ());
|
||||
auto open_block (std::make_shared<nano::open_block> (send_block->hash (), nano::genesis_account, stake_preserver.pub, stake_preserver.prv, stake_preserver.pub, 0));
|
||||
auto open_block (std::make_shared<nano::open_block> (send_block->hash (), nano::dev::genesis->account (), stake_preserver.pub, stake_preserver.prv, stake_preserver.pub, 0));
|
||||
node1.work_generate_blocking (*open_block);
|
||||
ASSERT_EQ (nano::process_result::progress, node1.ledger.process (transaction, *open_block).code);
|
||||
}
|
||||
ASSERT_GT (node1.balance (stake_preserver.pub), node1.balance (nano::genesis_account));
|
||||
ASSERT_GT (node1.balance (stake_preserver.pub), node1.balance (nano::dev::genesis->account ()));
|
||||
nano::account_info info2;
|
||||
{
|
||||
auto transaction (node1.store.tx_begin_read ());
|
||||
|
@ -94,14 +94,14 @@ TEST (system, DISABLED_generate_send_new)
|
|||
ASSERT_EQ (node1.store.account.end (), iterator1);
|
||||
}
|
||||
nano::keypair stake_preserver;
|
||||
auto send_block (system.wallet (0)->send_action (nano::genesis_account, stake_preserver.pub, nano::genesis_amount / 3 * 2, true));
|
||||
auto send_block (system.wallet (0)->send_action (nano::dev::genesis->account (), stake_preserver.pub, nano::genesis_amount / 3 * 2, true));
|
||||
{
|
||||
auto transaction (node1.store.tx_begin_write ());
|
||||
auto open_block (std::make_shared<nano::open_block> (send_block->hash (), nano::genesis_account, stake_preserver.pub, stake_preserver.prv, stake_preserver.pub, 0));
|
||||
auto open_block (std::make_shared<nano::open_block> (send_block->hash (), nano::dev::genesis->account (), stake_preserver.pub, stake_preserver.prv, stake_preserver.pub, 0));
|
||||
node1.work_generate_blocking (*open_block);
|
||||
ASSERT_EQ (nano::process_result::progress, node1.ledger.process (transaction, *open_block).code);
|
||||
}
|
||||
ASSERT_GT (node1.balance (stake_preserver.pub), node1.balance (nano::genesis_account));
|
||||
ASSERT_GT (node1.balance (stake_preserver.pub), node1.balance (nano::dev::genesis->account ()));
|
||||
std::vector<nano::account> accounts;
|
||||
accounts.push_back (nano::dev_genesis_key.pub);
|
||||
// This indirectly waits for online weight to stabilize, required to prevent intermittent failures
|
||||
|
|
|
@ -28,7 +28,7 @@ TEST (vote_processor, codes)
|
|||
ASSERT_EQ (nano::vote_code::indeterminate, node.vote_processor.vote_blocking (vote, channel));
|
||||
|
||||
// First vote from an account for an ongoing election
|
||||
genesis.open->sideband_set (nano::block_sideband (nano::genesis_account, 0, nano::genesis_amount, 1, nano::seconds_since_epoch (), nano::epoch::epoch_0, false, false, false, nano::epoch::epoch_0));
|
||||
genesis.open->sideband_set (nano::block_sideband (nano::dev::genesis->account (), 0, nano::genesis_amount, 1, nano::seconds_since_epoch (), nano::epoch::epoch_0, false, false, false, nano::epoch::epoch_0));
|
||||
node.block_confirm (genesis.open);
|
||||
ASSERT_NE (nullptr, node.active.election (genesis.open->qualified_root ()));
|
||||
ASSERT_EQ (nano::vote_code::vote, node.vote_processor.vote_blocking (vote, channel));
|
||||
|
@ -78,7 +78,7 @@ TEST (vote_processor, invalid_signature)
|
|||
vote_invalid->signature.bytes[0] ^= 1;
|
||||
auto channel = std::make_shared<nano::transport::channel_loopback> (node);
|
||||
|
||||
genesis.open->sideband_set (nano::block_sideband (nano::genesis_account, 0, nano::genesis_amount, 1, nano::seconds_since_epoch (), nano::epoch::epoch_0, false, false, false, nano::epoch::epoch_0));
|
||||
genesis.open->sideband_set (nano::block_sideband (nano::dev::genesis->account (), 0, nano::genesis_amount, 1, nano::seconds_since_epoch (), nano::epoch::epoch_0, false, false, false, nano::epoch::epoch_0));
|
||||
node.block_confirm (genesis.open);
|
||||
auto election = node.active.election (genesis.open->qualified_root ());
|
||||
ASSERT_TRUE (election);
|
||||
|
|
|
@ -112,7 +112,7 @@ TEST (vote_generator, session)
|
|||
nano::vote_generator_session generator_session (node->active.generator);
|
||||
boost::thread thread ([node, &generator_session] () {
|
||||
nano::thread_role::set (nano::thread_role::name::request_loop);
|
||||
generator_session.add (nano::genesis_account, nano::dev::genesis->hash ());
|
||||
generator_session.add (nano::dev::genesis->account (), nano::dev::genesis->hash ());
|
||||
ASSERT_EQ (0, node->stats.count (nano::stat::type::vote, nano::stat::detail::vote_indeterminate));
|
||||
generator_session.flush ();
|
||||
});
|
||||
|
|
|
@ -18,7 +18,7 @@ TEST (wallet, no_special_keys_accounts)
|
|||
ASSERT_FALSE (init);
|
||||
auto transaction (env.tx_begin_write ());
|
||||
nano::kdf kdf;
|
||||
nano::wallet_store wallet (init, kdf, transaction, nano::genesis_account, 1, "0");
|
||||
nano::wallet_store wallet (init, kdf, transaction, nano::dev::genesis->account (), 1, "0");
|
||||
ASSERT_FALSE (init);
|
||||
nano::keypair key1;
|
||||
ASSERT_FALSE (wallet.exists (transaction, key1.pub));
|
||||
|
@ -39,7 +39,7 @@ TEST (wallet, no_key)
|
|||
ASSERT_FALSE (init);
|
||||
auto transaction (env.tx_begin_write ());
|
||||
nano::kdf kdf;
|
||||
nano::wallet_store wallet (init, kdf, transaction, nano::genesis_account, 1, "0");
|
||||
nano::wallet_store wallet (init, kdf, transaction, nano::dev::genesis->account (), 1, "0");
|
||||
ASSERT_FALSE (init);
|
||||
nano::keypair key1;
|
||||
nano::raw_key prv1;
|
||||
|
@ -54,7 +54,7 @@ TEST (wallet, fetch_locked)
|
|||
ASSERT_FALSE (init);
|
||||
auto transaction (env.tx_begin_write ());
|
||||
nano::kdf kdf;
|
||||
nano::wallet_store wallet (init, kdf, transaction, nano::genesis_account, 1, "0");
|
||||
nano::wallet_store wallet (init, kdf, transaction, nano::dev::genesis->account (), 1, "0");
|
||||
ASSERT_TRUE (wallet.valid_password (transaction));
|
||||
nano::keypair key1;
|
||||
ASSERT_EQ (key1.pub, wallet.insert_adhoc (transaction, key1.prv));
|
||||
|
@ -76,7 +76,7 @@ TEST (wallet, retrieval)
|
|||
ASSERT_FALSE (init);
|
||||
auto transaction (env.tx_begin_write ());
|
||||
nano::kdf kdf;
|
||||
nano::wallet_store wallet (init, kdf, transaction, nano::genesis_account, 1, "0");
|
||||
nano::wallet_store wallet (init, kdf, transaction, nano::dev::genesis->account (), 1, "0");
|
||||
ASSERT_FALSE (init);
|
||||
nano::keypair key1;
|
||||
ASSERT_TRUE (wallet.valid_password (transaction));
|
||||
|
@ -98,7 +98,7 @@ TEST (wallet, empty_iteration)
|
|||
ASSERT_FALSE (init);
|
||||
auto transaction (env.tx_begin_write ());
|
||||
nano::kdf kdf;
|
||||
nano::wallet_store wallet (init, kdf, transaction, nano::genesis_account, 1, "0");
|
||||
nano::wallet_store wallet (init, kdf, transaction, nano::dev::genesis->account (), 1, "0");
|
||||
ASSERT_FALSE (init);
|
||||
auto i (wallet.begin (transaction));
|
||||
auto j (wallet.end ());
|
||||
|
@ -112,7 +112,7 @@ TEST (wallet, one_item_iteration)
|
|||
ASSERT_FALSE (init);
|
||||
auto transaction (env.tx_begin_write ());
|
||||
nano::kdf kdf;
|
||||
nano::wallet_store wallet (init, kdf, transaction, nano::genesis_account, 1, "0");
|
||||
nano::wallet_store wallet (init, kdf, transaction, nano::dev::genesis->account (), 1, "0");
|
||||
ASSERT_FALSE (init);
|
||||
nano::keypair key1;
|
||||
wallet.insert_adhoc (transaction, key1.prv);
|
||||
|
@ -140,7 +140,7 @@ TEST (wallet, two_item_iteration)
|
|||
nano::kdf kdf;
|
||||
{
|
||||
auto transaction (env.tx_begin_write ());
|
||||
nano::wallet_store wallet (init, kdf, transaction, nano::genesis_account, 1, "0");
|
||||
nano::wallet_store wallet (init, kdf, transaction, nano::dev::genesis->account (), 1, "0");
|
||||
ASSERT_FALSE (init);
|
||||
wallet.insert_adhoc (transaction, key1.prv);
|
||||
wallet.insert_adhoc (transaction, key2.prv);
|
||||
|
@ -278,7 +278,7 @@ TEST (wallet, find_none)
|
|||
ASSERT_FALSE (init);
|
||||
auto transaction (env.tx_begin_write ());
|
||||
nano::kdf kdf;
|
||||
nano::wallet_store wallet (init, kdf, transaction, nano::genesis_account, 1, "0");
|
||||
nano::wallet_store wallet (init, kdf, transaction, nano::dev::genesis->account (), 1, "0");
|
||||
ASSERT_FALSE (init);
|
||||
nano::account account (1000);
|
||||
ASSERT_EQ (wallet.end (), wallet.find (transaction, account));
|
||||
|
@ -291,7 +291,7 @@ TEST (wallet, find_existing)
|
|||
ASSERT_FALSE (init);
|
||||
auto transaction (env.tx_begin_write ());
|
||||
nano::kdf kdf;
|
||||
nano::wallet_store wallet (init, kdf, transaction, nano::genesis_account, 1, "0");
|
||||
nano::wallet_store wallet (init, kdf, transaction, nano::dev::genesis->account (), 1, "0");
|
||||
ASSERT_FALSE (init);
|
||||
nano::keypair key1;
|
||||
ASSERT_FALSE (wallet.exists (transaction, key1.pub));
|
||||
|
@ -310,7 +310,7 @@ TEST (wallet, rekey)
|
|||
ASSERT_FALSE (init);
|
||||
auto transaction (env.tx_begin_write ());
|
||||
nano::kdf kdf;
|
||||
nano::wallet_store wallet (init, kdf, transaction, nano::genesis_account, 1, "0");
|
||||
nano::wallet_store wallet (init, kdf, transaction, nano::dev::genesis->account (), 1, "0");
|
||||
ASSERT_FALSE (init);
|
||||
nano::raw_key password;
|
||||
wallet.password.value (password);
|
||||
|
@ -382,7 +382,7 @@ TEST (wallet, hash_password)
|
|||
ASSERT_FALSE (init);
|
||||
auto transaction (env.tx_begin_write ());
|
||||
nano::kdf kdf;
|
||||
nano::wallet_store wallet (init, kdf, transaction, nano::genesis_account, 1, "0");
|
||||
nano::wallet_store wallet (init, kdf, transaction, nano::dev::genesis->account (), 1, "0");
|
||||
ASSERT_FALSE (init);
|
||||
nano::raw_key hash1;
|
||||
wallet.derive_key (hash1, transaction, "");
|
||||
|
@ -432,25 +432,25 @@ TEST (wallet, reopen_default_password)
|
|||
ASSERT_FALSE (init);
|
||||
nano::kdf kdf;
|
||||
{
|
||||
nano::wallet_store wallet (init, kdf, transaction, nano::genesis_account, 1, "0");
|
||||
nano::wallet_store wallet (init, kdf, transaction, nano::dev::genesis->account (), 1, "0");
|
||||
ASSERT_FALSE (init);
|
||||
ASSERT_TRUE (wallet.valid_password (transaction));
|
||||
}
|
||||
{
|
||||
bool init;
|
||||
nano::wallet_store wallet (init, kdf, transaction, nano::genesis_account, 1, "0");
|
||||
nano::wallet_store wallet (init, kdf, transaction, nano::dev::genesis->account (), 1, "0");
|
||||
ASSERT_FALSE (init);
|
||||
ASSERT_TRUE (wallet.valid_password (transaction));
|
||||
}
|
||||
{
|
||||
nano::wallet_store wallet (init, kdf, transaction, nano::genesis_account, 1, "0");
|
||||
nano::wallet_store wallet (init, kdf, transaction, nano::dev::genesis->account (), 1, "0");
|
||||
ASSERT_FALSE (init);
|
||||
wallet.rekey (transaction, "");
|
||||
ASSERT_TRUE (wallet.valid_password (transaction));
|
||||
}
|
||||
{
|
||||
bool init;
|
||||
nano::wallet_store wallet (init, kdf, transaction, nano::genesis_account, 1, "0");
|
||||
nano::wallet_store wallet (init, kdf, transaction, nano::dev::genesis->account (), 1, "0");
|
||||
ASSERT_FALSE (init);
|
||||
ASSERT_FALSE (wallet.valid_password (transaction));
|
||||
wallet.attempt_password (transaction, " ");
|
||||
|
@ -467,10 +467,10 @@ TEST (wallet, representative)
|
|||
ASSERT_FALSE (error);
|
||||
auto transaction (env.tx_begin_write ());
|
||||
nano::kdf kdf;
|
||||
nano::wallet_store wallet (error, kdf, transaction, nano::genesis_account, 1, "0");
|
||||
nano::wallet_store wallet (error, kdf, transaction, nano::dev::genesis->account (), 1, "0");
|
||||
ASSERT_FALSE (error);
|
||||
ASSERT_FALSE (wallet.is_representative (transaction));
|
||||
ASSERT_EQ (nano::genesis_account, wallet.representative (transaction));
|
||||
ASSERT_EQ (nano::dev::genesis->account (), wallet.representative (transaction));
|
||||
ASSERT_FALSE (wallet.is_representative (transaction));
|
||||
nano::keypair key;
|
||||
wallet.representative_set (transaction, key.pub);
|
||||
|
@ -488,11 +488,11 @@ TEST (wallet, serialize_json_empty)
|
|||
ASSERT_FALSE (error);
|
||||
auto transaction (env.tx_begin_write ());
|
||||
nano::kdf kdf;
|
||||
nano::wallet_store wallet1 (error, kdf, transaction, nano::genesis_account, 1, "0");
|
||||
nano::wallet_store wallet1 (error, kdf, transaction, nano::dev::genesis->account (), 1, "0");
|
||||
ASSERT_FALSE (error);
|
||||
std::string serialized;
|
||||
wallet1.serialize_json (transaction, serialized);
|
||||
nano::wallet_store wallet2 (error, kdf, transaction, nano::genesis_account, 1, "1", serialized);
|
||||
nano::wallet_store wallet2 (error, kdf, transaction, nano::dev::genesis->account (), 1, "1", serialized);
|
||||
ASSERT_FALSE (error);
|
||||
nano::raw_key password1;
|
||||
nano::raw_key password2;
|
||||
|
@ -513,13 +513,13 @@ TEST (wallet, serialize_json_one)
|
|||
ASSERT_FALSE (error);
|
||||
auto transaction (env.tx_begin_write ());
|
||||
nano::kdf kdf;
|
||||
nano::wallet_store wallet1 (error, kdf, transaction, nano::genesis_account, 1, "0");
|
||||
nano::wallet_store wallet1 (error, kdf, transaction, nano::dev::genesis->account (), 1, "0");
|
||||
ASSERT_FALSE (error);
|
||||
nano::keypair key;
|
||||
wallet1.insert_adhoc (transaction, key.prv);
|
||||
std::string serialized;
|
||||
wallet1.serialize_json (transaction, serialized);
|
||||
nano::wallet_store wallet2 (error, kdf, transaction, nano::genesis_account, 1, "1", serialized);
|
||||
nano::wallet_store wallet2 (error, kdf, transaction, nano::dev::genesis->account (), 1, "1", serialized);
|
||||
ASSERT_FALSE (error);
|
||||
nano::raw_key password1;
|
||||
nano::raw_key password2;
|
||||
|
@ -542,14 +542,14 @@ TEST (wallet, serialize_json_password)
|
|||
ASSERT_FALSE (error);
|
||||
auto transaction (env.tx_begin_write ());
|
||||
nano::kdf kdf;
|
||||
nano::wallet_store wallet1 (error, kdf, transaction, nano::genesis_account, 1, "0");
|
||||
nano::wallet_store wallet1 (error, kdf, transaction, nano::dev::genesis->account (), 1, "0");
|
||||
ASSERT_FALSE (error);
|
||||
nano::keypair key;
|
||||
wallet1.rekey (transaction, "password");
|
||||
wallet1.insert_adhoc (transaction, key.prv);
|
||||
std::string serialized;
|
||||
wallet1.serialize_json (transaction, serialized);
|
||||
nano::wallet_store wallet2 (error, kdf, transaction, nano::genesis_account, 1, "1", serialized);
|
||||
nano::wallet_store wallet2 (error, kdf, transaction, nano::dev::genesis->account (), 1, "1", serialized);
|
||||
ASSERT_FALSE (error);
|
||||
ASSERT_FALSE (wallet2.valid_password (transaction));
|
||||
ASSERT_FALSE (wallet2.attempt_password (transaction, "password"));
|
||||
|
@ -575,11 +575,11 @@ TEST (wallet_store, move)
|
|||
ASSERT_FALSE (error);
|
||||
auto transaction (env.tx_begin_write ());
|
||||
nano::kdf kdf;
|
||||
nano::wallet_store wallet1 (error, kdf, transaction, nano::genesis_account, 1, "0");
|
||||
nano::wallet_store wallet1 (error, kdf, transaction, nano::dev::genesis->account (), 1, "0");
|
||||
ASSERT_FALSE (error);
|
||||
nano::keypair key1;
|
||||
wallet1.insert_adhoc (transaction, key1.prv);
|
||||
nano::wallet_store wallet2 (error, kdf, transaction, nano::genesis_account, 1, "1");
|
||||
nano::wallet_store wallet2 (error, kdf, transaction, nano::dev::genesis->account (), 1, "1");
|
||||
ASSERT_FALSE (error);
|
||||
nano::keypair key2;
|
||||
wallet2.insert_adhoc (transaction, key2.prv);
|
||||
|
@ -733,7 +733,7 @@ TEST (wallet, deterministic_keys)
|
|||
ASSERT_FALSE (init);
|
||||
auto transaction (env.tx_begin_write ());
|
||||
nano::kdf kdf;
|
||||
nano::wallet_store wallet (init, kdf, transaction, nano::genesis_account, 1, "0");
|
||||
nano::wallet_store wallet (init, kdf, transaction, nano::dev::genesis->account (), 1, "0");
|
||||
auto key1 = wallet.deterministic_key (transaction, 0);
|
||||
auto key2 = wallet.deterministic_key (transaction, 0);
|
||||
ASSERT_EQ (key1, key2);
|
||||
|
@ -776,7 +776,7 @@ TEST (wallet, reseed)
|
|||
ASSERT_FALSE (init);
|
||||
auto transaction (env.tx_begin_write ());
|
||||
nano::kdf kdf;
|
||||
nano::wallet_store wallet (init, kdf, transaction, nano::genesis_account, 1, "0");
|
||||
nano::wallet_store wallet (init, kdf, transaction, nano::dev::genesis->account (), 1, "0");
|
||||
nano::raw_key seed1;
|
||||
seed1 = 1;
|
||||
nano::raw_key seed2;
|
||||
|
@ -1163,11 +1163,11 @@ TEST (wallet, search_pending)
|
|||
wallet.insert_adhoc (nano::dev_genesis_key.prv);
|
||||
nano::block_builder builder;
|
||||
auto send = builder.state ()
|
||||
.account (nano::genesis_account)
|
||||
.account (nano::dev::genesis->account ())
|
||||
.previous (nano::dev::genesis->hash ())
|
||||
.representative (nano::genesis_account)
|
||||
.representative (nano::dev::genesis->account ())
|
||||
.balance (nano::genesis_amount - node.config.receive_minimum.number ())
|
||||
.link (nano::genesis_account)
|
||||
.link (nano::dev::genesis->account ())
|
||||
.sign (nano::dev_genesis_key.prv, nano::dev_genesis_key.pub)
|
||||
.work (*system.work.generate (nano::dev::genesis->hash ()))
|
||||
.build ();
|
||||
|
@ -1180,7 +1180,7 @@ TEST (wallet, search_pending)
|
|||
ASSERT_NE (nullptr, election);
|
||||
|
||||
// Erase the key so the confirmation does not trigger an automatic receive
|
||||
wallet.store.erase (node.wallets.tx_begin_write (), nano::genesis_account);
|
||||
wallet.store.erase (node.wallets.tx_begin_write (), nano::dev::genesis->account ());
|
||||
|
||||
// Now confirm the election
|
||||
election->force_confirm ();
|
||||
|
@ -1193,8 +1193,8 @@ TEST (wallet, search_pending)
|
|||
// Pending search should create the receive block
|
||||
ASSERT_EQ (2, node.ledger.cache.block_count);
|
||||
ASSERT_FALSE (wallet.search_pending (wallet.wallets.tx_begin_read ()));
|
||||
ASSERT_TIMELY (3s, node.balance (nano::genesis_account) == nano::genesis_amount);
|
||||
auto receive_hash = node.ledger.latest (node.store.tx_begin_read (), nano::genesis_account);
|
||||
ASSERT_TIMELY (3s, node.balance (nano::dev::genesis->account ()) == nano::genesis_amount);
|
||||
auto receive_hash = node.ledger.latest (node.store.tx_begin_read (), nano::dev::genesis->account ());
|
||||
auto receive = node.block (receive_hash);
|
||||
ASSERT_NE (nullptr, receive);
|
||||
ASSERT_EQ (receive->sideband ().height, 3);
|
||||
|
|
|
@ -166,11 +166,11 @@ TEST (wallets, search_pending)
|
|||
wallet->insert_adhoc (nano::dev_genesis_key.prv);
|
||||
nano::block_builder builder;
|
||||
auto send = builder.state ()
|
||||
.account (nano::genesis_account)
|
||||
.account (nano::dev::genesis->account ())
|
||||
.previous (nano::dev::genesis->hash ())
|
||||
.representative (nano::genesis_account)
|
||||
.representative (nano::dev::genesis->account ())
|
||||
.balance (nano::genesis_amount - node.config.receive_minimum.number ())
|
||||
.link (nano::genesis_account)
|
||||
.link (nano::dev::genesis->account ())
|
||||
.sign (nano::dev_genesis_key.prv, nano::dev_genesis_key.pub)
|
||||
.work (*system.work.generate (nano::dev::genesis->hash ()))
|
||||
.build ();
|
||||
|
@ -190,7 +190,7 @@ TEST (wallets, search_pending)
|
|||
ASSERT_NE (nullptr, election);
|
||||
|
||||
// Erase the key so the confirmation does not trigger an automatic receive
|
||||
wallet->store.erase (node.wallets.tx_begin_write (), nano::genesis_account);
|
||||
wallet->store.erase (node.wallets.tx_begin_write (), nano::dev::genesis->account ());
|
||||
|
||||
// Now confirm the election
|
||||
election->force_confirm ();
|
||||
|
@ -210,8 +210,8 @@ TEST (wallets, search_pending)
|
|||
{
|
||||
node.wallets.search_pending (wallet_id);
|
||||
}
|
||||
ASSERT_TIMELY (3s, node.balance (nano::genesis_account) == nano::genesis_amount);
|
||||
auto receive_hash = node.ledger.latest (node.store.tx_begin_read (), nano::genesis_account);
|
||||
ASSERT_TIMELY (3s, node.balance (nano::dev::genesis->account ()) == nano::genesis_amount);
|
||||
auto receive_hash = node.ledger.latest (node.store.tx_begin_read (), nano::dev::genesis->account ());
|
||||
auto receive = node.block (receive_hash);
|
||||
ASSERT_NE (nullptr, receive);
|
||||
ASSERT_EQ (receive->sideband ().height, 3);
|
||||
|
|
|
@ -437,7 +437,7 @@ int main (int argc, char * const * argv)
|
|||
|
||||
// Send from genesis account to different accounts and receive the funds
|
||||
boost::asio::spawn (ioc, [&ioc, &primary_node_results, &wallet, destination_account, &send_calls_remaining] (boost::asio::yield_context yield) {
|
||||
send_receive (ioc, wallet, nano::genesis_account.to_account (), destination_account->as_string, send_calls_remaining, primary_node_results, yield);
|
||||
send_receive (ioc, wallet, nano::dev::genesis->account ().to_account (), destination_account->as_string, send_calls_remaining, primary_node_results, yield);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -350,7 +350,7 @@ TEST (wallet, process_block)
|
|||
nano_qt::eventloop_processor processor;
|
||||
nano::system system (1);
|
||||
nano::account account;
|
||||
nano::block_hash latest (system.nodes[0]->latest (nano::genesis_account));
|
||||
nano::block_hash latest (system.nodes[0]->latest (nano::dev::genesis->account ()));
|
||||
system.wallet (0)->insert_adhoc (nano::keypair ().prv);
|
||||
{
|
||||
auto transaction (system.nodes[0]->wallets.tx_begin_read ());
|
||||
|
@ -655,7 +655,7 @@ TEST (wallet, block_viewer)
|
|||
ASSERT_NE (-1, wallet->advanced.layout->indexOf (wallet->advanced.block_viewer));
|
||||
QTest::mouseClick (wallet->advanced.block_viewer, Qt::LeftButton);
|
||||
ASSERT_EQ (wallet->block_viewer.window, wallet->main_stack->currentWidget ());
|
||||
nano::block_hash latest (system.nodes[0]->latest (nano::genesis_account));
|
||||
nano::block_hash latest (system.nodes[0]->latest (nano::dev::genesis->account ()));
|
||||
QTest::keyClicks (wallet->block_viewer.hash, latest.to_string ().c_str ());
|
||||
QTest::mouseClick (wallet->block_viewer.retrieve, Qt::LeftButton);
|
||||
ASSERT_FALSE (wallet->block_viewer.block->toPlainText ().toStdString ().empty ());
|
||||
|
@ -906,7 +906,7 @@ TEST (wallet, DISABLED_synchronizing)
|
|||
wallet->start ();
|
||||
{
|
||||
auto transaction (system1.nodes[0]->store.tx_begin_write ());
|
||||
auto latest (system1.nodes[0]->ledger.latest (transaction, nano::genesis_account));
|
||||
auto latest (system1.nodes[0]->ledger.latest (transaction, nano::dev::genesis->account ()));
|
||||
nano::send_block send (latest, key1, 0, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *system1.work.generate (latest));
|
||||
system1.nodes[0]->ledger.process (transaction, send);
|
||||
}
|
||||
|
|
|
@ -663,7 +663,7 @@ TEST (rpc, wallet_representative)
|
|||
request.put ("action", "wallet_representative");
|
||||
auto response (wait_response (system, rpc, request));
|
||||
std::string account_text1 (response.get<std::string> ("representative"));
|
||||
ASSERT_EQ (account_text1, nano::genesis_account.to_account ());
|
||||
ASSERT_EQ (account_text1, nano::dev::genesis->account ().to_account ());
|
||||
}
|
||||
|
||||
TEST (rpc, wallet_representative_set)
|
||||
|
@ -822,7 +822,7 @@ TEST (rpc, wallet_export)
|
|||
rpc_ctx->io_scope->reset ();
|
||||
auto transaction (node->wallets.tx_begin_write ());
|
||||
nano::kdf kdf;
|
||||
nano::wallet_store store (error, kdf, transaction, nano::genesis_account, 1, "0", wallet_json);
|
||||
nano::wallet_store store (error, kdf, transaction, nano::dev::genesis->account (), 1, "0", wallet_json);
|
||||
ASSERT_FALSE (error);
|
||||
ASSERT_TRUE (store.exists (transaction, nano::dev_genesis_key.pub));
|
||||
}
|
||||
|
@ -877,7 +877,7 @@ TEST (rpc, block)
|
|||
auto [rpc, rpc_ctx] = add_rpc (system, node);
|
||||
boost::property_tree::ptree request;
|
||||
request.put ("action", "block");
|
||||
request.put ("hash", node->latest (nano::genesis_account).to_string ());
|
||||
request.put ("hash", node->latest (nano::dev::genesis->account ()).to_string ());
|
||||
auto response (wait_response (system, rpc, request));
|
||||
auto contents (response.get<std::string> ("contents"));
|
||||
ASSERT_FALSE (contents.empty ());
|
||||
|
@ -1086,9 +1086,9 @@ TEST (rpc, history)
|
|||
auto receive (system.wallet (0)->receive_action (send->hash (), nano::dev_genesis_key.pub, node0->config.receive_minimum.number (), send->link ().as_account ()));
|
||||
ASSERT_NE (nullptr, receive);
|
||||
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::dev_genesis_key.prv, nano::dev_genesis_key.pub, *node0->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::dev_genesis_key.prv, nano::dev_genesis_key.pub, *node0->work_generate_blocking (usend.hash ()));
|
||||
nano::state_block uchange (nano::genesis_account, ureceive.hash (), nano::keypair ().pub, nano::genesis_amount, 0, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *node0->work_generate_blocking (ureceive.hash ()));
|
||||
nano::state_block usend (nano::dev::genesis->account (), node0->latest (nano::dev::genesis->account ()), nano::dev::genesis->account (), nano::genesis_amount - nano::Gxrb_ratio, nano::dev::genesis->account (), nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *node0->work_generate_blocking (node0->latest (nano::dev::genesis->account ())));
|
||||
nano::state_block ureceive (nano::dev::genesis->account (), usend.hash (), nano::dev::genesis->account (), nano::genesis_amount, usend.hash (), nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *node0->work_generate_blocking (usend.hash ()));
|
||||
nano::state_block uchange (nano::dev::genesis->account (), ureceive.hash (), nano::keypair ().pub, nano::genesis_amount, 0, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *node0->work_generate_blocking (ureceive.hash ()));
|
||||
{
|
||||
auto transaction (node0->store.tx_begin_write ());
|
||||
ASSERT_EQ (nano::process_result::progress, node0->ledger.process (transaction, usend).code);
|
||||
|
@ -1143,9 +1143,9 @@ TEST (rpc, account_history)
|
|||
auto receive (system.wallet (0)->receive_action (send->hash (), nano::dev_genesis_key.pub, node0->config.receive_minimum.number (), send->link ().as_account ()));
|
||||
ASSERT_NE (nullptr, receive);
|
||||
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::dev_genesis_key.prv, nano::dev_genesis_key.pub, *node0->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::dev_genesis_key.prv, nano::dev_genesis_key.pub, *node0->work_generate_blocking (usend.hash ()));
|
||||
nano::state_block uchange (nano::genesis_account, ureceive.hash (), nano::keypair ().pub, nano::genesis_amount, 0, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *node0->work_generate_blocking (ureceive.hash ()));
|
||||
nano::state_block usend (nano::dev::genesis->account (), node0->latest (nano::dev::genesis->account ()), nano::dev::genesis->account (), nano::genesis_amount - nano::Gxrb_ratio, nano::dev::genesis->account (), nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *node0->work_generate_blocking (node0->latest (nano::dev::genesis->account ())));
|
||||
nano::state_block ureceive (nano::dev::genesis->account (), usend.hash (), nano::dev::genesis->account (), nano::genesis_amount, usend.hash (), nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *node0->work_generate_blocking (usend.hash ()));
|
||||
nano::state_block uchange (nano::dev::genesis->account (), ureceive.hash (), nano::keypair ().pub, nano::genesis_amount, 0, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *node0->work_generate_blocking (ureceive.hash ()));
|
||||
{
|
||||
auto transaction (node0->store.tx_begin_write ());
|
||||
ASSERT_EQ (nano::process_result::progress, node0->ledger.process (transaction, usend).code);
|
||||
|
@ -1156,7 +1156,7 @@ TEST (rpc, account_history)
|
|||
{
|
||||
boost::property_tree::ptree request;
|
||||
request.put ("action", "account_history");
|
||||
request.put ("account", nano::genesis_account.to_account ());
|
||||
request.put ("account", nano::dev::genesis->account ().to_account ());
|
||||
request.put ("count", 100);
|
||||
auto response (wait_response (system, rpc, request, 10s));
|
||||
std::vector<std::tuple<std::string, std::string, std::string, std::string, std::string>> history_l;
|
||||
|
@ -1197,7 +1197,7 @@ TEST (rpc, account_history)
|
|||
{
|
||||
boost::property_tree::ptree request;
|
||||
request.put ("action", "account_history");
|
||||
request.put ("account", nano::genesis_account.to_account ());
|
||||
request.put ("account", nano::dev::genesis->account ().to_account ());
|
||||
request.put ("reverse", true);
|
||||
request.put ("count", 1);
|
||||
auto response (wait_response (system, rpc, request, 10s));
|
||||
|
@ -1283,9 +1283,9 @@ TEST (rpc, history_pruning)
|
|||
node0->process_active (send);
|
||||
auto receive (std::make_shared<nano::receive_block> (send->hash (), send->hash (), nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *node0->work.generate (send->hash ())));
|
||||
node0->process_active (receive);
|
||||
auto usend (std::make_shared<nano::state_block> (nano::genesis_account, receive->hash (), nano::genesis_account, nano::genesis_amount - nano::Gxrb_ratio, nano::genesis_account, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *node0->work_generate_blocking (receive->hash ())));
|
||||
auto ureceive (std::make_shared<nano::state_block> (nano::genesis_account, usend->hash (), nano::genesis_account, nano::genesis_amount, usend->hash (), nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *node0->work_generate_blocking (usend->hash ())));
|
||||
auto uchange (std::make_shared<nano::state_block> (nano::genesis_account, ureceive->hash (), nano::keypair ().pub, nano::genesis_amount, 0, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *node0->work_generate_blocking (ureceive->hash ())));
|
||||
auto usend (std::make_shared<nano::state_block> (nano::dev::genesis->account (), receive->hash (), nano::dev::genesis->account (), nano::genesis_amount - nano::Gxrb_ratio, nano::dev::genesis->account (), nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *node0->work_generate_blocking (receive->hash ())));
|
||||
auto ureceive (std::make_shared<nano::state_block> (nano::dev::genesis->account (), usend->hash (), nano::dev::genesis->account (), nano::genesis_amount, usend->hash (), nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *node0->work_generate_blocking (usend->hash ())));
|
||||
auto uchange (std::make_shared<nano::state_block> (nano::dev::genesis->account (), ureceive->hash (), nano::keypair ().pub, nano::genesis_amount, 0, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *node0->work_generate_blocking (ureceive->hash ())));
|
||||
node0->process_active (usend);
|
||||
node0->process_active (ureceive);
|
||||
node0->process_active (uchange);
|
||||
|
@ -1546,7 +1546,7 @@ TEST (rpc, process_subtype_send)
|
|||
auto [rpc, rpc_ctx] = add_rpc (system, node1);
|
||||
nano::keypair key;
|
||||
auto latest (node1->latest (nano::dev_genesis_key.pub));
|
||||
nano::state_block send (nano::genesis_account, latest, nano::genesis_account, nano::genesis_amount - nano::Gxrb_ratio, key.pub, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *node1->work_generate_blocking (latest));
|
||||
nano::state_block send (nano::dev::genesis->account (), latest, nano::dev::genesis->account (), nano::genesis_amount - nano::Gxrb_ratio, key.pub, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *node1->work_generate_blocking (latest));
|
||||
boost::property_tree::ptree request;
|
||||
request.put ("action", "process");
|
||||
std::string json;
|
||||
|
@ -1572,7 +1572,7 @@ TEST (rpc, process_subtype_open)
|
|||
auto & node2 = *system.add_node ();
|
||||
nano::keypair key;
|
||||
auto latest (node1->latest (nano::dev_genesis_key.pub));
|
||||
auto send = std::make_shared<nano::state_block> (nano::genesis_account, latest, nano::genesis_account, nano::genesis_amount - nano::Gxrb_ratio, key.pub, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *node1->work_generate_blocking (latest));
|
||||
auto send = std::make_shared<nano::state_block> (nano::dev::genesis->account (), latest, nano::dev::genesis->account (), nano::genesis_amount - nano::Gxrb_ratio, key.pub, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *node1->work_generate_blocking (latest));
|
||||
ASSERT_EQ (nano::process_result::progress, node1->process (*send).code);
|
||||
ASSERT_EQ (nano::process_result::progress, node2.process (*send).code);
|
||||
auto [rpc, rpc_ctx] = add_rpc (system, node1);
|
||||
|
@ -1602,7 +1602,7 @@ TEST (rpc, process_subtype_receive)
|
|||
auto node1 = add_ipc_enabled_node (system);
|
||||
auto & node2 = *system.add_node ();
|
||||
auto latest (node1->latest (nano::dev_genesis_key.pub));
|
||||
auto send = std::make_shared<nano::state_block> (nano::genesis_account, latest, nano::genesis_account, nano::genesis_amount - nano::Gxrb_ratio, nano::dev_genesis_key.pub, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *node1->work_generate_blocking (latest));
|
||||
auto send = std::make_shared<nano::state_block> (nano::dev::genesis->account (), latest, nano::dev::genesis->account (), nano::genesis_amount - nano::Gxrb_ratio, nano::dev_genesis_key.pub, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *node1->work_generate_blocking (latest));
|
||||
ASSERT_EQ (nano::process_result::progress, node1->process (*send).code);
|
||||
ASSERT_EQ (nano::process_result::progress, node2.process (*send).code);
|
||||
auto [rpc, rpc_ctx] = add_rpc (system, node1);
|
||||
|
@ -1636,7 +1636,7 @@ TEST (rpc, process_ledger_insufficient_work)
|
|||
auto latest (node->latest (nano::dev_genesis_key.pub));
|
||||
auto min_difficulty = node->network_params.network.publish_thresholds.entry;
|
||||
auto max_difficulty = node->network_params.network.publish_thresholds.epoch_1;
|
||||
nano::state_block send (nano::genesis_account, latest, nano::genesis_account, nano::genesis_amount - nano::Gxrb_ratio, nano::dev_genesis_key.pub, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, system.work_generate_limited (latest, min_difficulty, max_difficulty));
|
||||
nano::state_block send (nano::dev::genesis->account (), latest, nano::dev::genesis->account (), nano::genesis_amount - nano::Gxrb_ratio, nano::dev_genesis_key.pub, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, system.work_generate_limited (latest, min_difficulty, max_difficulty));
|
||||
ASSERT_LT (send.difficulty (), max_difficulty);
|
||||
ASSERT_GE (send.difficulty (), min_difficulty);
|
||||
boost::property_tree::ptree request;
|
||||
|
@ -2478,11 +2478,11 @@ TEST (rpc, account_representative)
|
|||
auto node = add_ipc_enabled_node (system);
|
||||
auto [rpc, rpc_ctx] = add_rpc (system, node);
|
||||
boost::property_tree::ptree request;
|
||||
request.put ("account", nano::genesis_account.to_account ());
|
||||
request.put ("account", nano::dev::genesis->account ().to_account ());
|
||||
request.put ("action", "account_representative");
|
||||
auto response (wait_response (system, rpc, request));
|
||||
std::string account_text1 (response.get<std::string> ("representative"));
|
||||
ASSERT_EQ (account_text1, nano::genesis_account.to_account ());
|
||||
ASSERT_EQ (account_text1, nano::dev::genesis->account ().to_account ());
|
||||
}
|
||||
|
||||
TEST (rpc, account_representative_set)
|
||||
|
@ -2493,7 +2493,7 @@ TEST (rpc, account_representative_set)
|
|||
auto [rpc, rpc_ctx] = add_rpc (system, node);
|
||||
boost::property_tree::ptree request;
|
||||
nano::keypair rep;
|
||||
request.put ("account", nano::genesis_account.to_account ());
|
||||
request.put ("account", nano::dev::genesis->account ().to_account ());
|
||||
request.put ("representative", rep.pub.to_account ());
|
||||
request.put ("wallet", node->wallets.items.begin ()->first.to_string ());
|
||||
request.put ("action", "account_representative_set");
|
||||
|
@ -2517,7 +2517,7 @@ TEST (rpc, account_representative_set_work_disabled)
|
|||
auto [rpc, rpc_ctx] = add_rpc (system, node);
|
||||
boost::property_tree::ptree request;
|
||||
nano::keypair rep;
|
||||
request.put ("account", nano::genesis_account.to_account ());
|
||||
request.put ("account", nano::dev::genesis->account ().to_account ());
|
||||
request.put ("representative", rep.pub.to_account ());
|
||||
request.put ("wallet", node->wallets.items.begin ()->first.to_string ());
|
||||
request.put ("action", "account_representative_set");
|
||||
|
@ -2569,7 +2569,7 @@ TEST (rpc, bootstrap)
|
|||
nano::system system1 (1);
|
||||
auto node1 = system1.nodes[0];
|
||||
auto latest (node1->latest (nano::dev_genesis_key.pub));
|
||||
nano::send_block send (latest, nano::genesis_account, 100, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *node1->work_generate_blocking (latest));
|
||||
nano::send_block send (latest, nano::dev::genesis->account (), 100, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *node1->work_generate_blocking (latest));
|
||||
{
|
||||
auto transaction (node1->store.tx_begin_write ());
|
||||
ASSERT_EQ (nano::process_result::progress, node1->ledger.process (transaction, send).code);
|
||||
|
@ -2585,7 +2585,7 @@ TEST (rpc, bootstrap)
|
|||
system0.poll ();
|
||||
}
|
||||
system1.deadline_set (10s);
|
||||
while (node->latest (nano::genesis_account) != node1->latest (nano::genesis_account))
|
||||
while (node->latest (nano::dev::genesis->account ()) != node1->latest (nano::dev::genesis->account ()))
|
||||
{
|
||||
ASSERT_NO_ERROR (system0.poll ());
|
||||
ASSERT_NO_ERROR (system1.poll ());
|
||||
|
@ -2624,7 +2624,7 @@ TEST (rpc, representatives)
|
|||
representatives.push_back (account);
|
||||
}
|
||||
ASSERT_EQ (1, representatives.size ());
|
||||
ASSERT_EQ (nano::genesis_account, representatives[0]);
|
||||
ASSERT_EQ (nano::dev::genesis->account (), representatives[0]);
|
||||
}
|
||||
|
||||
// wallet_seed is only available over IPC's unsafe encoding, and when running on test network
|
||||
|
@ -2700,7 +2700,7 @@ TEST (rpc, wallet_frontiers)
|
|||
frontiers.push_back (nano::account (i->second.get<std::string> ("")));
|
||||
}
|
||||
ASSERT_EQ (1, frontiers.size ());
|
||||
ASSERT_EQ (node->latest (nano::genesis_account), frontiers[0]);
|
||||
ASSERT_EQ (node->latest (nano::dev::genesis->account ()), frontiers[0]);
|
||||
}
|
||||
|
||||
TEST (rpc, work_validate)
|
||||
|
@ -2848,7 +2848,7 @@ TEST (rpc, bootstrap_any)
|
|||
auto node = add_ipc_enabled_node (system0);
|
||||
nano::system system1 (1);
|
||||
auto latest (system1.nodes[0]->latest (nano::dev_genesis_key.pub));
|
||||
nano::send_block send (latest, nano::genesis_account, 100, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *system1.nodes[0]->work_generate_blocking (latest));
|
||||
nano::send_block send (latest, nano::dev::genesis->account (), 100, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *system1.nodes[0]->work_generate_blocking (latest));
|
||||
{
|
||||
auto transaction (system1.nodes[0]->store.tx_begin_write ());
|
||||
ASSERT_EQ (nano::process_result::progress, system1.nodes[0]->ledger.process (transaction, send).code);
|
||||
|
@ -2985,7 +2985,7 @@ TEST (rpc, accounts_frontiers)
|
|||
std::string account_text (frontiers.first);
|
||||
ASSERT_EQ (nano::dev_genesis_key.pub.to_account (), account_text);
|
||||
std::string frontier_text (frontiers.second.get<std::string> (""));
|
||||
ASSERT_EQ (node->latest (nano::genesis_account), nano::block_hash{ frontier_text });
|
||||
ASSERT_EQ (node->latest (nano::dev::genesis->account ()), nano::block_hash{ frontier_text });
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3093,14 +3093,14 @@ TEST (rpc, blocks)
|
|||
request.put ("action", "blocks");
|
||||
boost::property_tree::ptree entry;
|
||||
boost::property_tree::ptree peers_l;
|
||||
entry.put ("", node->latest (nano::genesis_account).to_string ());
|
||||
entry.put ("", node->latest (nano::dev::genesis->account ()).to_string ());
|
||||
peers_l.push_back (std::make_pair ("", entry));
|
||||
request.add_child ("hashes", peers_l);
|
||||
auto response (wait_response (system, rpc, request));
|
||||
for (auto & blocks : response.get_child ("blocks"))
|
||||
{
|
||||
std::string hash_text (blocks.first);
|
||||
ASSERT_EQ (node->latest (nano::genesis_account).to_string (), hash_text);
|
||||
ASSERT_EQ (node->latest (nano::dev::genesis->account ()).to_string (), hash_text);
|
||||
std::string blocks_text (blocks.second.get<std::string> (""));
|
||||
ASSERT_FALSE (blocks_text.empty ());
|
||||
}
|
||||
|
@ -3203,7 +3203,7 @@ TEST (rpc, pending_exists)
|
|||
auto node = add_ipc_enabled_node (system);
|
||||
nano::keypair key1;
|
||||
system.wallet (0)->insert_adhoc (nano::dev_genesis_key.prv);
|
||||
auto hash0 (node->latest (nano::genesis_account));
|
||||
auto hash0 (node->latest (nano::dev::genesis->account ()));
|
||||
auto block1 (system.wallet (0)->send_action (nano::dev_genesis_key.pub, key1.pub, 100));
|
||||
node->scheduler.flush ();
|
||||
ASSERT_TIMELY (5s, !node->active.active (*block1));
|
||||
|
@ -3368,7 +3368,7 @@ TEST (rpc, work_get)
|
|||
std::string work_text (response.get<std::string> ("work"));
|
||||
uint64_t work (1);
|
||||
auto transaction (node->wallets.tx_begin_read ());
|
||||
node->wallets.items.begin ()->second->store.work_get (transaction, nano::genesis_account, work);
|
||||
node->wallets.items.begin ()->second->store.work_get (transaction, nano::dev::genesis->account (), work);
|
||||
ASSERT_EQ (nano::to_string_hex (work), work_text);
|
||||
}
|
||||
|
||||
|
@ -3390,7 +3390,7 @@ TEST (rpc, wallet_work_get)
|
|||
ASSERT_EQ (nano::dev_genesis_key.pub.to_account (), account_text);
|
||||
std::string work_text (works.second.get<std::string> (""));
|
||||
uint64_t work (1);
|
||||
node->wallets.items.begin ()->second->store.work_get (transaction, nano::genesis_account, work);
|
||||
node->wallets.items.begin ()->second->store.work_get (transaction, nano::dev::genesis->account (), work);
|
||||
ASSERT_EQ (nano::to_string_hex (work), work_text);
|
||||
}
|
||||
}
|
||||
|
@ -3412,7 +3412,7 @@ TEST (rpc, work_set)
|
|||
ASSERT_TRUE (success.empty ());
|
||||
uint64_t work1 (1);
|
||||
auto transaction (node->wallets.tx_begin_read ());
|
||||
node->wallets.items.begin ()->second->store.work_get (transaction, nano::genesis_account, work1);
|
||||
node->wallets.items.begin ()->second->store.work_get (transaction, nano::dev::genesis->account (), work1);
|
||||
ASSERT_EQ (work1, work0);
|
||||
}
|
||||
|
||||
|
@ -3775,7 +3775,7 @@ TEST (rpc, json_block_input)
|
|||
auto node1 = add_ipc_enabled_node (system);
|
||||
nano::keypair key;
|
||||
system.wallet (0)->insert_adhoc (key.prv);
|
||||
nano::state_block send (nano::genesis_account, node1->latest (nano::dev_genesis_key.pub), nano::genesis_account, nano::genesis_amount - nano::Gxrb_ratio, key.pub, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, 0);
|
||||
nano::state_block send (nano::dev::genesis->account (), node1->latest (nano::dev_genesis_key.pub), nano::dev::genesis->account (), nano::genesis_amount - nano::Gxrb_ratio, key.pub, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, 0);
|
||||
auto [rpc, rpc_ctx] = add_rpc (system, node1);
|
||||
boost::property_tree::ptree request;
|
||||
request.put ("action", "sign");
|
||||
|
@ -3829,7 +3829,7 @@ TEST (rpc, blocks_info)
|
|||
for (auto & blocks : response.get_child ("blocks"))
|
||||
{
|
||||
std::string hash_text (blocks.first);
|
||||
ASSERT_EQ (node->latest (nano::genesis_account).to_string (), hash_text);
|
||||
ASSERT_EQ (node->latest (nano::dev::genesis->account ()).to_string (), hash_text);
|
||||
std::string account_text (blocks.second.get<std::string> ("block_account"));
|
||||
ASSERT_EQ (nano::dev_genesis_key.pub.to_account (), account_text);
|
||||
std::string amount_text (blocks.second.get<std::string> ("amount"));
|
||||
|
@ -3851,7 +3851,7 @@ TEST (rpc, blocks_info)
|
|||
request.put ("action", "blocks_info");
|
||||
boost::property_tree::ptree entry;
|
||||
boost::property_tree::ptree hashes;
|
||||
entry.put ("", node->latest (nano::genesis_account).to_string ());
|
||||
entry.put ("", node->latest (nano::dev::genesis->account ()).to_string ());
|
||||
hashes.push_back (std::make_pair ("", entry));
|
||||
request.add_child ("hashes", hashes);
|
||||
{
|
||||
|
@ -5222,7 +5222,7 @@ TEST (rpc, sign_hash)
|
|||
nano::system system;
|
||||
auto node1 = add_ipc_enabled_node (system);
|
||||
nano::keypair key;
|
||||
nano::state_block send (nano::genesis_account, node1->latest (nano::dev_genesis_key.pub), nano::genesis_account, nano::genesis_amount - nano::Gxrb_ratio, key.pub, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, 0);
|
||||
nano::state_block send (nano::dev::genesis->account (), node1->latest (nano::dev_genesis_key.pub), nano::dev::genesis->account (), nano::genesis_amount - nano::Gxrb_ratio, key.pub, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, 0);
|
||||
auto [rpc, rpc_ctx] = add_rpc (system, node1);
|
||||
boost::property_tree::ptree request;
|
||||
request.put ("action", "sign");
|
||||
|
@ -5245,7 +5245,7 @@ TEST (rpc, sign_block)
|
|||
auto node1 = add_ipc_enabled_node (system);
|
||||
nano::keypair key;
|
||||
system.wallet (0)->insert_adhoc (key.prv);
|
||||
nano::state_block send (nano::genesis_account, node1->latest (nano::dev_genesis_key.pub), nano::genesis_account, nano::genesis_amount - nano::Gxrb_ratio, key.pub, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, 0);
|
||||
nano::state_block send (nano::dev::genesis->account (), node1->latest (nano::dev_genesis_key.pub), nano::dev::genesis->account (), nano::genesis_amount - nano::Gxrb_ratio, key.pub, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, 0);
|
||||
auto [rpc, rpc_ctx] = add_rpc (system, node1);
|
||||
boost::property_tree::ptree request;
|
||||
request.put ("action", "sign");
|
||||
|
@ -5321,7 +5321,7 @@ TEST (rpc, block_confirmed)
|
|||
nano::send_block send1 (latest, key.pub, 300, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *system.work.generate (latest));
|
||||
ASSERT_EQ (nano::process_result::progress, node->ledger.process (transaction, send1).code);
|
||||
|
||||
nano::open_block open1 (send1.hash (), nano::genesis_account, key.pub, key.prv, key.pub, *system.work.generate (key.pub));
|
||||
nano::open_block open1 (send1.hash (), nano::dev::genesis->account (), key.pub, key.prv, key.pub, *system.work.generate (key.pub));
|
||||
ASSERT_EQ (nano::process_result::progress, node->ledger.process (transaction, open1).code);
|
||||
}
|
||||
rpc_ctx->io_scope->renew ();
|
||||
|
|
|
@ -648,7 +648,7 @@ TEST (confirmation_height, long_chains)
|
|||
|
||||
// First open the other account
|
||||
nano::send_block send (latest, key1.pub, nano::genesis_amount - nano::Gxrb_ratio + num_blocks + 1, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *system.work.generate (latest));
|
||||
nano::open_block open (send.hash (), nano::genesis_account, key1.pub, key1.prv, key1.pub, *system.work.generate (key1.pub));
|
||||
nano::open_block open (send.hash (), nano::dev::genesis->account (), key1.pub, key1.prv, key1.pub, *system.work.generate (key1.pub));
|
||||
{
|
||||
auto transaction = node->store.tx_begin_write ();
|
||||
ASSERT_EQ (nano::process_result::progress, node->ledger.process (transaction, send).code);
|
||||
|
@ -674,11 +674,11 @@ TEST (confirmation_height, long_chains)
|
|||
|
||||
// Send one from destination to genesis and pocket it
|
||||
nano::send_block send1 (previous_destination_chain_hash, nano::dev_genesis_key.pub, nano::Gxrb_ratio - 2, key1.prv, key1.pub, *system.work.generate (previous_destination_chain_hash));
|
||||
auto receive1 (std::make_shared<nano::state_block> (nano::dev_genesis_key.pub, previous_genesis_chain_hash, nano::genesis_account, nano::genesis_amount - nano::Gxrb_ratio + 1, send1.hash (), nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *system.work.generate (previous_genesis_chain_hash)));
|
||||
auto receive1 (std::make_shared<nano::state_block> (nano::dev_genesis_key.pub, previous_genesis_chain_hash, nano::dev::genesis->account (), nano::genesis_amount - nano::Gxrb_ratio + 1, send1.hash (), nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *system.work.generate (previous_genesis_chain_hash)));
|
||||
|
||||
// Unpocketed. Send to a non-existing account to prevent auto receives from the wallet adjusting expected confirmation height
|
||||
nano::keypair key2;
|
||||
nano::state_block send2 (nano::genesis_account, receive1->hash (), nano::genesis_account, nano::genesis_amount - nano::Gxrb_ratio, key2.pub, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *system.work.generate (receive1->hash ()));
|
||||
nano::state_block send2 (nano::dev::genesis->account (), receive1->hash (), nano::dev::genesis->account (), nano::genesis_amount - nano::Gxrb_ratio, key2.pub, nano::dev_genesis_key.prv, nano::dev_genesis_key.pub, *system.work.generate (receive1->hash ()));
|
||||
|
||||
{
|
||||
auto transaction = node->store.tx_begin_write ();
|
||||
|
|
|
@ -18,7 +18,6 @@ nano::ledger_constants dev_constants (nano::networks::nano_dev_network);
|
|||
nano::keypair const & nano::zero_key (dev_constants.zero_key);
|
||||
nano::keypair const & nano::dev_genesis_key (dev_constants.dev_genesis_key);
|
||||
nano::account const & nano::nano_dev_account (dev_constants.nano_dev_account);
|
||||
nano::account const & nano::genesis_account (dev_constants.genesis_account ());
|
||||
nano::uint128_t const & nano::genesis_amount (dev_constants.genesis_amount);
|
||||
nano::account const & nano::burn_account (dev_constants.burn_account);
|
||||
|
||||
|
|
|
@ -56,7 +56,6 @@ class system;
|
|||
extern nano::keypair const & zero_key;
|
||||
extern nano::keypair const & dev_genesis_key;
|
||||
extern nano::public_key const & nano_dev_account;
|
||||
extern nano::public_key const & genesis_account;
|
||||
extern nano::public_key const & burn_account;
|
||||
extern nano::uint128_t const & genesis_amount;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue