Skip to content

Commit

Permalink
Moving nano::genesis_amount on to nano::ledger_constants
Browse files Browse the repository at this point in the history
  • Loading branch information
clemahieu committed Jul 25, 2021
1 parent e76f0c4 commit 8e7ac28
Show file tree
Hide file tree
Showing 29 changed files with 603 additions and 603 deletions.
70 changes: 35 additions & 35 deletions nano/core_test/active_transactions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ TEST (active_transactions, confirm_active)
auto send = nano::send_block_builder ()
.previous (nano::dev::genesis->hash ())
.destination (nano::public_key ())
.balance (nano::dev::genesis_amount - 100)
.balance (nano::dev::constants.genesis_amount - 100)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (nano::dev::genesis->hash ()))
.build_shared ();
Expand Down Expand Up @@ -48,7 +48,7 @@ TEST (active_transactions, confirm_active)
ASSERT_FALSE (peers.empty ());
{
nano::lock_guard<nano::mutex> guard (node2.rep_crawler.probable_reps_mutex);
node2.rep_crawler.probable_reps.emplace (nano::dev::genesis_key.pub, nano::dev::genesis_amount, *peers.begin ());
node2.rep_crawler.probable_reps.emplace (nano::dev::genesis_key.pub, nano::dev::constants.genesis_amount, *peers.begin ());
}
ASSERT_TIMELY (5s, election->votes ().size () != 1); // Votes were inserted (except for not_an_account)
auto confirm_req_count (election->confirmation_request_count.load ());
Expand Down Expand Up @@ -88,15 +88,15 @@ TEST (active_transactions, confirm_frontier)
ASSERT_FALSE (peers.empty ());
{
nano::lock_guard<nano::mutex> guard (node2.rep_crawler.probable_reps_mutex);
node2.rep_crawler.probable_reps.emplace (nano::dev::genesis_key.pub, nano::dev::genesis_amount, *peers.begin ());
node2.rep_crawler.probable_reps.emplace (nano::dev::genesis_key.pub, nano::dev::constants.genesis_amount, *peers.begin ());
}

nano::state_block_builder builder;
auto send = builder
.account (nano::dev::genesis_key.pub)
.previous (nano::dev::genesis->hash ())
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::genesis_amount - 100)
.balance (nano::dev::constants.genesis_amount - 100)
.link (nano::public_key ())
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (nano::dev::genesis->hash ()))
Expand Down Expand Up @@ -190,7 +190,7 @@ TEST (active_transactions, inactive_votes_cache)
auto send = nano::send_block_builder ()
.previous (latest)
.destination (key.pub)
.balance (nano::dev::genesis_amount - 100)
.balance (nano::dev::constants.genesis_amount - 100)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (latest))
.build_shared ();
Expand All @@ -212,7 +212,7 @@ TEST (active_transactions, inactive_votes_cache_non_final)
auto send = nano::send_block_builder ()
.previous (latest)
.destination (key.pub)
.balance (nano::dev::genesis_amount - 100)
.balance (nano::dev::constants.genesis_amount - 100)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (latest))
.build_shared ();
Expand All @@ -225,7 +225,7 @@ TEST (active_transactions, inactive_votes_cache_non_final)
auto election = node.active.election (send->qualified_root ());
ASSERT_NE (nullptr, election);
ASSERT_FALSE (election->confirmed ());
ASSERT_EQ (nano::dev::genesis_amount - 100, election->tally ().begin ()->first);
ASSERT_EQ (nano::dev::constants.genesis_amount - 100, election->tally ().begin ()->first);
}

