Directly use genesis_key.pub for obtaining the genesis account, rather than querying the genesis block.

This commit is contained in:
Colin LeMahieu 2024-03-06 15:03:43 +00:00
commit 5678e8ccb7
No known key found for this signature in database
GPG key ID: 43708520C8DFB938
14 changed files with 484 additions and 484 deletions

View file

@ -383,7 +383,7 @@ TEST (block_store, genesis)
auto transaction (store->tx_begin_write ());
store->initialize (transaction, ledger_cache, nano::dev::constants);
nano::account_info info;
ASSERT_FALSE (store->account.get (transaction, nano::dev::genesis->account (), info));
ASSERT_FALSE (store->account.get (transaction, nano::dev::genesis_key.pub, info));
ASSERT_EQ (nano::dev::genesis->hash (), info.head);
auto block1 (store->block.get (transaction, info.head));
ASSERT_NE (nullptr, block1);
@ -393,13 +393,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::dev::genesis->account (), confirmation_height_info));
ASSERT_FALSE (store->confirmation_height.get (transaction, nano::dev::genesis_key.pub, confirmation_height_info));
ASSERT_EQ (confirmation_height_info.height, 1);
ASSERT_EQ (confirmation_height_info.frontier, nano::dev::genesis->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::dev::genesis->account (), nano::dev::genesis_key.pub);
ASSERT_EQ (nano::dev::genesis_key.pub, nano::dev::genesis_key.pub);
}
TEST (block_store, empty_accounts)

View file

@ -159,7 +159,7 @@ TEST (bulk_pull, ascending_two_account)
auto socket = std::make_shared<nano::transport::socket> (node, nano::transport::socket::endpoint_type_t::server);
auto connection = std::make_shared<nano::transport::tcp_server> (socket, system.nodes[0]);
auto req = std::make_unique<nano::bulk_pull> (nano::dev::network_params.network);
req->start = nano::dev::genesis->account ();
req->start = nano::dev::genesis_key.pub;
req->end.clear ();
req->header.flag_set (nano::message_header::bulk_pull_ascending_flag);
auto request = std::make_shared<nano::bulk_pull_server> (connection, std::move (req));
@ -2123,9 +2123,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::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));
auto send1 (system.wallet (0)->send_action (nano::dev::genesis_key.pub, key1.pub, 25));
auto send2 (system.wallet (0)->send_action (nano::dev::genesis_key.pub, key1.pub, 10));
auto send3 (system.wallet (0)->send_action (nano::dev::genesis_key.pub, key1.pub, 2));
ASSERT_TIMELY_EQ (5s, system.nodes[0]->balance (key1.pub), 25);
auto connection (std::make_shared<nano::transport::tcp_server> (std::make_shared<nano::transport::socket> (*system.nodes[0], nano::transport::socket::endpoint_type_t::server), system.nodes[0]));
@ -2143,7 +2143,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::dev::genesis->account (), block_data.second.get ()->source);
ASSERT_EQ (nano::dev::genesis_key.pub, block_data.second.get ()->source);
ASSERT_EQ (nullptr, request->get_next ().first.get ());
}
@ -2157,7 +2157,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::dev::genesis->account (), block_data.second.get ()->source);
ASSERT_EQ (nano::dev::genesis_key.pub, block_data.second.get ()->source);
block_data = request->get_next ();
ASSERT_EQ (nullptr, block_data.first.get ());
ASSERT_EQ (nullptr, block_data.second.get ());

View file

@ -133,7 +133,7 @@ TEST (confirmation_height, multiple_accounts)
auto open1 = builder
.open ()
.source (send1->hash ())
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.account (key1.pub)
.sign (key1.prv, key1.pub)
.work (*system.work.generate (key1.pub))
@ -141,7 +141,7 @@ TEST (confirmation_height, multiple_accounts)
auto open2 = builder
.open ()
.source (send2->hash ())
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.account (key2.pub)
.sign (key2.prv, key2.pub)
.work (*system.work.generate (key2.pub))
@ -149,7 +149,7 @@ TEST (confirmation_height, multiple_accounts)
auto open3 = builder
.open ()
.source (send3->hash ())
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.account (key3.pub)
.sign (key3.prv, key3.pub)
.work (*system.work.generate (key3.pub))
@ -320,9 +320,9 @@ TEST (confirmation_height, gap_bootstrap)
nano::block_builder builder;
auto send1 = builder
.state ()
.account (nano::dev::genesis->account ())
.account (nano::dev::genesis_key.pub)
.previous (nano::dev::genesis->hash ())
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio)
.link (destination.pub)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
@ -331,9 +331,9 @@ TEST (confirmation_height, gap_bootstrap)
node1.work_generate_blocking (*send1);
auto send2 = builder
.state ()
.account (nano::dev::genesis->account ())
.account (nano::dev::genesis_key.pub)
.previous (send1->hash ())
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::constants.genesis_amount - 2 * nano::Gxrb_ratio)
.link (destination.pub)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
@ -342,9 +342,9 @@ TEST (confirmation_height, gap_bootstrap)
node1.work_generate_blocking (*send2);
auto send3 = builder
.state ()
.account (nano::dev::genesis->account ())
.account (nano::dev::genesis_key.pub)
.previous (send2->hash ())
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::constants.genesis_amount - 3 * nano::Gxrb_ratio)
.link (destination.pub)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
@ -453,9 +453,9 @@ TEST (confirmation_height, gap_live)
nano::block_builder builder;
auto send1 = builder
.state ()
.account (nano::dev::genesis->account ())
.account (nano::dev::genesis_key.pub)
.previous (nano::dev::genesis->hash ())
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::constants.genesis_amount - 1)
.link (destination.pub)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
@ -464,9 +464,9 @@ TEST (confirmation_height, gap_live)
node->work_generate_blocking (*send1);
auto send2 = builder
.state ()
.account (nano::dev::genesis->account ())
.account (nano::dev::genesis_key.pub)
.previous (send1->hash ())
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::constants.genesis_amount - 2)
.link (destination.pub)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
@ -475,9 +475,9 @@ TEST (confirmation_height, gap_live)
node->work_generate_blocking (*send2);
auto send3 = builder
.state ()
.account (nano::dev::genesis->account ())
.account (nano::dev::genesis_key.pub)
.previous (send2->hash ())
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::constants.genesis_amount - 3)
.link (destination.pub)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
@ -593,7 +593,7 @@ TEST (confirmation_height, send_receive_between_2_accounts)
auto open1 = builder
.open ()
.source (send1->hash ())
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.account (key1.pub)
.sign (key1.prv, key1.pub)
.work (*system.work.generate (key1.pub))
@ -601,7 +601,7 @@ TEST (confirmation_height, send_receive_between_2_accounts)
auto send2 = builder
.send ()
.previous (open1->hash ())
.destination (nano::dev::genesis->account ())
.destination (nano::dev::genesis_key.pub)
.balance (1000)
.sign (key1.prv, key1.pub)
.work (*system.work.generate (open1->hash ()))
@ -609,7 +609,7 @@ TEST (confirmation_height, send_receive_between_2_accounts)
auto send3 = builder
.send ()
.previous (send2->hash ())
.destination (nano::dev::genesis->account ())
.destination (nano::dev::genesis_key.pub)
.balance (900)
.sign (key1.prv, key1.pub)
.work (*system.work.generate (send2->hash ()))
@ -617,7 +617,7 @@ TEST (confirmation_height, send_receive_between_2_accounts)
auto send4 = builder
.send ()
.previous (send3->hash ())
.destination (nano::dev::genesis->account ())
.destination (nano::dev::genesis_key.pub)
.balance (500)
.sign (key1.prv, key1.pub)
.work (*system.work.generate (send3->hash ()))
@ -1013,9 +1013,9 @@ TEST (confirmation_height, all_block_types)
.build ();
auto state_receive3 = builder
.state ()
.account (nano::dev::genesis->account ())
.account (nano::dev::genesis_key.pub)
.previous (send1->hash ())
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio * 2 + 1)
.link (state_send4->hash ())
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
@ -1292,7 +1292,7 @@ TEST (confirmation_heightDeathTest, modified_chain)
}
ASSERT_EQ (nano::block_status::progress, ledger.process (store->tx_begin_write (), send));
store->confirmation_height.put (store->tx_begin_write (), nano::dev::genesis->account (), { 1, nano::dev::genesis->hash () });
store->confirmation_height.put (store->tx_begin_write (), nano::dev::genesis_key.pub, { 1, nano::dev::genesis->hash () });
nano::confirmation_height_unbounded unbounded_processor (
ledger, write_database_queue, 10ms, logger, stopped, batch_write_size, [] (auto const &) {}, [] (auto const &) {}, [] () { return 0; });
@ -1381,7 +1381,7 @@ TEST (confirmation_heightDeathTest, modified_chain_account_removed)
// Reset conditions and test with the bounded processor
ASSERT_EQ (nano::block_status::progress, ledger.process (store->tx_begin_write (), open));
store->confirmation_height.put (store->tx_begin_write (), nano::dev::genesis->account (), { 1, nano::dev::genesis->hash () });
store->confirmation_height.put (store->tx_begin_write (), nano::dev::genesis_key.pub, { 1, nano::dev::genesis->hash () });
nano::confirmation_height_bounded bounded_processor (
ledger, write_database_queue, 10ms, logger, stopped, batch_write_size, [] (auto const &) {}, [] (auto const &) {}, [] () { return 0; });
@ -1663,7 +1663,7 @@ TEST (confirmation_height, cemented_gap_below_receive)
auto open = builder
.open ()
.source (send->hash ())
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.account (key1.pub)
.sign (key1.prv, key1.pub)
.work (*system.work.generate (key1.pub))
@ -1722,7 +1722,7 @@ TEST (confirmation_height, cemented_gap_below_receive)
auto open1 = builder
.open ()
.source (send3->hash ())
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.account (key2.pub)
.sign (key2.prv, key2.pub)
.work (*system.work.generate (key2.pub))
@ -1823,7 +1823,7 @@ TEST (confirmation_height, cemented_gap_below_no_cache)
auto open = builder
.open ()
.source (send->hash ())
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.account (key1.pub)
.sign (key1.prv, key1.pub)
.work (*system.work.generate (key1.pub))
@ -1882,7 +1882,7 @@ TEST (confirmation_height, cemented_gap_below_no_cache)
auto open1 = builder
.open ()
.source (send3->hash ())
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.account (key2.pub)
.sign (key2.prv, key2.pub)
.work (*system.work.generate (key2.pub))
@ -1910,7 +1910,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::dev::genesis->account (), nano::confirmation_height_info{ 3, send1->hash () });
node->store.confirmation_height.put (transaction, nano::dev::genesis_key.pub, nano::confirmation_height_info{ 3, send1->hash () });
node->store.confirmation_height.put (transaction, key1.pub, nano::confirmation_height_info{ 2, receive1->hash () });
}

File diff suppressed because it is too large Load diff

View file

@ -1567,7 +1567,7 @@ TEST (node, unconfirmed_send)
// firstly, send two units from node1 to node2 and expect that both nodes see the block as confirmed
// (node1 will start an election for it, vote on it and node2 gets synced up)
auto send1 = wallet1->send_action (nano::dev::genesis->account (), key2.pub, 2 * nano::Mxrb_ratio);
auto send1 = wallet1->send_action (nano::dev::genesis_key.pub, key2.pub, 2 * nano::Mxrb_ratio);
ASSERT_TIMELY (5s, node1.block_confirmed (send1->hash ()));
ASSERT_TIMELY (5s, node2.block_confirmed (send1->hash ()));
@ -1583,19 +1583,19 @@ TEST (node, unconfirmed_send)
.previous (recv1->hash ())
.representative (nano::dev::genesis_key.pub)
.balance (nano::Mxrb_ratio)
.link (nano::dev::genesis->account ())
.link (nano::dev::genesis_key.pub)
.sign (key2.prv, key2.pub)
.work (*system.work.generate (recv1->hash ()))
.build ();
ASSERT_EQ (nano::block_status::progress, node2.process (send2));
auto send3 = wallet2->send_action (key2.pub, nano::dev::genesis->account (), nano::Mxrb_ratio);
auto send3 = wallet2->send_action (key2.pub, nano::dev::genesis_key.pub, nano::Mxrb_ratio);
ASSERT_TIMELY (5s, node2.block_confirmed (send2->hash ()));
ASSERT_TIMELY (5s, node1.block_confirmed (send2->hash ()));
ASSERT_TIMELY (5s, node2.block_confirmed (send3->hash ()));
ASSERT_TIMELY (5s, node1.block_confirmed (send3->hash ()));
ASSERT_TIMELY_EQ (5s, node2.ledger.cache.cemented_count, 7);
ASSERT_TIMELY_EQ (5s, node1.balance (nano::dev::genesis->account ()), nano::dev::constants.genesis_amount);
ASSERT_TIMELY_EQ (5s, node1.balance (nano::dev::genesis_key.pub), nano::dev::constants.genesis_amount);
}
// Test that nodes can track nodes that have rep weight for priority broadcasting
@ -2567,9 +2567,9 @@ TEST (node, DISABLED_vote_by_hash_epoch_block_republish)
.work (*system.work.generate (nano::dev::genesis->hash ()))
.build ();
auto epoch1 = nano::state_block_builder ()
.account (nano::dev::genesis->account ())
.account (nano::dev::genesis_key.pub)
.previous (nano::dev::genesis->hash ())
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::constants.genesis_amount)
.link (node1.ledger.epoch_link (nano::epoch::epoch_1))
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)