TEST (active_transactions, inactive_votes_cache_fork)
Expand All @@ -238,14 +238,14 @@ TEST (active_transactions, inactive_votes_cache_fork)
auto send1 = builder.make_block ()
.previous (latest)
.destination (key.pub)
.balance (nano::dev::genesis_amount - 100)
.balance (nano::dev::constants.genesis_amount - 100)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (latest))
.build_shared ();
auto send2 = builder.make_block ()
.previous (latest)
.destination (key.pub)
.balance (nano::dev::genesis_amount - 200)
.balance (nano::dev::constants.genesis_amount - 200)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (latest))
.build_shared ();
Expand Down Expand Up @@ -282,7 +282,7 @@ TEST (active_transactions, inactive_votes_cache_existing_vote)
auto send = builder.send ()
.previous (latest)
.destination (key.pub)
.balance (nano::dev::genesis_amount - 100 * nano::Gxrb_ratio)
.balance (nano::dev::constants.genesis_amount - 100 * nano::Gxrb_ratio)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (latest))
.build_shared ();
Expand Down Expand Up @@ -339,7 +339,7 @@ TEST (active_transactions, inactive_votes_cache_multiple_votes)
auto send1 = builder.send ()
.previous (latest)
.destination (key1.pub)
.balance (nano::dev::genesis_amount - 100 * nano::Gxrb_ratio)
.balance (nano::dev::constants.genesis_amount - 100 * nano::Gxrb_ratio)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (latest))
.build_shared ();
Expand Down Expand Up @@ -391,14 +391,14 @@ TEST (active_transactions, inactive_votes_cache_election_start)
auto send1 = send_block_builder.make_block ()
.previous (latest)
.destination (key1.pub)
.balance (nano::dev::genesis_amount - 5000 * nano::Gxrb_ratio)
.balance (nano::dev::constants.genesis_amount - 5000 * nano::Gxrb_ratio)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (latest))
.build_shared ();
auto send2 = send_block_builder.make_block ()
.previous (send1->hash ())
.destination (key2.pub)
.balance (nano::dev::genesis_amount - 10000 * nano::Gxrb_ratio)
.balance (nano::dev::constants.genesis_amount - 10000 * nano::Gxrb_ratio)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (send1->hash ()))
.build_shared ();
Expand Down Expand Up @@ -495,7 +495,7 @@ TEST (active_transactions, vote_replays)
.account (nano::dev::genesis_key.pub)
.previous (nano::dev::genesis->hash ())
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::genesis_amount - nano::Gxrb_ratio)
.balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio)
.link (key.pub)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (nano::dev::genesis->hash ()))
Expand Down Expand Up @@ -644,7 +644,7 @@ TEST (active_transactions, republish_winner)
.account (nano::dev::genesis_key.pub)
.previous (nano::dev::genesis->hash ())
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::genesis_amount - nano::Gxrb_ratio)
.balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio)
.link (key.pub)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (nano::dev::genesis->hash ()))
Expand All @@ -661,7 +661,7 @@ TEST (active_transactions, republish_winner)
.account (nano::dev::genesis_key.pub)
.previous (nano::dev::genesis->hash ())
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::genesis_amount - 1 - i)
.balance (nano::dev::constants.genesis_amount - 1 - i)
.link (key.pub)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (nano::dev::genesis->hash ()))
Expand All @@ -677,7 +677,7 @@ TEST (active_transactions, republish_winner)
.account (nano::dev::genesis_key.pub)
.previous (nano::dev::genesis->hash ())
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::genesis_amount - 2 * nano::Gxrb_ratio)
.balance (nano::dev::constants.genesis_amount - 2 * nano::Gxrb_ratio)
.link (key.pub)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (nano::dev::genesis->hash ()))
Expand Down Expand Up @@ -709,7 +709,7 @@ TEST (active_transactions, fork_filter_cleanup)
.account (nano::dev::genesis_key.pub)
.previous (nano::dev::genesis->hash ())
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::genesis_amount - nano::Gxrb_ratio)
.balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio)
.link (key.pub)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (nano::dev::genesis->hash ()))
Expand All @@ -727,7 +727,7 @@ TEST (active_transactions, fork_filter_cleanup)
.account (nano::dev::genesis_key.pub)
.previous (nano::dev::genesis->hash ())
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::genesis_amount - 1 - i)
.balance (nano::dev::constants.genesis_amount - 1 - i)
.link (key.pub)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (nano::dev::genesis->hash ()))
Expand Down Expand Up @@ -765,7 +765,7 @@ TEST (active_transactions, fork_replacement_tally)
size_t const max_blocks = 10;
std::vector<nano::keypair> keys (reps_count);
auto latest (nano::dev::genesis->hash ());
auto balance (nano::dev::genesis_amount);
auto balance (nano::dev::constants.genesis_amount);
auto amount (node1.minimum_principal_weight ());
nano::state_block_builder builder;