View file

@ -31,7 +31,7 @@ TEST (system, system_genesis)
for (auto & i : system.nodes)
{
auto transaction (i->store.tx_begin_read ());
ASSERT_EQ (nano::dev::constants.genesis_amount, i->ledger.account_balance (transaction, nano::dev::genesis->account ()));
ASSERT_EQ (nano::dev::constants.genesis_amount, i->ledger.account_balance (transaction, nano::dev::genesis_key.pub));
}
}
@ -42,7 +42,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::dev::genesis->account (), stake_preserver.pub, nano::dev::constants.genesis_amount / 3 * 2, true));
auto send_block (system.wallet (0)->send_action (nano::dev::genesis_key.pub, stake_preserver.pub, nano::dev::constants.genesis_amount / 3 * 2, true));
auto info1 = node1.ledger.account_info (node1.store.tx_begin_read (), nano::dev::genesis_key.pub);
ASSERT_TRUE (info1);
std::vector<nano::account> accounts;
@ -55,7 +55,7 @@ TEST (system, DISABLED_generate_send_existing)
auto open_block = builder
.open ()
.source (send_block->hash ())
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.account (stake_preserver.pub)
.sign (stake_preserver.prv, stake_preserver.pub)
.work (0)
@ -63,7 +63,7 @@ TEST (system, DISABLED_generate_send_existing)
node1.work_generate_blocking (*open_block);
ASSERT_EQ (nano::block_status::progress, node1.ledger.process (transaction, open_block));
}
ASSERT_GT (node1.balance (stake_preserver.pub), node1.balance (nano::dev::genesis->account ()));
ASSERT_GT (node1.balance (stake_preserver.pub), node1.balance (nano::dev::genesis_key.pub));
auto info2 = node1.ledger.account_info (node1.store.tx_begin_read (), nano::dev::genesis_key.pub);
ASSERT_TRUE (info2);
ASSERT_NE (info1->head, info2->head);
@ -99,14 +99,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::dev::genesis->account (), stake_preserver.pub, nano::dev::constants.genesis_amount / 3 * 2, true));
auto send_block (system.wallet (0)->send_action (nano::dev::genesis_key.pub, stake_preserver.pub, nano::dev::constants.genesis_amount / 3 * 2, true));
{
auto transaction (node1.store.tx_begin_write ());
nano::block_builder builder;
auto open_block = builder
.open ()
.source (send_block->hash ())
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.account (stake_preserver.pub)
.sign (stake_preserver.prv, stake_preserver.pub)
.work (0)
@ -114,7 +114,7 @@ TEST (system, DISABLED_generate_send_new)
node1.work_generate_blocking (*open_block);
ASSERT_EQ (nano::block_status::progress, node1.ledger.process (transaction, open_block));
}
ASSERT_GT (node1.balance (stake_preserver.pub), node1.balance (nano::dev::genesis->account ()));
ASSERT_GT (node1.balance (stake_preserver.pub), node1.balance (nano::dev::genesis_key.pub));
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

View file

@ -17,7 +17,7 @@ TEST (wallet, no_special_keys_accounts)
ASSERT_FALSE (init);
auto transaction (env.tx_begin_write ());
nano::kdf kdf{ nano::dev::network_params.kdf_work };
nano::wallet_store wallet (init, kdf, transaction, env, nano::dev::genesis->account (), 1, "0");
nano::wallet_store wallet (init, kdf, transaction, env, nano::dev::genesis_key.pub, 1, "0");
ASSERT_FALSE (init);
nano::keypair key1;
ASSERT_FALSE (wallet.exists (transaction, key1.pub));
@ -38,7 +38,7 @@ TEST (wallet, no_key)
ASSERT_FALSE (init);
auto transaction (env.tx_begin_write ());
nano::kdf kdf{ nano::dev::network_params.kdf_work };
nano::wallet_store wallet (init, kdf, transaction, env, nano::dev::genesis->account (), 1, "0");
nano::wallet_store wallet (init, kdf, transaction, env, nano::dev::genesis_key.pub, 1, "0");
ASSERT_FALSE (init);
nano::keypair key1;
nano::raw_key prv1;
@ -53,7 +53,7 @@ TEST (wallet, fetch_locked)
ASSERT_FALSE (init);
auto transaction (env.tx_begin_write ());
nano::kdf kdf{ nano::dev::network_params.kdf_work };
nano::wallet_store wallet (init, kdf, transaction, env, nano::dev::genesis->account (), 1, "0");
nano::wallet_store wallet (init, kdf, transaction, env, nano::dev::genesis_key.pub, 1, "0");
ASSERT_TRUE (wallet.valid_password (transaction));
nano::keypair key1;
ASSERT_EQ (key1.pub, wallet.insert_adhoc (transaction, key1.prv));
@ -75,7 +75,7 @@ TEST (wallet, retrieval)
ASSERT_FALSE (init);
auto transaction (env.tx_begin_write ());
nano::kdf kdf{ nano::dev::network_params.kdf_work };
nano::wallet_store wallet (init, kdf, transaction, env, nano::dev::genesis->account (), 1, "0");
nano::wallet_store wallet (init, kdf, transaction, env, nano::dev::genesis_key.pub, 1, "0");
ASSERT_FALSE (init);
nano::keypair key1;
ASSERT_TRUE (wallet.valid_password (transaction));
@ -97,7 +97,7 @@ TEST (wallet, empty_iteration)
ASSERT_FALSE (init);
auto transaction (env.tx_begin_write ());
nano::kdf kdf{ nano::dev::network_params.kdf_work };
nano::wallet_store wallet (init, kdf, transaction, env, nano::dev::genesis->account (), 1, "0");
nano::wallet_store wallet (init, kdf, transaction, env, nano::dev::genesis_key.pub, 1, "0");
ASSERT_FALSE (init);
auto i (wallet.begin (transaction));
auto j (wallet.end ());
@ -111,7 +111,7 @@ TEST (wallet, one_item_iteration)
ASSERT_FALSE (init);
auto transaction (env.tx_begin_write ());
nano::kdf kdf{ nano::dev::network_params.kdf_work };
nano::wallet_store wallet (init, kdf, transaction, env, nano::dev::genesis->account (), 1, "0");
nano::wallet_store wallet (init, kdf, transaction, env, nano::dev::genesis_key.pub, 1, "0");
ASSERT_FALSE (init);
nano::keypair key1;
wallet.insert_adhoc (transaction, key1.prv);
@ -139,7 +139,7 @@ TEST (wallet, two_item_iteration)
nano::kdf kdf{ nano::dev::network_params.kdf_work };
{
auto transaction (env.tx_begin_write ());
nano::wallet_store wallet (init, kdf, transaction, env, nano::dev::genesis->account (), 1, "0");
nano::wallet_store wallet (init, kdf, transaction, env, nano::dev::genesis_key.pub, 1, "0");
ASSERT_FALSE (init);
wallet.insert_adhoc (transaction, key1.prv);
wallet.insert_adhoc (transaction, key2.prv);
@ -259,7 +259,7 @@ TEST (wallet, find_none)
ASSERT_FALSE (init);
auto transaction (env.tx_begin_write ());
nano::kdf kdf{ nano::dev::network_params.kdf_work };
nano::wallet_store wallet (init, kdf, transaction, env, nano::dev::genesis->account (), 1, "0");
nano::wallet_store wallet (init, kdf, transaction, env, nano::dev::genesis_key.pub, 1, "0");
ASSERT_FALSE (init);
nano::account account (1000);
ASSERT_EQ (wallet.end (), wallet.find (transaction, account));
@ -272,7 +272,7 @@ TEST (wallet, find_existing)
ASSERT_FALSE (init);
auto transaction (env.tx_begin_write ());
nano::kdf kdf{ nano::dev::network_params.kdf_work };
nano::wallet_store wallet (init, kdf, transaction, env, nano::dev::genesis->account (), 1, "0");
nano::wallet_store wallet (init, kdf, transaction, env, nano::dev::genesis_key.pub, 1, "0");
ASSERT_FALSE (init);
nano::keypair key1;
ASSERT_FALSE (wallet.exists (transaction, key1.pub));
@ -291,7 +291,7 @@ TEST (wallet, rekey)
ASSERT_FALSE (init);
auto transaction (env.tx_begin_write ());
nano::kdf kdf{ nano::dev::network_params.kdf_work };
nano::wallet_store wallet (init, kdf, transaction, env, nano::dev::genesis->account (), 1, "0");
nano::wallet_store wallet (init, kdf, transaction, env, nano::dev::genesis_key.pub, 1, "0");
ASSERT_FALSE (init);
nano::raw_key password;
wallet.password.value (password);
@ -363,7 +363,7 @@ TEST (wallet, hash_password)
ASSERT_FALSE (init);
auto transaction (env.tx_begin_write ());
nano::kdf kdf{ nano::dev::network_params.kdf_work };
nano::wallet_store wallet (init, kdf, transaction, env, nano::dev::genesis->account (), 1, "0");
nano::wallet_store wallet (init, kdf, transaction, env, nano::dev::genesis_key.pub, 1, "0");
ASSERT_FALSE (init);
nano::raw_key hash1;
wallet.derive_key (hash1, transaction, "");
@ -413,25 +413,25 @@ TEST (wallet, reopen_default_password)
ASSERT_FALSE (init);
nano::kdf kdf{ nano::dev::network_params.kdf_work };
{
nano::wallet_store wallet (init, kdf, transaction, env, nano::dev::genesis->account (), 1, "0");
nano::wallet_store wallet (init, kdf, transaction, env, nano::dev::genesis_key.pub, 1, "0");
ASSERT_FALSE (init);
ASSERT_TRUE (wallet.valid_password (transaction));
}
{
bool init;
nano::wallet_store wallet (init, kdf, transaction, env, nano::dev::genesis->account (), 1, "0");
nano::wallet_store wallet (init, kdf, transaction, env, nano::dev::genesis_key.pub, 1, "0");
ASSERT_FALSE (init);
ASSERT_TRUE (wallet.valid_password (transaction));
}
{
nano::wallet_store wallet (init, kdf, transaction, env, nano::dev::genesis->account (), 1, "0");
nano::wallet_store wallet (init, kdf, transaction, env, nano::dev::genesis_key.pub, 1, "0");
ASSERT_FALSE (init);
wallet.rekey (transaction, "");
ASSERT_TRUE (wallet.valid_password (transaction));
}
{
bool init;
nano::wallet_store wallet (init, kdf, transaction, env, nano::dev::genesis->account (), 1, "0");
nano::wallet_store wallet (init, kdf, transaction, env, nano::dev::genesis_key.pub, 1, "0");
ASSERT_FALSE (init);
ASSERT_FALSE (wallet.valid_password (transaction));
wallet.attempt_password (transaction, " ");
@ -448,10 +448,10 @@ TEST (wallet, representative)
ASSERT_FALSE (error);
auto transaction (env.tx_begin_write ());
nano::kdf kdf{ nano::dev::network_params.kdf_work };
nano::wallet_store wallet (error, kdf, transaction, env, nano::dev::genesis->account (), 1, "0");
nano::wallet_store wallet (error, kdf, transaction, env, nano::dev::genesis_key.pub, 1, "0");
ASSERT_FALSE (error);
ASSERT_FALSE (wallet.is_representative (transaction));
ASSERT_EQ (nano::dev::genesis->account (), wallet.representative (transaction));
ASSERT_EQ (nano::dev::genesis_key.pub, wallet.representative (transaction));
ASSERT_FALSE (wallet.is_representative (transaction));
nano::keypair key;
wallet.representative_set (transaction, key.pub);
@ -469,11 +469,11 @@ TEST (wallet, serialize_json_empty)
ASSERT_FALSE (error);
auto transaction (env.tx_begin_write ());
nano::kdf kdf{ nano::dev::network_params.kdf_work };
nano::wallet_store wallet1 (error, kdf, transaction, env, nano::dev::genesis->account (), 1, "0");
nano::wallet_store wallet1 (error, kdf, transaction, env, nano::dev::genesis_key.pub, 1, "0");
ASSERT_FALSE (error);
std::string serialized;
wallet1.serialize_json (transaction, serialized);
nano::wallet_store wallet2 (error, kdf, transaction, env, nano::dev::genesis->account (), 1, "1", serialized);
nano::wallet_store wallet2 (error, kdf, transaction, env, nano::dev::genesis_key.pub, 1, "1", serialized);
ASSERT_FALSE (error);
nano::raw_key password1;
nano::raw_key password2;
@ -494,13 +494,13 @@ TEST (wallet, serialize_json_one)
ASSERT_FALSE (error);
auto transaction (env.tx_begin_write ());
nano::kdf kdf{ nano::dev::network_params.kdf_work };
nano::wallet_store wallet1 (error, kdf, transaction, env, nano::dev::genesis->account (), 1, "0");
nano::wallet_store wallet1 (error, kdf, transaction, env, nano::dev::genesis_key.pub, 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, env, nano::dev::genesis->account (), 1, "1", serialized);
nano::wallet_store wallet2 (error, kdf, transaction, env, nano::dev::genesis_key.pub, 1, "1", serialized);
ASSERT_FALSE (error);
nano::raw_key password1;
nano::raw_key password2;
@ -523,14 +523,14 @@ TEST (wallet, serialize_json_password)
ASSERT_FALSE (error);
auto transaction (env.tx_begin_write ());
nano::kdf kdf{ nano::dev::network_params.kdf_work };
nano::wallet_store wallet1 (error, kdf, transaction, env, nano::dev::genesis->account (), 1, "0");
nano::wallet_store wallet1 (error, kdf, transaction, env, nano::dev::genesis_key.pub, 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, env, nano::dev::genesis->account (), 1, "1", serialized);
nano::wallet_store wallet2 (error, kdf, transaction, env, nano::dev::genesis_key.pub, 1, "1", serialized);
ASSERT_FALSE (error);
ASSERT_FALSE (wallet2.valid_password (transaction));
ASSERT_FALSE (wallet2.attempt_password (transaction, "password"));
@ -556,11 +556,11 @@ TEST (wallet_store, move)
ASSERT_FALSE (error);
auto transaction (env.tx_begin_write ());
nano::kdf kdf{ nano::dev::network_params.kdf_work };
nano::wallet_store wallet1 (error, kdf, transaction, env, nano::dev::genesis->account (), 1, "0");
nano::wallet_store wallet1 (error, kdf, transaction, env, nano::dev::genesis_key.pub, 1, "0");
ASSERT_FALSE (error);
nano::keypair key1;
wallet1.insert_adhoc (transaction, key1.prv);
nano::wallet_store wallet2 (error, kdf, transaction, env, nano::dev::genesis->account (), 1, "1");
nano::wallet_store wallet2 (error, kdf, transaction, env, nano::dev::genesis_key.pub, 1, "1");
ASSERT_FALSE (error);
nano::keypair key2;
wallet2.insert_adhoc (transaction, key2.prv);
@ -714,7 +714,7 @@ TEST (wallet, deterministic_keys)
ASSERT_FALSE (init);
auto transaction (env.tx_begin_write ());
nano::kdf kdf{ nano::dev::network_params.kdf_work };
nano::wallet_store wallet (init, kdf, transaction, env, nano::dev::genesis->account (), 1, "0");
nano::wallet_store wallet (init, kdf, transaction, env, nano::dev::genesis_key.pub, 1, "0");
auto key1 = wallet.deterministic_key (transaction, 0);
auto key2 = wallet.deterministic_key (transaction, 0);
ASSERT_EQ (key1, key2);
@ -757,7 +757,7 @@ TEST (wallet, reseed)
ASSERT_FALSE (init);
auto transaction (env.tx_begin_write ());
nano::kdf kdf{ nano::dev::network_params.kdf_work };
nano::wallet_store wallet (init, kdf, transaction, env, nano::dev::genesis->account (), 1, "0");
nano::wallet_store wallet (init, kdf, transaction, env, nano::dev::genesis_key.pub, 1, "0");
nano::raw_key seed1;
seed1 = 1;
nano::raw_key seed2;
@ -1155,11 +1155,11 @@ TEST (wallet, search_receivable)
wallet.insert_adhoc (nano::dev::genesis_key.prv);
nano::block_builder builder;
auto send = builder.state ()
.account (nano::dev::genesis->account ())
.account (nano::dev::genesis_key.pub)
.previous (nano::dev::genesis->hash ())
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::constants.genesis_amount - node.config.receive_minimum.number ())
.link (nano::dev::genesis->account ())
.link (nano::dev::genesis_key.pub)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (nano::dev::genesis->hash ()))
.build ();
@ -1172,7 +1172,7 @@ TEST (wallet, search_receivable)
ASSERT_TIMELY (5s, election = node.active.election (send->qualified_root ()));
// Erase the key so the confirmation does not trigger an automatic receive
wallet.store.erase (node.wallets.tx_begin_write (), nano::dev::genesis->account ());
wallet.store.erase (node.wallets.tx_begin_write (), nano::dev::genesis_key.pub);
// Now confirm the election
election->force_confirm ();
@ -1185,8 +1185,8 @@ TEST (wallet, search_receivable)
// Pending search should create the receive block
ASSERT_EQ (2, node.ledger.cache.block_count);
ASSERT_FALSE (wallet.search_receivable (wallet.wallets.tx_begin_read ()));
ASSERT_TIMELY_EQ (3s, node.balance (nano::dev::genesis->account ()), nano::dev::constants.genesis_amount);
auto receive_hash = node.ledger.latest (node.store.tx_begin_read (), nano::dev::genesis->account ());
ASSERT_TIMELY_EQ (3s, node.balance (nano::dev::genesis_key.pub), nano::dev::constants.genesis_amount);
auto receive_hash = node.ledger.latest (node.store.tx_begin_read (), nano::dev::genesis_key.pub);
auto receive = node.block (receive_hash);
ASSERT_NE (nullptr, receive);
ASSERT_EQ (receive->sideband ().height, 3);