Expand Down Expand Up @@ -934,7 +934,7 @@ TEST (active_transactions, confirm_new)
auto send = nano::send_block_builder ()
.previous (nano::dev::genesis->hash ())
.destination (nano::public_key ())
.balance (nano::dev::genesis_amount - 100)
.balance (nano::dev::constants.genesis_amount - 100)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (nano::dev::genesis->hash ()))
.build_shared ();
Expand Down Expand Up @@ -964,7 +964,7 @@ TEST (active_transactions, conflicting_block_vote_existing_election)
.account (nano::dev::genesis_key.pub)
.previous (nano::dev::genesis->hash ())
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::genesis_amount - 100)
.balance (nano::dev::constants.genesis_amount - 100)
.link (key.pub)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (nano::dev::genesis->hash ()))
Expand All @@ -973,7 +973,7 @@ TEST (active_transactions, conflicting_block_vote_existing_election)
.account (nano::dev::genesis_key.pub)
.previous (nano::dev::genesis->hash ())
.representative (nano::dev::genesis_key.pub)
.balance (nano::dev::genesis_amount - 200)
.balance (nano::dev::constants.genesis_amount - 200)
.link (key.pub)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (nano::dev::genesis->hash ()))
Expand Down Expand Up @@ -1011,7 +1011,7 @@ TEST (active_transactions, activate_account_chain)
.previous (nano::dev::genesis->hash ())
.representative (nano::dev::genesis_key.pub)
.link (nano::dev::genesis_key.pub)
.balance (nano::dev::genesis_amount - 1)
.balance (nano::dev::constants.genesis_amount - 1)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (nano::dev::genesis->hash ()))
.build ();
Expand All @@ -1020,7 +1020,7 @@ TEST (active_transactions, activate_account_chain)
.previous (send->hash ())
.representative (nano::dev::genesis_key.pub)
.link (key.pub)
.balance (nano::dev::genesis_amount - 2)
.balance (nano::dev::constants.genesis_amount - 2)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (send->hash ()))
.build ();
Expand All @@ -1029,7 +1029,7 @@ TEST (active_transactions, activate_account_chain)
.previous (send2->hash ())
.representative (nano::dev::genesis_key.pub)
.link (key.pub)
.balance (nano::dev::genesis_amount - 3)
.balance (nano::dev::constants.genesis_amount - 3)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (send2->hash ()))
.build ();
Expand Down Expand Up @@ -1111,7 +1111,7 @@ TEST (active_transactions, activate_inactive)
.previous (nano::dev::genesis->hash ())
.representative (nano::dev::genesis_key.pub)
.link (key.pub)
.balance (nano::dev::genesis_amount - 1)
.balance (nano::dev::constants.genesis_amount - 1)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (nano::dev::genesis->hash ()))
.build_shared ();
Expand All @@ -1120,7 +1120,7 @@ TEST (active_transactions, activate_inactive)
.previous (send->hash ())
.representative (nano::dev::genesis_key.pub)
.link (nano::keypair ().pub)
.balance (nano::dev::genesis_amount - 2)
.balance (nano::dev::constants.genesis_amount - 2)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (send->hash ()))
.build_shared ();
Expand Down Expand Up @@ -1172,7 +1172,7 @@ TEST (active_transactions, pessimistic_elections)
.previous (nano::dev::genesis->hash ())
.representative (nano::dev::genesis_key.pub)
.link (nano::dev::genesis_key.pub)
.balance (nano::dev::genesis_amount - 1)
.balance (nano::dev::constants.genesis_amount - 1)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (nano::dev::genesis->hash ()))
.build_shared ();
Expand All @@ -1184,7 +1184,7 @@ TEST (active_transactions, pessimistic_elections)
.previous (send->hash ())
.representative (nano::dev::genesis_key.pub)
.link (key.pub)
.balance (nano::dev::genesis_amount - 2)
.balance (nano::dev::constants.genesis_amount - 2)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (send->hash ()))
.build ();
Expand Down Expand Up @@ -1311,7 +1311,7 @@ TEST (active_transactions, list_active)
.previous (nano::dev::genesis->hash ())
.representative (nano::dev::genesis_key.pub)
.link (nano::dev::genesis_key.pub)
.balance (nano::dev::genesis_amount - 1)
.balance (nano::dev::constants.genesis_amount - 1)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (nano::dev::genesis->hash ()))
.build_shared ();
Expand All @@ -1323,7 +1323,7 @@ TEST (active_transactions, list_active)
.previous (send->hash ())
.representative (nano::dev::genesis_key.pub)
.link (key.pub)
.balance (nano::dev::genesis_amount - 2)
.balance (nano::dev::constants.genesis_amount - 2)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (send->hash ()))
.build_shared ();
Expand Down Expand Up @@ -1366,7 +1366,7 @@ TEST (active_transactions, vacancy)
.previous (nano::dev::genesis->hash ())
.representative (nano::dev::genesis_key.pub)
.link (nano::dev::genesis_key.pub)
.balance (nano::dev::genesis_amount - nano::Gxrb_ratio)
.balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (nano::dev::genesis->hash ()))
.build_shared ();
Expand Down Expand Up @@ -1404,7 +1404,7 @@ TEST (active_transactions, fifo)
.previous (nano::dev::genesis->hash ())
.representative (nano::dev::genesis_key.pub)
.link (key0.pub)
.balance (nano::dev::genesis_amount - 1)
.balance (nano::dev::constants.genesis_amount - 1)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (nano::dev::genesis->hash ()))
.build_shared ();
Expand All @@ -1417,7 +1417,7 @@ TEST (active_transactions, fifo)
.previous (send0->hash ())
.representative (nano::dev::genesis_key.pub)
.link (key1.pub)
.balance (nano::dev::genesis_amount - 2)
.balance (nano::dev::constants.genesis_amount - 2)
.sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub)
.work (*system.work.generate (send0->hash ()))
.build_shared ();
Expand Down
Loading

0 comments on commit 8e7ac28

Please sign in to comment.