View file

@ -205,11 +205,11 @@ TEST (wallets, search_receivable)
wallet->insert_adhoc (nano::dev::genesis_key.prv);
nano::block_builder builder;
auto send = builder.state ()
.account (nano::dev::genesis->account ())
.account (nano::dev::genesis_key.pub)
.previous (nano::dev::genesis->hash ())
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::constants.genesis_amount - node.config.receive_minimum.number ())
.link (nano::dev::genesis->account ())
.link (nano::dev::genesis_key.pub)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (nano::dev::genesis->hash ()))
.build ();
@ -229,7 +229,7 @@ TEST (wallets, search_receivable)
ASSERT_TIMELY (5s, election = node.active.election (send->qualified_root ()));
// Erase the key so the confirmation does not trigger an automatic receive
wallet->store.erase (node.wallets.tx_begin_write (), nano::dev::genesis->account ());
wallet->store.erase (node.wallets.tx_begin_write (), nano::dev::genesis_key.pub);
// Now confirm the election
election->force_confirm ();
@ -249,8 +249,8 @@ TEST (wallets, search_receivable)
{
node.wallets.search_receivable (wallet_id);
}
ASSERT_TIMELY_EQ (3s, node.balance (nano::dev::genesis->account ()), nano::dev::constants.genesis_amount);
auto receive_hash = node.ledger.latest (node.store.tx_begin_read (), nano::dev::genesis->account ());
ASSERT_TIMELY_EQ (3s, node.balance (nano::dev::genesis_key.pub), nano::dev::constants.genesis_amount);
auto receive_hash = node.ledger.latest (node.store.tx_begin_read (), nano::dev::genesis_key.pub);
auto receive = node.block (receive_hash);
ASSERT_NE (nullptr, receive);
ASSERT_EQ (receive->sideband ().height, 3);

View file

@ -653,7 +653,7 @@ int main (int argc, char * const * argv)
}
// Send from genesis account to different accounts and receive the funds
auto send_receive = std::make_shared<send_receive_impl> (ioc, wallet, nano::dev::genesis->account ().to_account (), destination_account->as_string, send_calls_remaining, primary_node_results);
auto send_receive = std::make_shared<send_receive_impl> (ioc, wallet, nano::dev::genesis_key.pub.to_account (), destination_account->as_string, send_calls_remaining, primary_node_results);
boost::asio::strand<boost::asio::io_context::executor_type> strand{ ioc.get_executor () };
boost::asio::post (strand,
[send_receive] () {

View file

@ -360,7 +360,7 @@ TEST (wallet, DISABLED_process_block)
nano_qt::eventloop_processor processor;
nano::test::system system (1);
nano::account account;
nano::block_hash latest (system.nodes[0]->latest (nano::dev::genesis->account ()));
nano::block_hash latest (system.nodes[0]->latest (nano::dev::genesis_key.pub));
system.wallet (0)->insert_adhoc (nano::keypair ().prv);
{
auto transaction (system.nodes[0]->wallets.tx_begin_read ());
@ -665,7 +665,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::dev::genesis->account ()));
nano::block_hash latest (system.nodes[0]->latest (nano::dev::genesis_key.pub));
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 ());
@ -916,7 +916,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::dev::genesis->account ()));
auto latest (system1.nodes[0]->ledger.latest (transaction, nano::dev::genesis_key.pub));
auto send = std::make_shared<nano::send_block> (latest, key1, 0, nano::dev::genesis_key.prv, nano::dev::genesis_key.pub, *system1.work.generate (latest));
system1.nodes[0]->ledger.process (transaction, send);
}

View file

@ -197,7 +197,7 @@ TEST (rpc, receivable_offset_and_sorting)
// check confirmation height is as expected, there is no perfect clarity yet when confirmation height updates after a block get confirmed
nano::confirmation_height_info confirmation_height_info;
ASSERT_FALSE (node->store.confirmation_height.get (node->store.tx_begin_read (), nano::dev::genesis->account (), confirmation_height_info));
ASSERT_FALSE (node->store.confirmation_height.get (node->store.tx_begin_read (), nano::dev::genesis_key.pub, confirmation_height_info));
ASSERT_EQ (confirmation_height_info.height, 7);
ASSERT_EQ (confirmation_height_info.frontier, block6->hash ());

View file

@ -505,7 +505,7 @@ TEST (rpc, wallet_representative)
request.put ("action", "wallet_representative");
auto response (wait_response (system, rpc_ctx, request));
std::string account_text1 (response.get<std::string> ("representative"));
ASSERT_EQ (account_text1, nano::dev::genesis->account ().to_account ());
ASSERT_EQ (account_text1, nano::dev::genesis_key.pub.to_account ());
}
TEST (rpc, wallet_representative_set)
@ -663,7 +663,7 @@ TEST (rpc, wallet_export)
bool error (false);
auto transaction (node->wallets.tx_begin_write ());
nano::kdf kdf{ nano::dev::network_params.kdf_work };
nano::wallet_store store (error, kdf, transaction, node->wallets.env, nano::dev::genesis->account (), 1, "0", wallet_json);
nano::wallet_store store (error, kdf, transaction, node->wallets.env, nano::dev::genesis_key.pub, 1, "0", wallet_json);
ASSERT_FALSE (error);
ASSERT_TRUE (store.exists (transaction, nano::dev::genesis_key.pub));
}
@ -718,7 +718,7 @@ TEST (rpc, block)
auto const rpc_ctx = add_rpc (system, node);
boost::property_tree::ptree request;
request.put ("action", "block");
request.put ("hash", node->latest (nano::dev::genesis->account ()).to_string ());
request.put ("hash", node->latest (nano::dev::genesis_key.pub).to_string ());
auto response (wait_response (system, rpc_ctx, request));
auto contents (response.get<std::string> ("contents"));
ASSERT_FALSE (contents.empty ());
@ -928,19 +928,19 @@ TEST (rpc, history)
nano::block_builder builder;
auto usend = builder
.state ()
.account (nano::dev::genesis->account ())
.previous (node0->latest (nano::dev::genesis->account ()))
.representative (nano::dev::genesis->account ())
.account (nano::dev::genesis_key.pub)
.previous (node0->latest (nano::dev::genesis_key.pub))
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio)
.link (nano::dev::genesis->account ())
.link (nano::dev::genesis_key.pub)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*node0->work_generate_blocking (node0->latest (nano::dev::genesis->account ())))
.work (*node0->work_generate_blocking (node0->latest (nano::dev::genesis_key.pub)))
.build ();
auto ureceive = builder
.state ()
.account (nano::dev::genesis->account ())
.account (nano::dev::genesis_key.pub)
.previous (usend->hash ())
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::constants.genesis_amount)
.link (usend->hash ())
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
@ -948,7 +948,7 @@ TEST (rpc, history)
.build ();
auto uchange = builder
.state ()
.account (nano::dev::genesis->account ())
.account (nano::dev::genesis_key.pub)
.previous (ureceive->hash ())
.representative (nano::keypair ().pub)
.balance (nano::dev::constants.genesis_amount)
@ -1012,19 +1012,19 @@ TEST (rpc, account_history)
nano::block_builder builder;
auto usend = builder
.state ()
.account (nano::dev::genesis->account ())
.previous (node0->latest (nano::dev::genesis->account ()))
.representative (nano::dev::genesis->account ())
.account (nano::dev::genesis_key.pub)
.previous (node0->latest (nano::dev::genesis_key.pub))
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio)
.link (nano::dev::genesis->account ())
.link (nano::dev::genesis_key.pub)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*node0->work_generate_blocking (node0->latest (nano::dev::genesis->account ())))
.work (*node0->work_generate_blocking (node0->latest (nano::dev::genesis_key.pub)))
.build ();
auto ureceive = builder
.state ()
.account (nano::dev::genesis->account ())
.account (nano::dev::genesis_key.pub)
.previous (usend->hash ())
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::constants.genesis_amount)
.link (usend->hash ())
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
@ -1032,7 +1032,7 @@ TEST (rpc, account_history)
.build ();
auto uchange = builder
.state ()
.account (nano::dev::genesis->account ())
.account (nano::dev::genesis_key.pub)
.previous (ureceive->hash ())
.representative (nano::keypair ().pub)
.balance (nano::dev::constants.genesis_amount)
@ -1050,7 +1050,7 @@ TEST (rpc, account_history)
{
boost::property_tree::ptree request;
request.put ("action", "account_history");
request.put ("account", nano::dev::genesis->account ().to_account ());
request.put ("account", nano::dev::genesis_key.pub.to_account ());
request.put ("count", 100);
auto response (wait_response (system, rpc_ctx, request, 10s));
std::vector<std::tuple<std::string, std::string, std::string, std::string, std::string, bool>> history_l;
@ -1096,7 +1096,7 @@ TEST (rpc, account_history)
{
boost::property_tree::ptree request;
request.put ("action", "account_history");
request.put ("account", nano::dev::genesis->account ().to_account ());
request.put ("account", nano::dev::genesis_key.pub.to_account ());
request.put ("reverse", true);
request.put ("count", 1);
auto response (wait_response (system, rpc_ctx, request, 10s));
@ -1211,11 +1211,11 @@ TEST (rpc, history_pruning)
// non legacy self send
auto usend = builder
.state ()
.account (nano::dev::genesis->account ())
.account (nano::dev::genesis_key.pub)
.previous (receive->hash ())
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio)
.link (nano::dev::genesis->account ())
.link (nano::dev::genesis_key.pub)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*node0->work_generate_blocking (receive->hash ()))
.build ();
@ -1224,9 +1224,9 @@ TEST (rpc, history_pruning)
// non legacy receive of the non legacy self send
auto ureceive = builder
.state ()
.account (nano::dev::genesis->account ())
.account (nano::dev::genesis_key.pub)
.previous (usend->hash ())
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::constants.genesis_amount)
.link (usend->hash ())
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
@ -1237,7 +1237,7 @@ TEST (rpc, history_pruning)
// change genesis to a random rep
auto uchange = builder
.state ()
.account (nano::dev::genesis->account ())
.account (nano::dev::genesis_key.pub)
.previous (ureceive->hash ())
.representative (nano::keypair ().pub)
.balance (nano::dev::constants.genesis_amount)
@ -1514,9 +1514,9 @@ TEST (rpc, process_subtype_send)
nano::block_builder builder;
auto send = builder
.state ()
.account (nano::dev::genesis->account ())
.account (nano::dev::genesis_key.pub)
.previous (latest)
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio)
.link (key.pub)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
@ -1550,9 +1550,9 @@ TEST (rpc, process_subtype_open)
nano::block_builder builder;
auto send = builder
.state ()
.account (nano::dev::genesis->account ())
.account (nano::dev::genesis_key.pub)
.previous (latest)
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio)
.link (key.pub)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
@ -1599,9 +1599,9 @@ TEST (rpc, process_subtype_receive)
nano::block_builder builder;
auto send = builder
.state ()
.account (nano::dev::genesis->account ())
.account (nano::dev::genesis_key.pub)
.previous (latest)
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio)
.link (nano::dev::genesis_key.pub)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
@ -1652,9 +1652,9 @@ TEST (rpc, process_ledger_insufficient_work)
nano::block_builder builder;
auto send = builder
.state ()
.account (nano::dev::genesis->account ())
.account (nano::dev::genesis_key.pub)
.previous (latest)
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio)
.link (nano::dev::genesis_key.pub)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
@ -2377,11 +2377,11 @@ TEST (rpc, account_representative)
auto node = add_ipc_enabled_node (system);
auto const rpc_ctx = add_rpc (system, node);
boost::property_tree::ptree request;
request.put ("account", nano::dev::genesis->account ().to_account ());
request.put ("account", nano::dev::genesis_key.pub.to_account ());
request.put ("action", "account_representative");
auto response (wait_response (system, rpc_ctx, request));
std::string account_text1 (response.get<std::string> ("representative"));
ASSERT_EQ (account_text1, nano::dev::genesis->account ().to_account ());
ASSERT_EQ (account_text1, nano::dev::genesis_key.pub.to_account ());
}
TEST (rpc, account_representative_set)
@ -2429,7 +2429,7 @@ TEST (rpc, account_representative_set_work_disabled)
auto const rpc_ctx = add_rpc (system, node);
boost::property_tree::ptree request;
nano::keypair rep;
request.put ("account", nano::dev::genesis->account ().to_account ());
request.put ("account", nano::dev::genesis_key.pub.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");
@ -2491,7 +2491,7 @@ TEST (rpc, bootstrap)
auto send = builder
.send ()
.previous (latest)
.destination (nano::dev::genesis->account ())
.destination (nano::dev::genesis_key.pub)
.balance (100)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*node1->work_generate_blocking (latest))
@ -2511,7 +2511,7 @@ TEST (rpc, bootstrap)
system0.poll ();
}
system1.deadline_set (10s);
while (node->latest (nano::dev::genesis->account ()) != node1->latest (nano::dev::genesis->account ()))
while (node->latest (nano::dev::genesis_key.pub) != node1->latest (nano::dev::genesis_key.pub))
{
ASSERT_NO_ERROR (system0.poll ());
ASSERT_NO_ERROR (system1.poll ());
@ -2550,7 +2550,7 @@ TEST (rpc, representatives)
representatives.push_back (account);
}
ASSERT_EQ (1, representatives.size ());
ASSERT_EQ (nano::dev::genesis->account (), representatives[0]);
ASSERT_EQ (nano::dev::genesis_key.pub, representatives[0]);
}
// wallet_seed is only available over IPC's unsafe encoding, and when running on test network
@ -2626,7 +2626,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::dev::genesis->account ()), frontiers[0]);
ASSERT_EQ (node->latest (nano::dev::genesis_key.pub), frontiers[0]);
}
TEST (rpc, work_validate)
@ -2776,7 +2776,7 @@ TEST (rpc, bootstrap_any)
auto send = builder
.send ()
.previous (latest)
.destination (nano::dev::genesis->account ())
.destination (nano::dev::genesis_key.pub)
.balance (100)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system1.nodes[0]->work_generate_blocking (latest))
@ -3051,8 +3051,8 @@ TEST (rpc, accounts_representatives)
request.add_child ("accounts", accounts);
auto response (wait_response (system, rpc_ctx, request));
// Ensures the response is correct.
auto response_representative (response.get_child ("representatives").get<std::string> (nano::dev::genesis->account ().to_account ()));
ASSERT_EQ (response_representative, nano::dev::genesis->account ().to_account ());
auto response_representative (response.get_child ("representatives").get<std::string> (nano::dev::genesis_key.pub.to_account ()));
ASSERT_EQ (response_representative, nano::dev::genesis_key.pub.to_account ());
ASSERT_EQ (response.count ("errors"), 0);
}
@ -3093,7 +3093,7 @@ TEST (rpc, accounts_representatives_with_errors)
ASSERT_EQ (response.get_child ("representatives").size (), 1);
ASSERT_EQ (response.get_child ("representatives").count (nano::dev::genesis_key.pub.to_account ()), 1);
auto rep_text = response.get_child ("representatives").get<std::string> (nano::dev::genesis_key.pub.to_account ());
ASSERT_EQ (rep_text, nano::dev::genesis->account ().to_account ());
ASSERT_EQ (rep_text, nano::dev::genesis_key.pub.to_account ());
ASSERT_EQ (response.count ("errors"), 1);
ASSERT_EQ (response.get_child ("errors").size (), 2);
@ -3126,7 +3126,7 @@ TEST (rpc, accounts_frontiers)
ASSERT_EQ (response.get_child ("frontiers").size (), 1);
ASSERT_EQ (response.get_child ("frontiers").count (nano::dev::genesis_key.pub.to_account ()), 1);
auto frontier_text = response.get_child ("frontiers").get<std::string> (nano::dev::genesis_key.pub.to_account ());
ASSERT_EQ (nano::block_hash{ frontier_text }, node->latest (nano::dev::genesis->account ()));
ASSERT_EQ (nano::block_hash{ frontier_text }, node->latest (nano::dev::genesis_key.pub));
ASSERT_EQ (response.count ("errors"), 0);
}
@ -3166,7 +3166,7 @@ TEST (rpc, accounts_frontiers_with_errors)
ASSERT_EQ (response.get_child ("frontiers").size (), 1);
ASSERT_EQ (response.get_child ("frontiers").count (nano::dev::genesis_key.pub.to_account ()), 1);
auto frontier_text = response.get_child ("frontiers").get<std::string> (nano::dev::genesis_key.pub.to_account ());
ASSERT_EQ (nano::block_hash{ frontier_text }, node->latest (nano::dev::genesis->account ()));
ASSERT_EQ (nano::block_hash{ frontier_text }, node->latest (nano::dev::genesis_key.pub));
ASSERT_EQ (response.count ("errors"), 1);
ASSERT_EQ (response.get_child ("errors").size (), 2);
@ -3185,14 +3185,14 @@ TEST (rpc, blocks)
request.put ("action", "blocks");
boost::property_tree::ptree entry;
boost::property_tree::ptree peers_l;
entry.put ("", node->latest (nano::dev::genesis->account ()).to_string ());
entry.put ("", node->latest (nano::dev::genesis_key.pub).to_string ());
peers_l.push_back (std::make_pair ("", entry));
request.add_child ("hashes", peers_l);
auto response (wait_response (system, rpc_ctx, request));
for (auto & blocks : response.get_child ("blocks"))
{
std::string hash_text (blocks.first);
ASSERT_EQ (node->latest (nano::dev::genesis->account ()).to_string (), hash_text);
ASSERT_EQ (node->latest (nano::dev::genesis_key.pub).to_string (), hash_text);
std::string blocks_text (blocks.second.get<std::string> (""));
ASSERT_FALSE (blocks_text.empty ());
}
@ -3291,7 +3291,7 @@ TEST (rpc, pending_exists)
auto node = add_ipc_enabled_node (system, config);
nano::keypair key1;
system.wallet (0)->insert_adhoc (nano::dev::genesis_key.prv);
auto hash0 (node->latest (nano::dev::genesis->account ()));
auto hash0 (node->latest (nano::dev::genesis_key.pub));
auto block1 (system.wallet (0)->send_action (nano::dev::genesis_key.pub, key1.pub, 100));
ASSERT_TIMELY (5s, node->block_confirmed (block1->hash ()));
ASSERT_TIMELY (5s, !node->active.active (*block1));
@ -3467,7 +3467,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::dev::genesis->account (), work);
node->wallets.items.begin ()->second->store.work_get (transaction, nano::dev::genesis_key.pub, work);
ASSERT_EQ (nano::to_string_hex (work), work_text);
}
@ -3489,7 +3489,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::dev::genesis->account (), work);
node->wallets.items.begin ()->second->store.work_get (transaction, nano::dev::genesis_key.pub, work);
ASSERT_EQ (nano::to_string_hex (work), work_text);
}
}
@ -3511,7 +3511,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::dev::genesis->account (), work1);
node->wallets.items.begin ()->second->store.work_get (transaction, nano::dev::genesis_key.pub, work1);
ASSERT_EQ (work1, work0);
}
@ -3973,9 +3973,9 @@ TEST (rpc, json_block_input)
nano::block_builder builder;
auto send = builder
.state ()
.account (nano::dev::genesis->account ())
.account (nano::dev::genesis_key.pub)
.previous (node1->latest (nano::dev::genesis_key.pub))
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio)
.link (key.pub)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
@ -4042,7 +4042,7 @@ TEST (rpc, blocks_info)
for (auto & blocks : response.get_child ("blocks"))
{
std::string hash_text (blocks.first);
ASSERT_EQ (node->latest (nano::dev::genesis->account ()).to_string (), hash_text);
ASSERT_EQ (node->latest (nano::dev::genesis_key.pub).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"));
@ -4066,7 +4066,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::dev::genesis->account ()).to_string ());
entry.put ("", node->latest (nano::dev::genesis_key.pub).to_string ());
hashes.push_back (std::make_pair ("", entry));
request.add_child ("hashes", hashes);
{
@ -5719,9 +5719,9 @@ TEST (rpc, sign_hash)
nano::block_builder builder;
auto send = builder
.state ()
.account (nano::dev::genesis->account ())
.account (nano::dev::genesis_key.pub)
.previous (node1->latest (nano::dev::genesis_key.pub))
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio)
.link (key.pub)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
@ -5752,9 +5752,9 @@ TEST (rpc, sign_block)
nano::block_builder builder;
auto send = builder
.state ()
.account (nano::dev::genesis->account ())
.account (nano::dev::genesis_key.pub)
.previous (node1->latest (nano::dev::genesis_key.pub))
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio)
.link (key.pub)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
@ -5855,7 +5855,7 @@ TEST (rpc, block_confirmed)
auto open1 = builder
.open ()
.source (send1->hash ())
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.account (key.pub)
.sign (key.prv, key.pub)
.work (*system.work.generate (key.pub))

View file

@ -820,7 +820,7 @@ TEST (confirmation_height, long_chains)
auto open = builder
.open ()
.source (send->hash ())
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.account (key1.pub)
.sign (key1.prv, key1.pub)
.work (*system.work.generate (key1.pub))
@ -874,7 +874,7 @@ TEST (confirmation_height, long_chains)
.state ()
.account (nano::dev::genesis_key.pub)
.previous (previous_genesis_chain_hash)
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio + 1)
.link (send1->hash ())
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
@ -885,9 +885,9 @@ TEST (confirmation_height, long_chains)
nano::keypair key2;
auto send2 = builder
.state ()
.account (nano::dev::genesis->account ())
.account (nano::dev::genesis_key.pub)
.previous (receive1->hash ())
.representative (nano::dev::genesis->account ())
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio)
.link (key2.pub)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)

View file

@ -422,7 +422,7 @@ void nano::test::system::generate_receive (nano::node & node_a)
}
if (send_block != nullptr)
{
auto receive_error (wallet (0)->receive_sync (send_block, nano::dev::genesis->account (), std::numeric_limits<nano::uint128_t>::max ()));
auto receive_error (wallet (0)->receive_sync (send_block, nano::dev::genesis_key.pub, std::numeric_limits<nano::uint128_t>::max ()));
(void)receive_error;
}
}