From 61111367871ebb1ae2b0d78bc821c03099ec6795 Mon Sep 17 00:00:00 2001 From: RickiNano <81099017+RickiNano@users.noreply.github.com> Date: Sun, 22 Sep 2024 18:55:21 +0200 Subject: [PATCH 01/12] Removed legacy xrb ratios --- nano/lib/numbers.hpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/nano/lib/numbers.hpp b/nano/lib/numbers.hpp index 2e1585a445..c637e1594b 100644 --- a/nano/lib/numbers.hpp +++ b/nano/lib/numbers.hpp @@ -14,10 +14,8 @@ using uint128_t = boost::multiprecision::uint128_t; using uint256_t = boost::multiprecision::uint256_t; using uint512_t = boost::multiprecision::uint512_t; // SI dividers -nano::uint128_t const Gxrb_ratio = nano::uint128_t ("1000000000000000000000000000000000"); // 10^33 -nano::uint128_t const Mxrb_ratio = nano::uint128_t ("1000000000000000000000000000000"); // 10^30 -nano::uint128_t const kxrb_ratio = nano::uint128_t ("1000000000000000000000000000"); // 10^27 -nano::uint128_t const xrb_ratio = nano::uint128_t ("1000000000000000000000000"); // 10^24 +nano::uint128_t const Knano_ratio = nano::uint128_t ("1000000000000000000000000000000000"); // 10^33 = 1000 nano +nano::uint128_t const nano_ratio = nano::uint128_t ("1000000000000000000000000000000"); // 10^30 = 1 nano nano::uint128_t const raw_ratio = nano::uint128_t ("1"); // 10^0 class uint128_union From 680a6d9f7561ed556db247f1a0e2f06e422cc6dd Mon Sep 17 00:00:00 2001 From: RickiNano <81099017+RickiNano@users.noreply.github.com> Date: Sun, 22 Sep 2024 18:56:20 +0200 Subject: [PATCH 02/12] Adjust references to old ratios --- nano/nano_node/entry.cpp | 20 ++++++++++---------- nano/node/json_handler.cpp | 4 ++-- nano/node/json_handler.hpp | 4 ++-- nano/node/monitor.cpp | 6 +++--- nano/node/node.cpp | 4 ++-- nano/node/nodeconfig.hpp | 8 ++++---- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/nano/nano_node/entry.cpp b/nano/nano_node/entry.cpp index 846ca43995..ae49f157a8 100644 --- a/nano/nano_node/entry.cpp +++ b/nano/nano_node/entry.cpp @@ -246,7 +246,7 @@ int main (int argc, char * const * argv) std::string get_entry () const { return boost::str (boost::format ("representative %1% hardcoded %2% ledger %3% mismatch %4%") - % rep.to_account () % hardcoded.format_balance (nano::Mxrb_ratio, 0, true) % ledger.format_balance (nano::Mxrb_ratio, 0, true) % diff.format_balance (nano::Mxrb_ratio, 0, true)); + % rep.to_account () % hardcoded.format_balance (nano::nano_ratio, 0, true) % ledger.format_balance (nano::nano_ratio, 0, true) % diff.format_balance (nano::nano_ratio, 0, true)); } }; @@ -275,13 +275,13 @@ int main (int argc, char * const * argv) nano::uint128_union const mismatch_stddev = nano::narrow_cast (boost::multiprecision::sqrt (mismatch_variance.number ())); - auto const outlier_threshold = std::max (nano::Gxrb_ratio, mismatch_mean.number () + 1 * mismatch_stddev.number ()); + auto const outlier_threshold = std::max (nano::Knano_ratio, mismatch_mean.number () + 1 * mismatch_stddev.number ()); decltype (mismatched) outliers; std::copy_if (mismatched.begin (), mismatched.end (), std::back_inserter (outliers), [outlier_threshold] (mismatched_t const & sample) { return sample.diff > outlier_threshold; }); - auto const newcomer_threshold = std::max (nano::Gxrb_ratio, mismatch_mean.number ()); + auto const newcomer_threshold = std::max (nano::Knano_ratio, mismatch_mean.number ()); std::vector> newcomers; std::copy_if (ledger.begin (), ledger.end (), std::back_inserter (newcomers), [&hardcoded] (auto const & rep) { return !hardcoded.count (rep.first) && rep.second; @@ -291,18 +291,18 @@ int main (int argc, char * const * argv) std::sort (newcomers.begin (), newcomers.end (), [] (auto const & left, auto const & right) { return left.second > right.second; }); auto newcomer_entry = [] (auto const & rep) { - return boost::str (boost::format ("representative %1% hardcoded --- ledger %2%") % rep.first.to_account () % nano::uint128_union (rep.second).format_balance (nano::Mxrb_ratio, 0, true)); + return boost::str (boost::format ("representative %1% hardcoded --- ledger %2%") % rep.first.to_account () % nano::uint128_union (rep.second).format_balance (nano::nano_ratio, 0, true)); }; std::cout << boost::str (boost::format ("hardcoded weight %1% Mnano at %2% blocks\nledger weight %3% Mnano at %4% blocks\nmismatched\n\tsamples %5%\n\ttotal %6% Mnano\n\tmean %7% Mnano\n\tsigma %8% Mnano\n") - % total_hardcoded.format_balance (nano::Mxrb_ratio, 0, true) + % total_hardcoded.format_balance (nano::nano_ratio, 0, true) % hardcoded_height - % total_ledger.format_balance (nano::Mxrb_ratio, 0, true) + % total_ledger.format_balance (nano::nano_ratio, 0, true) % ledger_height % mismatched.size () - % mismatch_total.format_balance (nano::Mxrb_ratio, 0, true) - % mismatch_mean.format_balance (nano::Mxrb_ratio, 0, true) - % mismatch_stddev.format_balance (nano::Mxrb_ratio, 0, true)); + % mismatch_total.format_balance (nano::nano_ratio, 0, true) + % mismatch_mean.format_balance (nano::nano_ratio, 0, true) + % mismatch_stddev.format_balance (nano::nano_ratio, 0, true)); if (!outliers.empty ()) { @@ -326,7 +326,7 @@ int main (int argc, char * const * argv) } // Log more data - auto const log_threshold = nano::Gxrb_ratio; + auto const log_threshold = nano::Knano_ratio; for (auto const & sample : mismatched) { if (sample.diff > log_threshold) diff --git a/nano/node/json_handler.cpp b/nano/node/json_handler.cpp index e426f5fc66..affea8b8e6 100644 --- a/nano/node/json_handler.cpp +++ b/nano/node/json_handler.cpp @@ -2936,7 +2936,7 @@ void nano::json_handler::nano_to_raw () auto amount (amount_impl ()); if (!ec) { - auto result (amount.number () * nano::Mxrb_ratio); + auto result (amount.number () * nano::nano_ratio); if (result > amount.number ()) { response_l.put ("amount", result.convert_to ()); @@ -2954,7 +2954,7 @@ void nano::json_handler::raw_to_nano () auto amount (amount_impl ()); if (!ec) { - auto result (amount.number () / nano::Mxrb_ratio); + auto result (amount.number () / nano::nano_ratio); response_l.put ("amount", result.convert_to ()); } response_errors (); diff --git a/nano/node/json_handler.hpp b/nano/node/json_handler.hpp index 6e96a5bc3f..c8ed6b6bd2 100644 --- a/nano/node/json_handler.hpp +++ b/nano/node/json_handler.hpp @@ -81,8 +81,8 @@ class json_handler : public std::enable_shared_from_this void key_create (); void key_expand (); void ledger (); - void mnano_to_raw (nano::uint128_t = nano::Mxrb_ratio); - void mnano_from_raw (nano::uint128_t = nano::Mxrb_ratio); + void mnano_to_raw (nano::uint128_t = nano::nano_ratio); + void mnano_from_raw (nano::uint128_t = nano::nano_ratio); void nano_to_raw (); void raw_to_nano (); void node_id (); diff --git a/nano/node/monitor.cpp b/nano/node/monitor.cpp index 82b24c244f..47b9f8905a 100644 --- a/nano/node/monitor.cpp +++ b/nano/node/monitor.cpp @@ -93,9 +93,9 @@ void nano::monitor::run_one () node.tcp_listener.connection_count (nano::transport::tcp_listener::connection_type::outbound)); logger.info (nano::log::type::monitor, "Quorum: {} (stake peered: {} | stake online: {})", - nano::uint128_union{ node.online_reps.delta () }.format_balance (Mxrb_ratio, 1, true), - nano::uint128_union{ node.rep_crawler.total_weight () }.format_balance (Mxrb_ratio, 1, true), - nano::uint128_union{ node.online_reps.online () }.format_balance (Mxrb_ratio, 1, true)); + nano::uint128_union{ node.online_reps.delta () }.format_balance (nano_ratio, 1, true), + nano::uint128_union{ node.rep_crawler.total_weight () }.format_balance (nano_ratio, 1, true), + nano::uint128_union{ node.online_reps.online () }.format_balance (nano_ratio, 1, true)); logger.info (nano::log::type::monitor, "Elections active: {} (priority: {} | hinted: {} | optimistic: {})", node.active.size (), diff --git a/nano/node/node.cpp b/nano/node/node.cpp index 182d1cd5ef..0f2e03ecbb 100644 --- a/nano/node/node.cpp +++ b/nano/node/node.cpp @@ -389,7 +389,7 @@ nano::node::node (std::shared_ptr io_ctx_a, std::filesy { logger.info (nano::log::type::node, "Using bootstrap rep weight: {} -> {}", rep.first.to_account (), - nano::uint128_union (rep.second).format_balance (Mxrb_ratio, 0, true)); + nano::uint128_union (rep.second).format_balance (nano_ratio, 0, true)); } logger.info (nano::log::type::node, "******************************************** ================= ********************************************"); @@ -1039,7 +1039,7 @@ int nano::node::price (nano::uint128_t const & balance_a, int amount_a) for (auto i (0); i < amount_a; ++i) { balance_l -= nano::Gxrb_ratio; - auto balance_scaled ((balance_l / nano::Mxrb_ratio).convert_to ()); + auto balance_scaled ((balance_l / nano::nano_ratio).convert_to ()); auto units (balance_scaled / 1000.0); auto unit_price (((free_cutoff - units) / free_cutoff) * price_max); result += std::min (std::max (0.0, unit_price), price_max); diff --git a/nano/node/nodeconfig.hpp b/nano/node/nodeconfig.hpp index 6f9ec2d802..98fd01266a 100644 --- a/nano/node/nodeconfig.hpp +++ b/nano/node/nodeconfig.hpp @@ -69,17 +69,17 @@ class node_config std::vector preconfigured_peers; std::vector preconfigured_representatives; unsigned bootstrap_fraction_numerator{ 1 }; - nano::amount receive_minimum{ nano::xrb_ratio }; - nano::amount vote_minimum{ nano::Gxrb_ratio }; + nano::amount receive_minimum{ nano::nano_ratio / 1000 / 1000 }; // 0.000001 nano + nano::amount vote_minimum{ nano::nano_ratio * 1000 }; nano::amount rep_crawler_weight_minimum{ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" }; std::chrono::milliseconds vote_generator_delay{ std::chrono::milliseconds (100) }; unsigned vote_generator_threshold{ 3 }; - nano::amount online_weight_minimum{ 60000 * nano::Gxrb_ratio }; + nano::amount online_weight_minimum{ 60000 * nano::Knano_ratio }; // 60 million nano /* * The minimum vote weight that a representative must have for its vote to be counted. * All representatives above this weight will be kept in memory! */ - nano::amount representative_vote_weight_minimum{ 10 * nano::Mxrb_ratio }; + nano::amount representative_vote_weight_minimum{ 10 * nano::nano_ratio }; unsigned password_fanout{ 1024 }; unsigned io_threads{ env_io_threads ().value_or (std::max (4u, nano::hardware_concurrency ())) }; unsigned network_threads{ std::max (4u, nano::hardware_concurrency ()) }; From 1e02e39c0a28723584478f834c51c5d84103a08f Mon Sep 17 00:00:00 2001 From: RickiNano <81099017+RickiNano@users.noreply.github.com> Date: Sun, 22 Sep 2024 18:57:13 +0200 Subject: [PATCH 03/12] Removed unused price function --- nano/node/node.cpp | 16 ---------------- nano/node/node.hpp | 1 - 2 files changed, 17 deletions(-) diff --git a/nano/node/node.cpp b/nano/node/node.cpp index 0f2e03ecbb..1fdc635c34 100644 --- a/nano/node/node.cpp +++ b/nano/node/node.cpp @@ -1031,22 +1031,6 @@ void nano::node::ongoing_ledger_pruning () }); } -int nano::node::price (nano::uint128_t const & balance_a, int amount_a) -{ - debug_assert (balance_a >= amount_a * nano::Gxrb_ratio); - auto balance_l (balance_a); - double result (0.0); - for (auto i (0); i < amount_a; ++i) - { - balance_l -= nano::Gxrb_ratio; - auto balance_scaled ((balance_l / nano::nano_ratio).convert_to ()); - auto units (balance_scaled / 1000.0); - auto unit_price (((free_cutoff - units) / free_cutoff) * price_max); - result += std::min (std::max (0.0, unit_price), price_max); - } - return static_cast (result * 100.0); -} - uint64_t nano::node::default_difficulty (nano::work_version const version_a) const { uint64_t result{ std::numeric_limits::max () }; diff --git a/nano/node/node.hpp b/nano/node/node.hpp index b31578a190..2909eff233 100644 --- a/nano/node/node.hpp +++ b/nano/node/node.hpp @@ -111,7 +111,6 @@ class node final : public std::enable_shared_from_this bool collect_ledger_pruning_targets (std::deque &, nano::account &, uint64_t const, uint64_t const, uint64_t const); void ledger_pruning (uint64_t const, bool); void ongoing_ledger_pruning (); - int price (nano::uint128_t const &, int); // The default difficulty updates to base only when the first epoch_2 block is processed uint64_t default_difficulty (nano::work_version const) const; uint64_t default_receive_difficulty (nano::work_version const) const; From 3b8c17380dcce61b919cb81c15b74d9d0111c75f Mon Sep 17 00:00:00 2001 From: RickiNano <81099017+RickiNano@users.noreply.github.com> Date: Sun, 22 Sep 2024 19:10:13 +0200 Subject: [PATCH 04/12] Removed legacy ratio converters --- nano/node/json_handler.cpp | 55 -------------------------------------- 1 file changed, 55 deletions(-) diff --git a/nano/node/json_handler.cpp b/nano/node/json_handler.cpp index affea8b8e6..3ea0c84673 100644 --- a/nano/node/json_handler.cpp +++ b/nano/node/json_handler.cpp @@ -108,30 +108,6 @@ void nano::json_handler::process_request (bool unsafe_a) request.put ("head", request.get ("hash")); account_history (); } - else if (action == "knano_from_raw" || action == "krai_from_raw") - { - mnano_from_raw (nano::kxrb_ratio); - } - else if (action == "knano_to_raw" || action == "krai_to_raw") - { - mnano_to_raw (nano::kxrb_ratio); - } - else if (action == "rai_from_raw") - { - mnano_from_raw (nano::xrb_ratio); - } - else if (action == "rai_to_raw") - { - mnano_to_raw (nano::xrb_ratio); - } - else if (action == "mnano_from_raw" || action == "mrai_from_raw") - { - mnano_from_raw (); - } - else if (action == "mnano_to_raw" || action == "mrai_to_raw") - { - mnano_to_raw (); - } else if (action == "nano_to_raw") { nano_to_raw (); @@ -2900,37 +2876,6 @@ void nano::json_handler::ledger () response_errors (); } -void nano::json_handler::mnano_from_raw (nano::uint128_t ratio) -{ - auto amount (amount_impl ()); - response_l.put ("deprecated", "1"); - if (!ec) - { - auto result (amount.number () / ratio); - response_l.put ("amount", result.convert_to ()); - } - response_errors (); -} - -void nano::json_handler::mnano_to_raw (nano::uint128_t ratio) -{ - auto amount (amount_impl ()); - response_l.put ("deprecated", "1"); - if (!ec) - { - auto result (amount.number () * ratio); - if (result > amount.number ()) - { - response_l.put ("amount", result.convert_to ()); - } - else - { - ec = nano::error_common::invalid_amount_big; - } - } - response_errors (); -} - void nano::json_handler::nano_to_raw () { auto amount (amount_impl ()); From cd88fb9969e4bf918c993ac23d97bc61204ffb3f Mon Sep 17 00:00:00 2001 From: RickiNano <81099017+RickiNano@users.noreply.github.com> Date: Sun, 22 Sep 2024 19:41:26 +0200 Subject: [PATCH 05/12] Fixed RPC unit test --- nano/rpc_test/rpc.cpp | 150 ++++++++++++++---------------------------- 1 file changed, 51 insertions(+), 99 deletions(-) diff --git a/nano/rpc_test/rpc.cpp b/nano/rpc_test/rpc.cpp index daecb52a9e..5539efc96b 100644 --- a/nano/rpc_test/rpc.cpp +++ b/nano/rpc_test/rpc.cpp @@ -941,7 +941,7 @@ TEST (rpc, history) .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) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .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_key.pub))) @@ -988,12 +988,12 @@ TEST (rpc, history) ASSERT_EQ ("receive", std::get<0> (history_l[0])); ASSERT_EQ (ureceive->hash ().to_string (), std::get<3> (history_l[0])); ASSERT_EQ (nano::dev::genesis_key.pub.to_account (), std::get<1> (history_l[0])); - ASSERT_EQ (nano::Gxrb_ratio.convert_to (), std::get<2> (history_l[0])); + ASSERT_EQ (nano::Knano_ratio.convert_to (), std::get<2> (history_l[0])); ASSERT_EQ (5, history_l.size ()); ASSERT_EQ ("send", std::get<0> (history_l[1])); ASSERT_EQ (usend->hash ().to_string (), std::get<3> (history_l[1])); ASSERT_EQ (nano::dev::genesis_key.pub.to_account (), std::get<1> (history_l[1])); - ASSERT_EQ (nano::Gxrb_ratio.convert_to (), std::get<2> (history_l[1])); + ASSERT_EQ (nano::Knano_ratio.convert_to (), std::get<2> (history_l[1])); ASSERT_EQ ("receive", std::get<0> (history_l[2])); ASSERT_EQ (nano::dev::genesis_key.pub.to_account (), std::get<1> (history_l[2])); ASSERT_EQ (node0->config.receive_minimum.to_string_dec (), std::get<2> (history_l[2])); @@ -1025,7 +1025,7 @@ TEST (rpc, account_history) .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) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .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_key.pub))) @@ -1074,13 +1074,13 @@ TEST (rpc, account_history) ASSERT_EQ ("receive", std::get<0> (history_l[0])); ASSERT_EQ (ureceive->hash ().to_string (), std::get<3> (history_l[0])); ASSERT_EQ (nano::dev::genesis_key.pub.to_account (), std::get<1> (history_l[0])); - ASSERT_EQ (nano::Gxrb_ratio.convert_to (), std::get<2> (history_l[0])); + ASSERT_EQ (nano::Knano_ratio.convert_to (), std::get<2> (history_l[0])); ASSERT_EQ ("6", std::get<4> (history_l[0])); // change block (height 7) is skipped by account_history since "raw" is not set ASSERT_FALSE (std::get<5> (history_l[0])); ASSERT_EQ ("send", std::get<0> (history_l[1])); ASSERT_EQ (usend->hash ().to_string (), std::get<3> (history_l[1])); ASSERT_EQ (nano::dev::genesis_key.pub.to_account (), std::get<1> (history_l[1])); - ASSERT_EQ (nano::Gxrb_ratio.convert_to (), std::get<2> (history_l[1])); + ASSERT_EQ (nano::Knano_ratio.convert_to (), std::get<2> (history_l[1])); ASSERT_EQ ("5", std::get<4> (history_l[1])); ASSERT_FALSE (std::get<5> (history_l[1])); ASSERT_EQ ("receive", std::get<0> (history_l[2])); @@ -1224,7 +1224,7 @@ TEST (rpc, history_pruning) .account (nano::dev::genesis_key.pub) .previous (receive->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node0->work_generate_blocking (receive->hash ())) @@ -1321,7 +1321,7 @@ TEST (rpc, history_pruning) ASSERT_EQ ("receive", entry.get ("type")); ASSERT_EQ (ureceive->hash ().to_string (), entry.get ("hash")); ASSERT_EQ (nano::dev::genesis_key.pub.to_account (), entry.get ("account", "N/A")); - ASSERT_EQ (nano::Gxrb_ratio.convert_to (), entry.get ("amount", "N/A")); + ASSERT_EQ (nano::Knano_ratio.convert_to (), entry.get ("amount", "N/A")); // second array element entry = (*(++history_node.begin ())).second; @@ -1543,7 +1543,7 @@ TEST (rpc, process_subtype_send) .account (nano::dev::genesis_key.pub) .previous (latest) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node1->work_generate_blocking (latest)) @@ -1579,7 +1579,7 @@ TEST (rpc, process_subtype_open) .account (nano::dev::genesis_key.pub) .previous (latest) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node1->work_generate_blocking (latest)) @@ -1593,7 +1593,7 @@ TEST (rpc, process_subtype_open) .account (key.pub) .previous (0) .representative (key.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send->hash ()) .sign (key.prv, key.pub) .work (*node1->work_generate_blocking (key.pub)) @@ -1628,7 +1628,7 @@ TEST (rpc, process_subtype_receive) .account (nano::dev::genesis_key.pub) .previous (latest) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node1->work_generate_blocking (latest)) @@ -1681,7 +1681,7 @@ TEST (rpc, process_ledger_insufficient_work) .account (nano::dev::genesis_key.pub) .previous (latest) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (system.work_generate_limited (latest, min_difficulty, max_difficulty)) @@ -1956,7 +1956,7 @@ TEST (rpc, work_generate_block_high) .account (key.pub) .previous (0) .representative (nano::dev::genesis_key.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (123) .sign (key.prv, key.pub) .work (*node->work_generate_blocking (key.pub)) @@ -1989,7 +1989,7 @@ TEST (rpc, work_generate_block_low) .account (key.pub) .previous (0) .representative (nano::dev::genesis_key.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (123) .sign (key.prv, key.pub) .work (0) @@ -2034,7 +2034,7 @@ TEST (rpc, work_generate_block_root_mismatch) .account (key.pub) .previous (0) .representative (nano::dev::genesis_key.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (123) .sign (key.prv, key.pub) .work (*node->work_generate_blocking (key.pub)) @@ -2064,7 +2064,7 @@ TEST (rpc, work_generate_block_ledger_epoch_2) ASSERT_NE (nullptr, epoch2); nano::keypair key; system.wallet (0)->insert_adhoc (nano::dev::genesis_key.prv); - auto send_block (system.wallet (0)->send_action (nano::dev::genesis_key.pub, key.pub, nano::Gxrb_ratio)); + auto send_block (system.wallet (0)->send_action (nano::dev::genesis_key.pub, key.pub, nano::Knano_ratio)); ASSERT_NE (nullptr, send_block); nano::block_builder builder; auto block = builder @@ -2072,7 +2072,7 @@ TEST (rpc, work_generate_block_ledger_epoch_2) .account (key.pub) .previous (0) .representative (nano::dev::genesis_key.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send_block->hash ()) .sign (key.prv, key.pub) .work (0) @@ -2278,7 +2278,7 @@ TEST (rpc, block_count_pruning) .send () .previous (latest) .destination (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node1->work_generate_blocking (latest)) .build (); @@ -2352,54 +2352,6 @@ TEST (rpc, available_supply) ASSERT_EQ ("1", response3.get ("available")); } -TEST (rpc, mrai_to_raw) -{ - nano::test::system system; - auto node1 = add_ipc_enabled_node (system); - auto const rpc_ctx = add_rpc (system, node1); - boost::property_tree::ptree request1; - request1.put ("action", "mrai_to_raw"); - request1.put ("amount", "1"); - auto response1 (wait_response (system, rpc_ctx, request1)); - ASSERT_EQ (nano::Mxrb_ratio.convert_to (), response1.get ("amount")); -} - -TEST (rpc, mrai_from_raw) -{ - nano::test::system system; - auto node1 = add_ipc_enabled_node (system); - auto const rpc_ctx = add_rpc (system, node1); - boost::property_tree::ptree request1; - request1.put ("action", "mrai_from_raw"); - request1.put ("amount", nano::Mxrb_ratio.convert_to ()); - auto response1 (wait_response (system, rpc_ctx, request1)); - ASSERT_EQ ("1", response1.get ("amount")); -} - -TEST (rpc, krai_to_raw) -{ - nano::test::system system; - auto node1 = add_ipc_enabled_node (system); - auto const rpc_ctx = add_rpc (system, node1); - boost::property_tree::ptree request1; - request1.put ("action", "krai_to_raw"); - request1.put ("amount", "1"); - auto response1 (wait_response (system, rpc_ctx, request1)); - ASSERT_EQ (nano::kxrb_ratio.convert_to (), response1.get ("amount")); -} - -TEST (rpc, krai_from_raw) -{ - nano::test::system system; - auto node1 = add_ipc_enabled_node (system); - auto const rpc_ctx = add_rpc (system, node1); - boost::property_tree::ptree request1; - request1.put ("action", "krai_from_raw"); - request1.put ("amount", nano::kxrb_ratio.convert_to ()); - auto response1 (wait_response (system, rpc_ctx, request1)); - ASSERT_EQ ("1", response1.get ("amount")); -} - TEST (rpc, nano_to_raw) { nano::test::system system; @@ -2409,7 +2361,7 @@ TEST (rpc, nano_to_raw) request1.put ("action", "nano_to_raw"); request1.put ("amount", "1"); auto response1 (wait_response (system, rpc_ctx, request1)); - ASSERT_EQ (nano::Mxrb_ratio.convert_to (), response1.get ("amount")); + ASSERT_EQ (nano::nano_ratio.convert_to (), response1.get ("amount")); } TEST (rpc, raw_to_nano) @@ -2419,7 +2371,7 @@ TEST (rpc, raw_to_nano) auto const rpc_ctx = add_rpc (system, node1); boost::property_tree::ptree request1; request1.put ("action", "raw_to_nano"); - request1.put ("amount", nano::Mxrb_ratio.convert_to ()); + request1.put ("amount", nano::nano_ratio.convert_to ()); auto response1 (wait_response (system, rpc_ctx, request1)); ASSERT_EQ ("1", response1.get ("amount")); } @@ -3257,7 +3209,7 @@ TEST (rpc, wallet_info) nano::keypair key; system.wallet (0)->insert_adhoc (key.prv); - auto send (system.wallet (0)->send_action (nano::dev::genesis_key.pub, key.pub, nano::Gxrb_ratio)); + auto send (system.wallet (0)->send_action (nano::dev::genesis_key.pub, key.pub, nano::Knano_ratio)); // after the send, expect 2 blocks immediately, then 2 confirmed in a timely manner, // and finally 3 blocks and 3 confirmed after the wallet generates the receive block for this send ASSERT_TIMELY (5s, node->block_confirmed (send->hash ())); // Send gets confirmed @@ -4021,7 +3973,7 @@ TEST (rpc, json_block_input) .account (nano::dev::genesis_key.pub) .previous (node1->latest (nano::dev::genesis_key.pub)) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (0) @@ -4235,9 +4187,9 @@ TEST (rpc, blocks_info_subtype) nano::keypair key; system.wallet (0)->insert_adhoc (nano::dev::genesis_key.prv); system.wallet (0)->insert_adhoc (key.prv); - auto send (system.wallet (0)->send_action (nano::dev::genesis_key.pub, nano::dev::genesis_key.pub, nano::Gxrb_ratio)); + auto send (system.wallet (0)->send_action (nano::dev::genesis_key.pub, nano::dev::genesis_key.pub, nano::Knano_ratio)); ASSERT_NE (nullptr, send); - auto receive (system.wallet (0)->receive_action (send->hash (), key.pub, nano::Gxrb_ratio, send->destination ())); + auto receive (system.wallet (0)->receive_action (send->hash (), key.pub, nano::Knano_ratio, send->destination ())); ASSERT_NE (nullptr, receive); auto change (system.wallet (0)->change_action (nano::dev::genesis_key.pub, key.pub)); ASSERT_NE (nullptr, change); @@ -4319,7 +4271,7 @@ TEST (rpc, block_info_pruning) .send () .previous (latest) .destination (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node1->work_generate_blocking (latest)) .build (); @@ -4385,7 +4337,7 @@ TEST (rpc, pruned_exists) .send () .previous (latest) .destination (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node1->work_generate_blocking (latest)) .build (); @@ -4762,7 +4714,7 @@ TEST (rpc, block_create_state) request.put ("account", nano::dev::genesis_key.pub.to_account ()); request.put ("previous", nano::dev::genesis->hash ().to_string ()); request.put ("representative", nano::dev::genesis_key.pub.to_account ()); - request.put ("balance", (nano::dev::constants.genesis_amount - nano::Gxrb_ratio).convert_to ()); + request.put ("balance", (nano::dev::constants.genesis_amount - nano::Knano_ratio).convert_to ()); request.put ("link", key.pub.to_account ()); request.put ("work", nano::to_string_hex (*node->work_generate_blocking (nano::dev::genesis->hash ()))); auto response (wait_response (system, rpc_ctx, request)); @@ -4785,7 +4737,7 @@ TEST (rpc, block_create_state_open) auto node = add_ipc_enabled_node (system); nano::keypair key; system.wallet (0)->insert_adhoc (nano::dev::genesis_key.prv); - auto send_block (system.wallet (0)->send_action (nano::dev::genesis_key.pub, key.pub, nano::Gxrb_ratio)); + auto send_block (system.wallet (0)->send_action (nano::dev::genesis_key.pub, key.pub, nano::Knano_ratio)); ASSERT_NE (nullptr, send_block); auto const rpc_ctx = add_rpc (system, node); boost::property_tree::ptree request; @@ -4795,7 +4747,7 @@ TEST (rpc, block_create_state_open) request.put ("account", key.pub.to_account ()); request.put ("previous", 0); request.put ("representative", nano::dev::genesis_key.pub.to_account ()); - request.put ("balance", nano::Gxrb_ratio.convert_to ()); + request.put ("balance", nano::Knano_ratio.convert_to ()); request.put ("link", send_block->hash ().to_string ()); request.put ("work", nano::to_string_hex (*node->work_generate_blocking (key.pub))); auto response (wait_response (system, rpc_ctx, request)); @@ -4844,7 +4796,7 @@ TEST (rpc, block_create_state_request_work) request.put ("wallet", node->wallets.items.begin ()->first.to_string ()); request.put ("account", nano::dev::genesis_key.pub.to_account ()); request.put ("representative", nano::dev::genesis_key.pub.to_account ()); - request.put ("balance", (nano::dev::constants.genesis_amount - nano::Gxrb_ratio).convert_to ()); + request.put ("balance", (nano::dev::constants.genesis_amount - nano::Knano_ratio).convert_to ()); request.put ("link", key.pub.to_account ()); request.put ("previous", previous); auto response (wait_response (system, rpc_ctx, request)); @@ -4865,7 +4817,7 @@ TEST (rpc, block_create_open_epoch_v2) system.wallet (0)->insert_adhoc (nano::dev::genesis_key.prv); ASSERT_NE (nullptr, system.upgrade_genesis_epoch (*node, nano::epoch::epoch_1)); ASSERT_NE (nullptr, system.upgrade_genesis_epoch (*node, nano::epoch::epoch_2)); - auto send_block (system.wallet (0)->send_action (nano::dev::genesis_key.pub, key.pub, nano::Gxrb_ratio)); + auto send_block (system.wallet (0)->send_action (nano::dev::genesis_key.pub, key.pub, nano::Knano_ratio)); ASSERT_NE (nullptr, send_block); auto const rpc_ctx = add_rpc (system, node); boost::property_tree::ptree request; @@ -4875,7 +4827,7 @@ TEST (rpc, block_create_open_epoch_v2) request.put ("account", key.pub.to_account ()); request.put ("previous", 0); request.put ("representative", nano::dev::genesis_key.pub.to_account ()); - request.put ("balance", nano::Gxrb_ratio.convert_to ()); + request.put ("balance", nano::Knano_ratio.convert_to ()); request.put ("link", send_block->hash ().to_string ()); auto response (wait_response (system, rpc_ctx, request)); std::string state_hash (response.get ("hash")); @@ -4904,7 +4856,7 @@ TEST (rpc, block_create_receive_epoch_v2) nano::keypair key; system.wallet (0)->insert_adhoc (nano::dev::genesis_key.prv); ASSERT_NE (nullptr, system.upgrade_genesis_epoch (*node, nano::epoch::epoch_1)); - auto send_block (system.wallet (0)->send_action (nano::dev::genesis_key.pub, key.pub, nano::Gxrb_ratio)); + auto send_block (system.wallet (0)->send_action (nano::dev::genesis_key.pub, key.pub, nano::Knano_ratio)); ASSERT_NE (nullptr, send_block); nano::block_builder builder; auto open = builder @@ -4912,14 +4864,14 @@ TEST (rpc, block_create_receive_epoch_v2) .account (key.pub) .previous (0) .representative (nano::dev::genesis_key.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send_block->hash ()) .sign (key.prv, key.pub) .work (*node->work_generate_blocking (key.pub)) .build (); ASSERT_EQ (nano::block_status::progress, node->process (open)); ASSERT_NE (nullptr, system.upgrade_genesis_epoch (*node, nano::epoch::epoch_2)); - auto send_block_2 (system.wallet (0)->send_action (nano::dev::genesis_key.pub, key.pub, nano::Gxrb_ratio)); + auto send_block_2 (system.wallet (0)->send_action (nano::dev::genesis_key.pub, key.pub, nano::Knano_ratio)); auto const rpc_ctx = add_rpc (system, node); boost::property_tree::ptree request; request.put ("action", "block_create"); @@ -4928,7 +4880,7 @@ TEST (rpc, block_create_receive_epoch_v2) request.put ("account", key.pub.to_account ()); request.put ("previous", open->hash ().to_string ()); request.put ("representative", nano::dev::genesis_key.pub.to_account ()); - request.put ("balance", (2 * nano::Gxrb_ratio).convert_to ()); + request.put ("balance", (2 * nano::Knano_ratio).convert_to ()); request.put ("link", send_block_2->hash ().to_string ()); auto response (wait_response (system, rpc_ctx, request)); std::string state_hash (response.get ("hash")); @@ -4957,7 +4909,7 @@ TEST (rpc, block_create_send_epoch_v2) system.wallet (0)->insert_adhoc (nano::dev::genesis_key.prv); ASSERT_NE (nullptr, system.upgrade_genesis_epoch (*node, nano::epoch::epoch_1)); ASSERT_NE (nullptr, system.upgrade_genesis_epoch (*node, nano::epoch::epoch_2)); - auto send_block (system.wallet (0)->send_action (nano::dev::genesis_key.pub, key.pub, nano::Gxrb_ratio)); + auto send_block (system.wallet (0)->send_action (nano::dev::genesis_key.pub, key.pub, nano::Knano_ratio)); ASSERT_NE (nullptr, send_block); nano::block_builder builder; auto open = builder @@ -4965,7 +4917,7 @@ TEST (rpc, block_create_send_epoch_v2) .account (key.pub) .previous (0) .representative (nano::dev::genesis_key.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send_block->hash ()) .sign (key.prv, key.pub) .work (*node->work_generate_blocking (key.pub)) @@ -5193,10 +5145,10 @@ TEST (rpc, online_reps) nano::keypair key; system.wallet (0)->insert_adhoc (nano::dev::genesis_key.prv); ASSERT_EQ (node2->online_reps.online (), 0); - auto send_block (system.wallet (0)->send_action (nano::dev::genesis_key.pub, key.pub, nano::Gxrb_ratio)); + auto send_block (system.wallet (0)->send_action (nano::dev::genesis_key.pub, key.pub, nano::Knano_ratio)); ASSERT_NE (nullptr, send_block); ASSERT_TIMELY (10s, !node2->online_reps.list ().empty ()); - ASSERT_EQ (node2->online_reps.online (), nano::dev::constants.genesis_amount - nano::Gxrb_ratio); + ASSERT_EQ (node2->online_reps.online (), nano::dev::constants.genesis_amount - nano::Knano_ratio); auto const rpc_ctx = add_rpc (system, node2); boost::property_tree::ptree request; request.put ("action", "representatives_online"); @@ -5249,7 +5201,7 @@ TEST (rpc, confirmation_history) nano::keypair key; system.wallet (0)->insert_adhoc (nano::dev::genesis_key.prv); ASSERT_TRUE (node->active.recently_cemented.list ().empty ()); - auto block (system.wallet (0)->send_action (nano::dev::genesis_key.pub, key.pub, nano::Gxrb_ratio)); + auto block (system.wallet (0)->send_action (nano::dev::genesis_key.pub, key.pub, nano::Knano_ratio)); ASSERT_TIMELY (10s, !node->active.recently_cemented.list ().empty ()); auto const rpc_ctx = add_rpc (system, node); boost::property_tree::ptree request; @@ -5269,7 +5221,7 @@ TEST (rpc, confirmation_history) ASSERT_EQ (block->hash ().to_string (), hash); nano::amount tally_num; tally_num.decode_dec (tally); - debug_assert (tally_num == nano::dev::constants.genesis_amount || tally_num == (nano::dev::constants.genesis_amount - nano::Gxrb_ratio)); + debug_assert (tally_num == nano::dev::constants.genesis_amount || tally_num == (nano::dev::constants.genesis_amount - nano::Knano_ratio)); system.stop (); } @@ -5280,9 +5232,9 @@ TEST (rpc, confirmation_history_hash) nano::keypair key; system.wallet (0)->insert_adhoc (nano::dev::genesis_key.prv); ASSERT_TRUE (node->active.recently_cemented.list ().empty ()); - auto send1 (system.wallet (0)->send_action (nano::dev::genesis_key.pub, key.pub, nano::Gxrb_ratio)); - auto send2 (system.wallet (0)->send_action (nano::dev::genesis_key.pub, key.pub, nano::Gxrb_ratio)); - auto send3 (system.wallet (0)->send_action (nano::dev::genesis_key.pub, key.pub, nano::Gxrb_ratio)); + auto send1 (system.wallet (0)->send_action (nano::dev::genesis_key.pub, key.pub, nano::Knano_ratio)); + auto send2 (system.wallet (0)->send_action (nano::dev::genesis_key.pub, key.pub, nano::Knano_ratio)); + auto send3 (system.wallet (0)->send_action (nano::dev::genesis_key.pub, key.pub, nano::Knano_ratio)); ASSERT_TIMELY_EQ (10s, node->active.recently_cemented.list ().size (), 3); auto const rpc_ctx = add_rpc (system, node); boost::property_tree::ptree request; @@ -5300,7 +5252,7 @@ TEST (rpc, confirmation_history_hash) ASSERT_EQ (send2->hash ().to_string (), hash); nano::amount tally_num; tally_num.decode_dec (tally); - debug_assert (tally_num == nano::dev::constants.genesis_amount || tally_num == (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) || tally_num == (nano::dev::constants.genesis_amount - 2 * nano::Gxrb_ratio) || tally_num == (nano::dev::constants.genesis_amount - 3 * nano::Gxrb_ratio)); + debug_assert (tally_num == nano::dev::constants.genesis_amount || tally_num == (nano::dev::constants.genesis_amount - nano::Knano_ratio) || tally_num == (nano::dev::constants.genesis_amount - 2 * nano::Knano_ratio) || tally_num == (nano::dev::constants.genesis_amount - 3 * nano::Knano_ratio)); system.stop (); } @@ -5315,7 +5267,7 @@ TEST (rpc, block_confirm) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node->work_generate_blocking (nano::dev::genesis->hash ())) @@ -5744,7 +5696,7 @@ TEST (rpc, sign_hash) .account (nano::dev::genesis_key.pub) .previous (node1->latest (nano::dev::genesis_key.pub)) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (0) @@ -5777,7 +5729,7 @@ TEST (rpc, sign_block) .account (nano::dev::genesis_key.pub) .previous (node1->latest (nano::dev::genesis_key.pub)) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (0) @@ -6533,7 +6485,7 @@ TEST (rpc, DISABLED_account_lazy_start) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (nano::dev::genesis->hash ())) From e9f7376efe9d9cc2af015175d37cbb7d8d391f56 Mon Sep 17 00:00:00 2001 From: RickiNano <81099017+RickiNano@users.noreply.github.com> Date: Sun, 22 Sep 2024 19:50:06 +0200 Subject: [PATCH 06/12] Removed legacy conversion tests --- nano/core_test/uint256_union.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/nano/core_test/uint256_union.cpp b/nano/core_test/uint256_union.cpp index 86c82f6609..16483cab15 100644 --- a/nano/core_test/uint256_union.cpp +++ b/nano/core_test/uint256_union.cpp @@ -116,15 +116,8 @@ TEST (uint128_union, balance_format) ASSERT_EQ ("1.23", nano::amount (nano::uint128_t ("1230000000000000000000000000000")).format_balance (nano::Mxrb_ratio, 2, true)); ASSERT_EQ ("1.2", nano::amount (nano::uint128_t ("1230000000000000000000000000000")).format_balance (nano::Mxrb_ratio, 1, true)); ASSERT_EQ ("1", nano::amount (nano::uint128_t ("1230000000000000000000000000000")).format_balance (nano::Mxrb_ratio, 0, true)); - ASSERT_EQ ("< 0.01", nano::amount (nano::xrb_ratio * 10).format_balance (nano::Mxrb_ratio, 2, true)); - ASSERT_EQ ("< 0.1", nano::amount (nano::xrb_ratio * 10).format_balance (nano::Mxrb_ratio, 1, true)); - ASSERT_EQ ("< 1", nano::amount (nano::xrb_ratio * 10).format_balance (nano::Mxrb_ratio, 0, true)); - ASSERT_EQ ("< 0.01", nano::amount (nano::xrb_ratio * 9999).format_balance (nano::Mxrb_ratio, 2, true)); - ASSERT_EQ ("0.01", nano::amount (nano::xrb_ratio * 10000).format_balance (nano::Mxrb_ratio, 2, true)); ASSERT_EQ ("123456789", nano::amount (nano::Mxrb_ratio * 123456789).format_balance (nano::Mxrb_ratio, 2, false)); ASSERT_EQ ("123,456,789", nano::amount (nano::Mxrb_ratio * 123456789).format_balance (nano::Mxrb_ratio, 2, true)); - ASSERT_EQ ("123,456,789.12", nano::amount (nano::Mxrb_ratio * 123456789 + nano::kxrb_ratio * 123).format_balance (nano::Mxrb_ratio, 2, true)); - ASSERT_EQ ("12-3456-789+123", nano::amount (nano::Mxrb_ratio * 123456789 + nano::kxrb_ratio * 123).format_balance (nano::Mxrb_ratio, 4, true, std::locale (std::cout.getloc (), new test_punct))); } TEST (uint128_union, decode_decimal) From 5cd6ecd43db0eee7ca1b688cd00c12b45df1baca Mon Sep 17 00:00:00 2001 From: RickiNano <81099017+RickiNano@users.noreply.github.com> Date: Sun, 22 Sep 2024 19:57:24 +0200 Subject: [PATCH 07/12] Fixed core tests --- nano/core_test/active_elections.cpp | 36 +-- nano/core_test/backlog.cpp | 2 +- nano/core_test/block_store.cpp | 14 +- nano/core_test/bootstrap.cpp | 84 +++---- nano/core_test/confirming_set.cpp | 16 +- nano/core_test/election_scheduler.cpp | 22 +- nano/core_test/ledger.cpp | 302 +++++++++++++------------- nano/core_test/ledger_confirm.cpp | 32 +-- nano/core_test/network_filter.cpp | 4 +- nano/core_test/node.cpp | 102 ++++----- nano/core_test/request_aggregator.cpp | 12 +- nano/core_test/scheduler_buckets.cpp | 52 ++--- nano/core_test/system.cpp | 22 +- nano/core_test/uint256_union.cpp | 52 ++--- nano/core_test/voting.cpp | 10 +- nano/core_test/wallet.cpp | 4 +- nano/core_test/websocket.cpp | 4 +- 17 files changed, 385 insertions(+), 385 deletions(-) diff --git a/nano/core_test/active_elections.cpp b/nano/core_test/active_elections.cpp index aabdce1c40..2acdcec39e 100644 --- a/nano/core_test/active_elections.cpp +++ b/nano/core_test/active_elections.cpp @@ -334,7 +334,7 @@ TEST (inactive_votes_cache, existing_vote) auto send = builder.send () .previous (latest) .destination (key.pub) - .balance (nano::dev::constants.genesis_amount - 100 * nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - 100 * nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (latest)) .build (); @@ -342,7 +342,7 @@ TEST (inactive_votes_cache, existing_vote) .account (key.pub) .previous (0) .representative (key.pub) - .balance (100 * nano::Gxrb_ratio) + .balance (100 * nano::Knano_ratio) .link (send->hash ()) .sign (key.prv, key.pub) .work (*system.work.generate (key.pub)) @@ -388,7 +388,7 @@ TEST (inactive_votes_cache, multiple_votes) auto send1 = builder.send () .previous (nano::dev::genesis->hash ()) .destination (key1.pub) - .balance (nano::dev::constants.genesis_amount - 100 * nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - 100 * nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (nano::dev::genesis->hash ())) .build (); @@ -396,7 +396,7 @@ TEST (inactive_votes_cache, multiple_votes) auto send2 = builder.send () .previous (send1->hash ()) .destination (key1.pub) - .balance (100 * nano::Gxrb_ratio) + .balance (100 * nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (send1->hash ())) .build (); @@ -405,7 +405,7 @@ TEST (inactive_votes_cache, multiple_votes) .account (key1.pub) .previous (0) .representative (key1.pub) - .balance (100 * nano::Gxrb_ratio) + .balance (100 * nano::Knano_ratio) .link (send1->hash ()) .sign (key1.prv, key1.pub) .work (*system.work.generate (key1.pub)) @@ -442,7 +442,7 @@ TEST (inactive_votes_cache, election_start) nano::send_block_builder send_block_builder; nano::state_block_builder state_block_builder; // Enough weight to trigger election hinting but not enough to confirm block on its own - auto amount = ((node.online_reps.trended () / 100) * node.config.hinted_scheduler.hinting_threshold_percent) / 2 + 1000 * nano::Gxrb_ratio; + auto amount = ((node.online_reps.trended () / 100) * node.config.hinted_scheduler.hinting_threshold_percent) / 2 + 1000 * nano::Knano_ratio; auto send1 = send_block_builder.make_block () .previous (latest) .destination (key1.pub) @@ -549,7 +549,7 @@ TEST (active_elections, vote_replays) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (nano::dev::genesis->hash ())) @@ -561,7 +561,7 @@ TEST (active_elections, vote_replays) .account (key.pub) .previous (0) .representative (key.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send1->hash ()) .sign (key.prv, key.pub) .work (*system.work.generate (key.pub)) @@ -589,14 +589,14 @@ TEST (active_elections, vote_replays) ASSERT_EQ (nano::vote_code::replay, node.vote_router.vote (vote_open1).at (open1->hash ())); ASSERT_TIMELY (5s, node.active.empty ()); ASSERT_EQ (nano::vote_code::replay, node.vote_router.vote (vote_open1).at (open1->hash ())); - ASSERT_EQ (nano::Gxrb_ratio, node.ledger.weight (key.pub)); + ASSERT_EQ (nano::Knano_ratio, node.ledger.weight (key.pub)); // send 1 raw to key to key auto send2 = builder.make_block () .account (key.pub) .previous (open1->hash ()) .representative (key.pub) - .balance (nano::Gxrb_ratio - 1) + .balance (nano::Knano_ratio - 1) .link (key.pub) .sign (key.prv, key.pub) .work (*system.work.generate (open1->hash ())) @@ -706,7 +706,7 @@ TEST (active_elections, republish_winner) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (nano::dev::genesis->hash ())) @@ -739,7 +739,7 @@ TEST (active_elections, republish_winner) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - 2 * nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - 2 * nano::Knano_ratio) .link (key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (nano::dev::genesis->hash ())) @@ -772,7 +772,7 @@ TEST (active_elections, fork_filter_cleanup) .previous (latest_hash) .account (nano::dev::genesis_key.pub) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (latest_hash)) @@ -889,7 +889,7 @@ TEST (active_elections, fork_replacement_tally) .account (nano::dev::genesis_key.pub) .previous (latest) .representative (nano::dev::genesis_key.pub) - .balance (balance - 2 * nano::Gxrb_ratio) + .balance (balance - 2 * nano::Knano_ratio) .link (key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (latest)) @@ -902,7 +902,7 @@ TEST (active_elections, fork_replacement_tally) .account (nano::dev::genesis_key.pub) .previous (latest) .representative (nano::dev::genesis_key.pub) - .balance (balance - nano::Gxrb_ratio - i) + .balance (balance - nano::Knano_ratio - i) .link (key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (latest)) @@ -1304,7 +1304,7 @@ TEST (active_elections, vacancy) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) .link (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (nano::dev::genesis->hash ())) .build (); @@ -1339,7 +1339,7 @@ TEST (active_elections, limit_vote_hinted_elections) // Setup representatives // Enough weight to trigger election hinting but not enough to confirm block on its own - const auto amount = ((node.online_reps.trended () / 100) * node.config.hinted_scheduler.hinting_threshold_percent) + 1000 * nano::Gxrb_ratio; + const auto amount = ((node.online_reps.trended () / 100) * node.config.hinted_scheduler.hinting_threshold_percent) + 1000 * nano::Knano_ratio; nano::keypair rep1 = nano::test::setup_rep (system, node, amount / 2); nano::keypair rep2 = nano::test::setup_rep (system, node, amount / 2); @@ -1464,7 +1464,7 @@ TEST (active_elections, broadcast_block_on_activation) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .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 ())) diff --git a/nano/core_test/backlog.cpp b/nano/core_test/backlog.cpp index 9af36e8e22..21a2e80ebc 100644 --- a/nano/core_test/backlog.cpp +++ b/nano/core_test/backlog.cpp @@ -63,7 +63,7 @@ TEST (backlog, election_activation) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node.work_generate_blocking (nano::dev::genesis->hash ())) diff --git a/nano/core_test/block_store.cpp b/nano/core_test/block_store.cpp index 82cc5b35c0..fcf7a57144 100644 --- a/nano/core_test/block_store.cpp +++ b/nano/core_test/block_store.cpp @@ -1009,7 +1009,7 @@ TEST (mdb_block_store, sideband_height) .send () .previous (nano::dev::genesis->hash ()) .destination (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) .build (); @@ -1035,7 +1035,7 @@ TEST (mdb_block_store, sideband_height) .account (nano::dev::genesis_key.pub) .previous (change->hash ()) .representative (0) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key1.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (change->hash ())) @@ -1046,7 +1046,7 @@ TEST (mdb_block_store, sideband_height) .account (nano::dev::genesis_key.pub) .previous (state_send1->hash ()) .representative (0) - .balance (nano::dev::constants.genesis_amount - 2 * nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - 2 * nano::Knano_ratio) .link (key2.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (state_send1->hash ())) @@ -1057,7 +1057,7 @@ TEST (mdb_block_store, sideband_height) .account (nano::dev::genesis_key.pub) .previous (state_send2->hash ()) .representative (0) - .balance (nano::dev::constants.genesis_amount - 3 * nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - 3 * nano::Knano_ratio) .link (key3.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (state_send2->hash ())) @@ -1068,7 +1068,7 @@ TEST (mdb_block_store, sideband_height) .account (key1.pub) .previous (0) .representative (0) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (state_send1->hash ()) .sign (key1.prv, key1.pub) .work (*pool.generate (key1.pub)) @@ -1079,7 +1079,7 @@ TEST (mdb_block_store, sideband_height) .account (key1.pub) .previous (state_open->hash ()) .representative (0) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (ledger.epoch_link (nano::epoch::epoch_1)) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (state_open->hash ())) @@ -1103,7 +1103,7 @@ TEST (mdb_block_store, sideband_height) .account (key2.pub) .previous (epoch_open->hash ()) .representative (0) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (state_send2->hash ()) .sign (key2.prv, key2.pub) .work (*pool.generate (epoch_open->hash ())) diff --git a/nano/core_test/bootstrap.cpp b/nano/core_test/bootstrap.cpp index 70834a6e12..6bcb4a4e60 100644 --- a/nano/core_test/bootstrap.cpp +++ b/nano/core_test/bootstrap.cpp @@ -496,7 +496,7 @@ TEST (bootstrap_processor, DISABLED_pull_requeue_network_error) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key1.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (nano::dev::genesis->hash ())) @@ -714,7 +714,7 @@ TEST (bootstrap_processor, lazy_hash) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key1.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node0->work_generate_blocking (nano::dev::genesis->hash ())) @@ -724,7 +724,7 @@ TEST (bootstrap_processor, lazy_hash) .account (key1.pub) .previous (0) .representative (key1.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send1->hash ()) .sign (key1.prv, key1.pub) .work (*node0->work_generate_blocking (key1.pub)) @@ -744,7 +744,7 @@ TEST (bootstrap_processor, lazy_hash) .account (key2.pub) .previous (0) .representative (key2.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send2->hash ()) .sign (key2.prv, key2.pub) .work (*node0->work_generate_blocking (key2.pub)) @@ -788,7 +788,7 @@ TEST (bootstrap_processor, lazy_hash_bootstrap_id) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key1.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node0->work_generate_blocking (nano::dev::genesis->hash ())) @@ -798,7 +798,7 @@ TEST (bootstrap_processor, lazy_hash_bootstrap_id) .account (key1.pub) .previous (0) .representative (key1.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send1->hash ()) .sign (key1.prv, key1.pub) .work (*node0->work_generate_blocking (key1.pub)) @@ -818,7 +818,7 @@ TEST (bootstrap_processor, lazy_hash_bootstrap_id) .account (key2.pub) .previous (0) .representative (key2.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send2->hash ()) .sign (key2.prv, key2.pub) .work (*node0->work_generate_blocking (key2.pub)) @@ -862,7 +862,7 @@ TEST (bootstrap_processor, lazy_hash_pruning) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node0->work_generate_blocking (nano::dev::genesis->hash ())) @@ -912,7 +912,7 @@ TEST (bootstrap_processor, lazy_hash_pruning) .account (nano::dev::genesis_key.pub) .previous (change2->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key1.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node0->work_generate_blocking (change2->hash ())) @@ -924,7 +924,7 @@ TEST (bootstrap_processor, lazy_hash_pruning) .account (key1.pub) .previous (0) .representative (key1.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send2->hash ()) .sign (key1.prv, key1.pub) .work (*node0->work_generate_blocking (key1.pub)) @@ -948,7 +948,7 @@ TEST (bootstrap_processor, lazy_hash_pruning) .account (key2.pub) .previous (0) .representative (key2.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send3->hash ()) .sign (key2.prv, key2.pub) .work (*node0->work_generate_blocking (key2.pub)) @@ -1008,7 +1008,7 @@ TEST (bootstrap_processor, lazy_max_pull_count) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key1.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node0->work_generate_blocking (nano::dev::genesis->hash ())) @@ -1018,7 +1018,7 @@ TEST (bootstrap_processor, lazy_max_pull_count) .account (key1.pub) .previous (0) .representative (key1.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send1->hash ()) .sign (key1.prv, key1.pub) .work (*node0->work_generate_blocking (key1.pub)) @@ -1038,7 +1038,7 @@ TEST (bootstrap_processor, lazy_max_pull_count) .account (key2.pub) .previous (0) .representative (key2.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send2->hash ()) .sign (key2.prv, key2.pub) .work (*node0->work_generate_blocking (key2.pub)) @@ -1048,7 +1048,7 @@ TEST (bootstrap_processor, lazy_max_pull_count) .account (key2.pub) .previous (receive2->hash ()) .representative (key1.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (0) .sign (key2.prv, key2.pub) .work (*node0->work_generate_blocking (receive2->hash ())) @@ -1058,7 +1058,7 @@ TEST (bootstrap_processor, lazy_max_pull_count) .account (key2.pub) .previous (change1->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (0) .sign (key2.prv, key2.pub) .work (*node0->work_generate_blocking (change1->hash ())) @@ -1068,7 +1068,7 @@ TEST (bootstrap_processor, lazy_max_pull_count) .account (key2.pub) .previous (change2->hash ()) .representative (key2.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (0) .sign (key2.prv, key2.pub) .work (*node0->work_generate_blocking (change2->hash ())) @@ -1111,7 +1111,7 @@ TEST (bootstrap_processor, lazy_unclear_state_link) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (nano::dev::genesis->hash ())) @@ -1122,7 +1122,7 @@ TEST (bootstrap_processor, lazy_unclear_state_link) .account (nano::dev::genesis_key.pub) .previous (send1->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - 2 * nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - 2 * nano::Knano_ratio) .link (key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (send1->hash ())) @@ -1142,7 +1142,7 @@ TEST (bootstrap_processor, lazy_unclear_state_link) .account (key.pub) .previous (open->hash ()) .representative (key.pub) - .balance (2 * nano::Gxrb_ratio) + .balance (2 * nano::Knano_ratio) .link (send2->hash ()) .sign (key.prv, key.pub) .work (*system.work.generate (open->hash ())) @@ -1180,7 +1180,7 @@ TEST (bootstrap_processor, lazy_unclear_state_link_not_existing) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (nano::dev::genesis->hash ())) @@ -1238,7 +1238,7 @@ TEST (bootstrap_processor, lazy_destinations) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key1.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (nano::dev::genesis->hash ())) @@ -1251,7 +1251,7 @@ TEST (bootstrap_processor, lazy_destinations) .account (nano::dev::genesis_key.pub) .previous (send1->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - 2 * nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - 2 * nano::Knano_ratio) .link (key2.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (send1->hash ())) @@ -1275,7 +1275,7 @@ TEST (bootstrap_processor, lazy_destinations) .account (key2.pub) .previous (0) .representative (key2.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send2->hash ()) .sign (key2.prv, key2.pub) .work (*system.work.generate (key2.pub)) @@ -1318,7 +1318,7 @@ TEST (bootstrap_processor, lazy_pruning_missing_block) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key1.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (nano::dev::genesis->hash ())) @@ -1330,7 +1330,7 @@ TEST (bootstrap_processor, lazy_pruning_missing_block) .account (nano::dev::genesis_key.pub) .previous (send1->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - 2 * nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - 2 * nano::Knano_ratio) .link (key2.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (send1->hash ())) @@ -1352,7 +1352,7 @@ TEST (bootstrap_processor, lazy_pruning_missing_block) .account (key2.pub) .previous (0) .representative (key2.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send2->hash ()) .sign (key2.prv, key2.pub) .work (*system.work.generate (key2.pub)) @@ -1417,7 +1417,7 @@ TEST (bootstrap_processor, lazy_cancel) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key1.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node0->work_generate_blocking (nano::dev::genesis->hash ())) @@ -1457,7 +1457,7 @@ TEST (bootstrap_processor, wallet_lazy_frontier) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key1.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node0->work_generate_blocking (nano::dev::genesis->hash ())) @@ -1467,7 +1467,7 @@ TEST (bootstrap_processor, wallet_lazy_frontier) .account (key1.pub) .previous (0) .representative (key1.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send1->hash ()) .sign (key1.prv, key1.pub) .work (*node0->work_generate_blocking (key1.pub)) @@ -1487,7 +1487,7 @@ TEST (bootstrap_processor, wallet_lazy_frontier) .account (key2.pub) .previous (0) .representative (key2.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send2->hash ()) .sign (key2.prv, key2.pub) .work (*node0->work_generate_blocking (key2.pub)) @@ -1537,7 +1537,7 @@ TEST (bootstrap_processor, wallet_lazy_pending) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key1.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node0->work_generate_blocking (nano::dev::genesis->hash ())) @@ -1547,7 +1547,7 @@ TEST (bootstrap_processor, wallet_lazy_pending) .account (key1.pub) .previous (0) .representative (key1.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send1->hash ()) .sign (key1.prv, key1.pub) .work (*node0->work_generate_blocking (key1.pub)) @@ -1598,7 +1598,7 @@ TEST (bootstrap_processor, multiple_attempts) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key1.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node1->work_generate_blocking (nano::dev::genesis->hash ())) @@ -1608,7 +1608,7 @@ TEST (bootstrap_processor, multiple_attempts) .account (key1.pub) .previous (0) .representative (key1.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send1->hash ()) .sign (key1.prv, key1.pub) .work (*node1->work_generate_blocking (key1.pub)) @@ -1628,7 +1628,7 @@ TEST (bootstrap_processor, multiple_attempts) .account (key2.pub) .previous (0) .representative (key2.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send2->hash ()) .sign (key2.prv, key2.pub) .work (*node1->work_generate_blocking (key2.pub)) @@ -1712,7 +1712,7 @@ TEST (frontier_req, count) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key1.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (0) @@ -1724,7 +1724,7 @@ TEST (frontier_req, count) .account (key1.pub) .previous (0) .representative (nano::dev::genesis_key.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send1->hash ()) .sign (key1.prv, key1.pub) .work (0) @@ -1807,7 +1807,7 @@ TEST (frontier_req, confirmed_frontier) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key_before_genesis.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (0) @@ -1819,7 +1819,7 @@ TEST (frontier_req, confirmed_frontier) .account (nano::dev::genesis_key.pub) .previous (send1->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - 2 * nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - 2 * nano::Knano_ratio) .link (key_after_genesis.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (0) @@ -1831,7 +1831,7 @@ TEST (frontier_req, confirmed_frontier) .account (key_before_genesis.pub) .previous (0) .representative (nano::dev::genesis_key.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send1->hash ()) .sign (key_before_genesis.prv, key_before_genesis.pub) .work (0) @@ -1843,7 +1843,7 @@ TEST (frontier_req, confirmed_frontier) .account (key_after_genesis.pub) .previous (0) .representative (nano::dev::genesis_key.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send2->hash ()) .sign (key_after_genesis.prv, key_after_genesis.pub) .work (0) diff --git a/nano/core_test/confirming_set.cpp b/nano/core_test/confirming_set.cpp index 47b8eaf7ee..fe018699f4 100644 --- a/nano/core_test/confirming_set.cpp +++ b/nano/core_test/confirming_set.cpp @@ -85,7 +85,7 @@ TEST (confirmation_callback, observer_callbacks) .send () .previous (latest) .destination (key1.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (latest)) .build (); @@ -93,7 +93,7 @@ TEST (confirmation_callback, observer_callbacks) .send () .previous (send->hash ()) .destination (key1.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio * 2) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio * 2) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (send->hash ())) .build (); @@ -133,7 +133,7 @@ TEST (confirmation_callback, confirmed_history) .send () .previous (latest) .destination (key1.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (latest)) .build (); @@ -143,7 +143,7 @@ TEST (confirmation_callback, confirmed_history) .send () .previous (send->hash ()) .destination (key1.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio * 2) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio * 2) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (send->hash ())) .build (); @@ -207,7 +207,7 @@ TEST (confirmation_callback, dependent_election) .send () .previous (latest) .destination (key1.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (latest)) .build (); @@ -215,7 +215,7 @@ TEST (confirmation_callback, dependent_election) .send () .previous (send->hash ()) .destination (key1.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio * 2) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio * 2) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (send->hash ())) .build (); @@ -223,7 +223,7 @@ TEST (confirmation_callback, dependent_election) .send () .previous (send1->hash ()) .destination (key1.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio * 3) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio * 3) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (send1->hash ())) .build (); @@ -265,7 +265,7 @@ TEST (confirmation_callback, election_winner_details_clearing_node_process_confi .send () .previous (nano::dev::genesis->hash ()) .destination (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (nano::dev::genesis->hash ())) .build (); diff --git a/nano/core_test/election_scheduler.cpp b/nano/core_test/election_scheduler.cpp index a4c5b7fd05..56c1a5c7b8 100644 --- a/nano/core_test/election_scheduler.cpp +++ b/nano/core_test/election_scheduler.cpp @@ -63,7 +63,7 @@ std::shared_ptr & block0 () .account (key0 ().pub) .previous (0) .representative (key0 ().pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (0) .sign (key0 ().prv, key0 ().pub) .work (0) @@ -78,7 +78,7 @@ std::shared_ptr & block1 () .account (key1 ().pub) .previous (0) .representative (key1 ().pub) - .balance (nano::Mxrb_ratio) + .balance (nano::nano_ratio) .link (0) .sign (key1 ().prv, key1 ().pub) .work (0) @@ -93,7 +93,7 @@ std::shared_ptr & block2 () .account (key2 ().pub) .previous (0) .representative (key2 ().pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (0) .sign (key2 ().prv, key2 ().pub) .work (0) @@ -108,7 +108,7 @@ std::shared_ptr & block3 () .account (key3 ().pub) .previous (0) .representative (key3 ().pub) - .balance (nano::Mxrb_ratio) + .balance (nano::nano_ratio) .link (0) .sign (key3 ().prv, key3 ().pub) .work (0) @@ -127,7 +127,7 @@ TEST (election_scheduler, activate_one_timely) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .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 ())) @@ -147,7 +147,7 @@ TEST (election_scheduler, activate_one_flush) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .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 ())) @@ -190,7 +190,7 @@ TEST (election_scheduler, no_vacancy) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) .link (key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (nano::dev::genesis->hash ())) .build (); @@ -202,7 +202,7 @@ TEST (election_scheduler, no_vacancy) .previous (0) .representative (key.pub) .link (send->hash ()) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .sign (key.prv, key.pub) .work (*system.work.generate (key.pub)) .build (); @@ -217,7 +217,7 @@ TEST (election_scheduler, no_vacancy) .previous (send->hash ()) .representative (nano::dev::genesis_key.pub) .link (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - 2 * nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - 2 * nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (send->hash ())) .build (); @@ -256,8 +256,8 @@ TEST (election_scheduler_bucket, construction) auto & node = *system.add_node (); nano::scheduler::priority_bucket_config bucket_config; - nano::scheduler::bucket bucket{ nano::Gxrb_ratio, bucket_config, node.active, node.stats }; - ASSERT_EQ (nano::Gxrb_ratio, bucket.minimum_balance); + nano::scheduler::bucket bucket{ nano::Knano_ratio, bucket_config, node.active, node.stats }; + ASSERT_EQ (nano::Knano_ratio, bucket.minimum_balance); ASSERT_TRUE (bucket.empty ()); ASSERT_EQ (0, bucket.size ()); } diff --git a/nano/core_test/ledger.cpp b/nano/core_test/ledger.cpp index 809ac7b6fc..7d9b9b7eef 100644 --- a/nano/core_test/ledger.cpp +++ b/nano/core_test/ledger.cpp @@ -90,7 +90,7 @@ TEST (ledger, process_modifies_sideband) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) @@ -437,7 +437,7 @@ TEST (ledger, receive_rollback) .send () .previous (nano::dev::genesis->hash ()) .destination (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) .build (); @@ -1025,7 +1025,7 @@ TEST (votes, add_existing) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) // No representative, blocks can't confirm - .balance (nano::dev::constants.genesis_amount / 2 - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount / 2 - nano::Knano_ratio) .link (key1.pub) .work (0) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) @@ -1043,7 +1043,7 @@ TEST (votes, add_existing) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) // No representative, blocks can't confirm - .balance (nano::dev::constants.genesis_amount / 2 - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount / 2 - nano::Knano_ratio) .link (key2.pub) .work (0) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) @@ -2306,7 +2306,7 @@ TEST (ledger, block_destination_source) auto & pool = ctx.pool (); nano::keypair dest; nano::uint128_t balance (nano::dev::constants.genesis_amount); - balance -= nano::Gxrb_ratio; + balance -= nano::Knano_ratio; nano::block_builder builder; auto block1 = builder .send () @@ -2316,7 +2316,7 @@ TEST (ledger, block_destination_source) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) .build (); - balance -= nano::Gxrb_ratio; + balance -= nano::Knano_ratio; auto block2 = builder .send () .previous (block1->hash ()) @@ -2325,7 +2325,7 @@ TEST (ledger, block_destination_source) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (block1->hash ())) .build (); - balance += nano::Gxrb_ratio; + balance += nano::Knano_ratio; auto block3 = builder .receive () .previous (block2->hash ()) @@ -2333,7 +2333,7 @@ TEST (ledger, block_destination_source) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (block2->hash ())) .build (); - balance -= nano::Gxrb_ratio; + balance -= nano::Knano_ratio; auto block4 = builder .state () .account (nano::dev::genesis_key.pub) @@ -2344,7 +2344,7 @@ TEST (ledger, block_destination_source) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (block3->hash ())) .build (); - balance -= nano::Gxrb_ratio; + balance -= nano::Knano_ratio; auto block5 = builder .state () .account (nano::dev::genesis_key.pub) @@ -2355,7 +2355,7 @@ TEST (ledger, block_destination_source) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (block4->hash ())) .build (); - balance += nano::Gxrb_ratio; + balance += nano::Knano_ratio; auto block6 = builder .state () .account (nano::dev::genesis_key.pub) @@ -2400,7 +2400,7 @@ TEST (ledger, state_account) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) @@ -2422,7 +2422,7 @@ TEST (ledger, state_send_receive) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) @@ -2432,9 +2432,9 @@ TEST (ledger, state_send_receive) auto send2 = ledger.any.block_get (transaction, send1->hash ()); ASSERT_NE (nullptr, send2); ASSERT_EQ (*send1, *send2); - ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Gxrb_ratio, ledger.any.block_balance (transaction, send1->hash ())); - ASSERT_EQ (nano::Gxrb_ratio, ledger.any.block_amount (transaction, send1->hash ())); - ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Gxrb_ratio, ledger.weight (nano::dev::genesis_key.pub)); + ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Knano_ratio, ledger.any.block_balance (transaction, send1->hash ())); + ASSERT_EQ (nano::Knano_ratio, ledger.any.block_amount (transaction, send1->hash ())); + ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Knano_ratio, ledger.weight (nano::dev::genesis_key.pub)); ASSERT_TRUE (ledger.any.pending_get (transaction, nano::pending_key{ nano::dev::genesis_key.pub, send1->hash () })); ASSERT_EQ (2, send2->sideband ().height); ASSERT_TRUE (send2->is_send ()); @@ -2456,7 +2456,7 @@ TEST (ledger, state_send_receive) ASSERT_NE (nullptr, receive2); ASSERT_EQ (*receive1, *receive2); ASSERT_EQ (nano::dev::constants.genesis_amount, ledger.any.block_balance (transaction, receive1->hash ())); - ASSERT_EQ (nano::Gxrb_ratio, ledger.any.block_amount (transaction, receive1->hash ())); + ASSERT_EQ (nano::Knano_ratio, ledger.any.block_amount (transaction, receive1->hash ())); ASSERT_EQ (nano::dev::constants.genesis_amount, ledger.weight (nano::dev::genesis_key.pub)); ASSERT_FALSE (ledger.any.pending_get (transaction, nano::pending_key{ nano::dev::genesis_key.pub, send1->hash () })); ASSERT_EQ (store.account.count (transaction), ledger.account_count ()); @@ -2478,7 +2478,7 @@ TEST (ledger, state_receive) .send () .previous (nano::dev::genesis->hash ()) .destination (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) .build (); @@ -2487,9 +2487,9 @@ TEST (ledger, state_receive) auto send2 = ledger.any.block_get (transaction, send1->hash ()); ASSERT_NE (nullptr, send2); ASSERT_EQ (*send1, *send2); - ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Gxrb_ratio, ledger.any.block_balance (transaction, send1->hash ())); - ASSERT_EQ (nano::Gxrb_ratio, ledger.any.block_amount (transaction, send1->hash ())); - ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Gxrb_ratio, ledger.weight (nano::dev::genesis_key.pub)); + ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Knano_ratio, ledger.any.block_balance (transaction, send1->hash ())); + ASSERT_EQ (nano::Knano_ratio, ledger.any.block_amount (transaction, send1->hash ())); + ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Knano_ratio, ledger.weight (nano::dev::genesis_key.pub)); auto receive1 = builder .state () .account (nano::dev::genesis_key.pub) @@ -2506,7 +2506,7 @@ TEST (ledger, state_receive) ASSERT_NE (nullptr, receive2); ASSERT_EQ (*receive1, *receive2); ASSERT_EQ (nano::dev::constants.genesis_amount, ledger.any.block_balance (transaction, receive1->hash ())); - ASSERT_EQ (nano::Gxrb_ratio, ledger.any.block_amount (transaction, receive1->hash ())); + ASSERT_EQ (nano::Knano_ratio, ledger.any.block_amount (transaction, receive1->hash ())); ASSERT_EQ (nano::dev::constants.genesis_amount, ledger.weight (nano::dev::genesis_key.pub)); ASSERT_EQ (3, receive2->sideband ().height); ASSERT_FALSE (receive2->is_send ()); @@ -2562,7 +2562,7 @@ TEST (ledger, state_open) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (destination.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) @@ -2572,16 +2572,16 @@ TEST (ledger, state_open) auto send2 = ledger.any.block_get (transaction, send1->hash ()); ASSERT_NE (nullptr, send2); ASSERT_EQ (*send1, *send2); - ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Gxrb_ratio, ledger.any.block_balance (transaction, send1->hash ())); - ASSERT_EQ (nano::Gxrb_ratio, ledger.any.block_amount (transaction, send1->hash ())); - ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Gxrb_ratio, ledger.weight (nano::dev::genesis_key.pub)); + ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Knano_ratio, ledger.any.block_balance (transaction, send1->hash ())); + ASSERT_EQ (nano::Knano_ratio, ledger.any.block_amount (transaction, send1->hash ())); + ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Knano_ratio, ledger.weight (nano::dev::genesis_key.pub)); ASSERT_TRUE (ledger.any.pending_get (transaction, nano::pending_key{ destination.pub, send1->hash () })); auto open1 = builder .state () .account (destination.pub) .previous (0) .representative (nano::dev::genesis_key.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send1->hash ()) .sign (destination.prv, destination.pub) .work (*pool.generate (destination.pub)) @@ -2592,8 +2592,8 @@ TEST (ledger, state_open) auto open2 = ledger.any.block_get (transaction, open1->hash ()); ASSERT_NE (nullptr, open2); ASSERT_EQ (*open1, *open2); - ASSERT_EQ (nano::Gxrb_ratio, ledger.any.block_balance (transaction, open1->hash ())); - ASSERT_EQ (nano::Gxrb_ratio, ledger.any.block_amount (transaction, open1->hash ())); + ASSERT_EQ (nano::Knano_ratio, ledger.any.block_balance (transaction, open1->hash ())); + ASSERT_EQ (nano::Knano_ratio, ledger.any.block_amount (transaction, open1->hash ())); ASSERT_EQ (nano::dev::constants.genesis_amount, ledger.weight (nano::dev::genesis_key.pub)); ASSERT_EQ (ledger.account_count (), store.account.count (transaction)); ASSERT_EQ (1, open2->sideband ().height); @@ -2616,7 +2616,7 @@ TEST (ledger, send_after_state_fail) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) @@ -2626,7 +2626,7 @@ TEST (ledger, send_after_state_fail) .send () .previous (send1->hash ()) .destination (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - (2 * nano::Gxrb_ratio)) + .balance (nano::dev::constants.genesis_amount - (2 * nano::Knano_ratio)) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (send1->hash ())) .build (); @@ -2647,7 +2647,7 @@ TEST (ledger, receive_after_state_fail) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) @@ -2677,7 +2677,7 @@ TEST (ledger, change_after_state_fail) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) @@ -2706,7 +2706,7 @@ TEST (ledger, state_unreceivable_fail) .send () .previous (nano::dev::genesis->hash ()) .destination (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) .build (); @@ -2715,9 +2715,9 @@ TEST (ledger, state_unreceivable_fail) auto send2 = ledger.any.block_get (transaction, send1->hash ()); ASSERT_NE (nullptr, send2); ASSERT_EQ (*send1, *send2); - ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Gxrb_ratio, ledger.any.block_balance (transaction, send1->hash ())); - ASSERT_EQ (nano::Gxrb_ratio, ledger.any.block_amount (transaction, send1->hash ())); - ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Gxrb_ratio, ledger.weight (nano::dev::genesis_key.pub)); + ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Knano_ratio, ledger.any.block_balance (transaction, send1->hash ())); + ASSERT_EQ (nano::Knano_ratio, ledger.any.block_amount (transaction, send1->hash ())); + ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Knano_ratio, ledger.weight (nano::dev::genesis_key.pub)); auto receive1 = builder .state () .account (nano::dev::genesis_key.pub) @@ -2743,7 +2743,7 @@ TEST (ledger, state_receive_bad_amount_fail) .send () .previous (nano::dev::genesis->hash ()) .destination (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) .build (); @@ -2752,15 +2752,15 @@ TEST (ledger, state_receive_bad_amount_fail) auto send2 = ledger.any.block_get (transaction, send1->hash ()); ASSERT_NE (nullptr, send2); ASSERT_EQ (*send1, *send2); - ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Gxrb_ratio, ledger.any.block_balance (transaction, send1->hash ())); - ASSERT_EQ (nano::Gxrb_ratio, ledger.any.block_amount (transaction, send1->hash ())); - ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Gxrb_ratio, ledger.weight (nano::dev::genesis_key.pub)); + ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Knano_ratio, ledger.any.block_balance (transaction, send1->hash ())); + ASSERT_EQ (nano::Knano_ratio, ledger.any.block_amount (transaction, send1->hash ())); + ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Knano_ratio, ledger.weight (nano::dev::genesis_key.pub)); auto receive1 = builder .state () .account (nano::dev::genesis_key.pub) .previous (send1->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (send1->hash ()) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (send1->hash ())) @@ -2781,7 +2781,7 @@ TEST (ledger, state_no_link_amount_fail) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) @@ -2814,7 +2814,7 @@ TEST (ledger, state_receive_wrong_account_fail) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) @@ -2824,16 +2824,16 @@ TEST (ledger, state_receive_wrong_account_fail) auto send2 = ledger.any.block_get (transaction, send1->hash ()); ASSERT_NE (nullptr, send2); ASSERT_EQ (*send1, *send2); - ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Gxrb_ratio, ledger.any.block_balance (transaction, send1->hash ())); - ASSERT_EQ (nano::Gxrb_ratio, ledger.any.block_amount (transaction, send1->hash ())); - ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Gxrb_ratio, ledger.weight (nano::dev::genesis_key.pub)); + ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Knano_ratio, ledger.any.block_balance (transaction, send1->hash ())); + ASSERT_EQ (nano::Knano_ratio, ledger.any.block_amount (transaction, send1->hash ())); + ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Knano_ratio, ledger.weight (nano::dev::genesis_key.pub)); nano::keypair key; auto receive1 = builder .state () .account (key.pub) .previous (0) .representative (nano::dev::genesis_key.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send1->hash ()) .sign (key.prv, key.pub) .work (*pool.generate (key.pub)) @@ -2855,7 +2855,7 @@ TEST (ledger, state_open_state_fork) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (destination.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) @@ -2866,7 +2866,7 @@ TEST (ledger, state_open_state_fork) .account (destination.pub) .previous (0) .representative (nano::dev::genesis_key.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send1->hash ()) .sign (destination.prv, destination.pub) .work (*pool.generate (destination.pub)) @@ -2898,7 +2898,7 @@ TEST (ledger, state_state_open_fork) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (destination.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) @@ -2918,7 +2918,7 @@ TEST (ledger, state_state_open_fork) .account (destination.pub) .previous (0) .representative (nano::dev::genesis_key.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send1->hash ()) .sign (destination.prv, destination.pub) .work (*pool.generate (destination.pub)) @@ -2942,7 +2942,7 @@ TEST (ledger, state_open_previous_fail) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (destination.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) @@ -2953,7 +2953,7 @@ TEST (ledger, state_open_previous_fail) .account (destination.pub) .previous (1) .representative (nano::dev::genesis_key.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send1->hash ()) .sign (destination.prv, destination.pub) .work (*pool.generate (1)) @@ -2975,7 +2975,7 @@ TEST (ledger, state_open_source_fail) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (destination.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) @@ -3008,7 +3008,7 @@ TEST (ledger, state_send_change) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (rep.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) @@ -3018,10 +3018,10 @@ TEST (ledger, state_send_change) auto send2 = ledger.any.block_get (transaction, send1->hash ()); ASSERT_NE (nullptr, send2); ASSERT_EQ (*send1, *send2); - ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Gxrb_ratio, ledger.any.block_balance (transaction, send1->hash ())); - ASSERT_EQ (nano::Gxrb_ratio, ledger.any.block_amount (transaction, send1->hash ())); + ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Knano_ratio, ledger.any.block_balance (transaction, send1->hash ())); + ASSERT_EQ (nano::Knano_ratio, ledger.any.block_amount (transaction, send1->hash ())); ASSERT_EQ (0, ledger.weight (nano::dev::genesis_key.pub)); - ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Gxrb_ratio, ledger.weight (rep.pub)); + ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Knano_ratio, ledger.weight (rep.pub)); ASSERT_EQ (2, send2->sideband ().height); ASSERT_TRUE (send2->is_send ()); ASSERT_FALSE (send2->is_receive ()); @@ -3041,7 +3041,7 @@ TEST (ledger, state_receive_change) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) @@ -3051,9 +3051,9 @@ TEST (ledger, state_receive_change) auto send2 = ledger.any.block_get (transaction, send1->hash ()); ASSERT_NE (nullptr, send2); ASSERT_EQ (*send1, *send2); - ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Gxrb_ratio, ledger.any.block_balance (transaction, send1->hash ())); - ASSERT_EQ (nano::Gxrb_ratio, ledger.any.block_amount (transaction, send1->hash ())); - ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Gxrb_ratio, ledger.weight (nano::dev::genesis_key.pub)); + ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Knano_ratio, ledger.any.block_balance (transaction, send1->hash ())); + ASSERT_EQ (nano::Knano_ratio, ledger.any.block_amount (transaction, send1->hash ())); + ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Knano_ratio, ledger.weight (nano::dev::genesis_key.pub)); nano::keypair rep; auto receive1 = builder .state () @@ -3071,7 +3071,7 @@ TEST (ledger, state_receive_change) ASSERT_NE (nullptr, receive2); ASSERT_EQ (*receive1, *receive2); ASSERT_EQ (nano::dev::constants.genesis_amount, ledger.any.block_balance (transaction, receive1->hash ())); - ASSERT_EQ (nano::Gxrb_ratio, ledger.any.block_amount (transaction, receive1->hash ())); + ASSERT_EQ (nano::Knano_ratio, ledger.any.block_amount (transaction, receive1->hash ())); ASSERT_EQ (0, ledger.weight (nano::dev::genesis_key.pub)); ASSERT_EQ (nano::dev::constants.genesis_amount, ledger.weight (rep.pub)); ASSERT_EQ (3, receive2->sideband ().height); @@ -3094,7 +3094,7 @@ TEST (ledger, state_open_old) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (destination.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) @@ -3109,8 +3109,8 @@ TEST (ledger, state_open_old) .work (*pool.generate (destination.pub)) .build (); ASSERT_EQ (nano::block_status::progress, ledger.process (transaction, open1)); - ASSERT_EQ (nano::Gxrb_ratio, ledger.any.block_balance (transaction, open1->hash ())); - ASSERT_EQ (nano::Gxrb_ratio, ledger.any.block_amount (transaction, open1->hash ())); + ASSERT_EQ (nano::Knano_ratio, ledger.any.block_balance (transaction, open1->hash ())); + ASSERT_EQ (nano::Knano_ratio, ledger.any.block_amount (transaction, open1->hash ())); ASSERT_EQ (nano::dev::constants.genesis_amount, ledger.weight (nano::dev::genesis_key.pub)); } @@ -3128,7 +3128,7 @@ TEST (ledger, state_receive_old) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (destination.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) @@ -3139,7 +3139,7 @@ TEST (ledger, state_receive_old) .account (nano::dev::genesis_key.pub) .previous (send1->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - (2 * nano::Gxrb_ratio)) + .balance (nano::dev::constants.genesis_amount - (2 * nano::Knano_ratio)) .link (destination.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (send1->hash ())) @@ -3162,8 +3162,8 @@ TEST (ledger, state_receive_old) .work (*pool.generate (open1->hash ())) .build (); ASSERT_EQ (nano::block_status::progress, ledger.process (transaction, receive1)); - ASSERT_EQ (2 * nano::Gxrb_ratio, ledger.any.block_balance (transaction, receive1->hash ())); - ASSERT_EQ (nano::Gxrb_ratio, ledger.any.block_amount (transaction, receive1->hash ())); + ASSERT_EQ (2 * nano::Knano_ratio, ledger.any.block_balance (transaction, receive1->hash ())); + ASSERT_EQ (nano::Knano_ratio, ledger.any.block_amount (transaction, receive1->hash ())); ASSERT_EQ (nano::dev::constants.genesis_amount, ledger.weight (nano::dev::genesis_key.pub)); } @@ -3180,7 +3180,7 @@ TEST (ledger, state_rollback_send) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) @@ -3190,12 +3190,12 @@ TEST (ledger, state_rollback_send) auto send2 = ledger.any.block_get (transaction, send1->hash ()); ASSERT_NE (nullptr, send2); ASSERT_EQ (*send1, *send2); - ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Gxrb_ratio, ledger.any.account_balance (transaction, nano::dev::genesis_key.pub)); - ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Gxrb_ratio, ledger.weight (nano::dev::genesis_key.pub)); + ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Knano_ratio, ledger.any.account_balance (transaction, nano::dev::genesis_key.pub)); + ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Knano_ratio, ledger.weight (nano::dev::genesis_key.pub)); auto info = ledger.any.pending_get (transaction, nano::pending_key (nano::dev::genesis_key.pub, send1->hash ())); ASSERT_TRUE (info); ASSERT_EQ (nano::dev::genesis_key.pub, info->source); - ASSERT_EQ (nano::Gxrb_ratio, info->amount.number ()); + ASSERT_EQ (nano::Knano_ratio, info->amount.number ()); ASSERT_FALSE (ledger.rollback (transaction, send1->hash ())); ASSERT_FALSE (ledger.any.block_exists (transaction, send1->hash ())); ASSERT_EQ (nano::dev::constants.genesis_amount, ledger.any.account_balance (transaction, nano::dev::genesis_key.pub)); @@ -3218,7 +3218,7 @@ TEST (ledger, state_rollback_receive) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) @@ -3240,10 +3240,10 @@ TEST (ledger, state_rollback_receive) auto info = ledger.any.pending_get (transaction, nano::pending_key (nano::dev::genesis_key.pub, send1->hash ())); ASSERT_TRUE (info); ASSERT_EQ (nano::dev::genesis_key.pub, info->source); - ASSERT_EQ (nano::Gxrb_ratio, info->amount.number ()); + ASSERT_EQ (nano::Knano_ratio, info->amount.number ()); ASSERT_FALSE (ledger.any.block_exists (transaction, receive1->hash ())); - ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Gxrb_ratio, ledger.any.account_balance (transaction, nano::dev::genesis_key.pub)); - ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Gxrb_ratio, ledger.weight (nano::dev::genesis_key.pub)); + ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Knano_ratio, ledger.any.account_balance (transaction, nano::dev::genesis_key.pub)); + ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Knano_ratio, ledger.weight (nano::dev::genesis_key.pub)); ASSERT_EQ (store.account.count (transaction), ledger.account_count ()); } @@ -3261,7 +3261,7 @@ TEST (ledger, state_rollback_received_send) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) @@ -3272,7 +3272,7 @@ TEST (ledger, state_rollback_received_send) .account (key.pub) .previous (0) .representative (key.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send1->hash ()) .sign (key.prv, key.pub) .work (*pool.generate (key.pub)) @@ -3331,7 +3331,7 @@ TEST (ledger, state_open_rollback) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (destination.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) @@ -3342,7 +3342,7 @@ TEST (ledger, state_open_rollback) .account (destination.pub) .previous (0) .representative (nano::dev::genesis_key.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send1->hash ()) .sign (destination.prv, destination.pub) .work (*pool.generate (destination.pub)) @@ -3351,11 +3351,11 @@ TEST (ledger, state_open_rollback) ASSERT_FALSE (ledger.rollback (transaction, open1->hash ())); ASSERT_FALSE (ledger.any.block_exists (transaction, open1->hash ())); ASSERT_FALSE (ledger.any.account_balance (transaction, destination.pub)); - ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Gxrb_ratio, ledger.weight (nano::dev::genesis_key.pub)); + ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Knano_ratio, ledger.weight (nano::dev::genesis_key.pub)); auto info = ledger.any.pending_get (transaction, nano::pending_key (destination.pub, send1->hash ())); ASSERT_TRUE (info); ASSERT_EQ (nano::dev::genesis_key.pub, info->source); - ASSERT_EQ (nano::Gxrb_ratio, info->amount.number ()); + ASSERT_EQ (nano::Knano_ratio, info->amount.number ()); ASSERT_EQ (store.account.count (transaction), ledger.account_count ()); } @@ -3373,7 +3373,7 @@ TEST (ledger, state_send_change_rollback) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (rep.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) @@ -3400,7 +3400,7 @@ TEST (ledger, state_receive_change_rollback) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) @@ -3420,8 +3420,8 @@ TEST (ledger, state_receive_change_rollback) ASSERT_EQ (nano::block_status::progress, ledger.process (transaction, receive1)); ASSERT_FALSE (ledger.rollback (transaction, receive1->hash ())); ASSERT_FALSE (ledger.any.block_exists (transaction, receive1->hash ())); - ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Gxrb_ratio, ledger.any.account_balance (transaction, nano::dev::genesis_key.pub)); - ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Gxrb_ratio, ledger.weight (nano::dev::genesis_key.pub)); + ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Knano_ratio, ledger.any.account_balance (transaction, nano::dev::genesis_key.pub)); + ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Knano_ratio, ledger.weight (nano::dev::genesis_key.pub)); ASSERT_EQ (0, ledger.weight (rep.pub)); ASSERT_EQ (store.account.count (transaction), ledger.account_count ()); } @@ -3491,7 +3491,7 @@ TEST (ledger, epoch_blocks_v1_general) .account (nano::dev::genesis_key.pub) .previous (epoch1->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (destination.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (epoch1->hash ())) @@ -3551,7 +3551,7 @@ TEST (ledger, epoch_blocks_v1_general) .account (destination.pub) .previous (epoch4->hash ()) .representative (destination.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send1->hash ()) .sign (destination.prv, destination.pub) .work (*pool.generate (epoch4->hash ())) @@ -3560,10 +3560,10 @@ TEST (ledger, epoch_blocks_v1_general) ASSERT_EQ (nano::epoch::epoch_1, receive2->sideband ().details.epoch); ASSERT_EQ (nano::epoch::epoch_1, receive2->sideband ().source_epoch); ASSERT_EQ (0, ledger.any.block_balance (transaction, epoch4->hash ()).value ().number ()); - ASSERT_EQ (nano::Gxrb_ratio, ledger.any.block_balance (transaction, receive2->hash ())); - ASSERT_EQ (nano::Gxrb_ratio, ledger.any.block_amount (transaction, receive2->hash ())); - ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Gxrb_ratio, ledger.weight (nano::dev::genesis_key.pub)); - ASSERT_EQ (nano::Gxrb_ratio, ledger.weight (destination.pub)); + ASSERT_EQ (nano::Knano_ratio, ledger.any.block_balance (transaction, receive2->hash ())); + ASSERT_EQ (nano::Knano_ratio, ledger.any.block_amount (transaction, receive2->hash ())); + ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Knano_ratio, ledger.weight (nano::dev::genesis_key.pub)); + ASSERT_EQ (nano::Knano_ratio, ledger.weight (destination.pub)); ASSERT_FALSE (receive2->is_send ()); ASSERT_TRUE (receive2->is_receive ()); ASSERT_FALSE (receive2->sideband ().details.is_epoch); @@ -3652,7 +3652,7 @@ TEST (ledger, epoch_blocks_v2_general) .account (nano::dev::genesis_key.pub) .previous (epoch1->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (destination.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (epoch1->hash ())) @@ -3719,7 +3719,7 @@ TEST (ledger, epoch_blocks_v2_general) .account (destination.pub) .previous (epoch6->hash ()) .representative (destination.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send1->hash ()) .sign (destination.prv, destination.pub) .work (*pool.generate (epoch6->hash ())) @@ -3728,10 +3728,10 @@ TEST (ledger, epoch_blocks_v2_general) ASSERT_EQ (nano::epoch::epoch_2, receive2->sideband ().details.epoch); ASSERT_EQ (nano::epoch::epoch_1, receive2->sideband ().source_epoch); ASSERT_EQ (0, ledger.any.block_balance (transaction, epoch6->hash ()).value ().number ()); - ASSERT_EQ (nano::Gxrb_ratio, ledger.any.block_balance (transaction, receive2->hash ())); - ASSERT_EQ (nano::Gxrb_ratio, ledger.any.block_amount (transaction, receive2->hash ())); - ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Gxrb_ratio, ledger.weight (nano::dev::genesis_key.pub)); - ASSERT_EQ (nano::Gxrb_ratio, ledger.weight (destination.pub)); + ASSERT_EQ (nano::Knano_ratio, ledger.any.block_balance (transaction, receive2->hash ())); + ASSERT_EQ (nano::Knano_ratio, ledger.any.block_amount (transaction, receive2->hash ())); + ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Knano_ratio, ledger.weight (nano::dev::genesis_key.pub)); + ASSERT_EQ (nano::Knano_ratio, ledger.weight (destination.pub)); } TEST (ledger, epoch_blocks_receive_upgrade) @@ -3748,7 +3748,7 @@ TEST (ledger, epoch_blocks_receive_upgrade) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (destination.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) @@ -3759,7 +3759,7 @@ TEST (ledger, epoch_blocks_receive_upgrade) .account (nano::dev::genesis_key.pub) .previous (send1->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (ledger.epoch_link (nano::epoch::epoch_1)) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (send1->hash ())) @@ -3770,7 +3770,7 @@ TEST (ledger, epoch_blocks_receive_upgrade) .account (nano::dev::genesis_key.pub) .previous (epoch1->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio * 2) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio * 2) .link (destination.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (epoch1->hash ())) @@ -3802,7 +3802,7 @@ TEST (ledger, epoch_blocks_receive_upgrade) .account (destination.pub) .previous (open1->hash ()) .representative (destination.pub) - .balance (nano::Gxrb_ratio * 2) + .balance (nano::Knano_ratio * 2) .link (send2->hash ()) .sign (destination.prv, destination.pub) .work (*pool.generate (open1->hash ())) @@ -3820,7 +3820,7 @@ TEST (ledger, epoch_blocks_receive_upgrade) auto pending_send2 = ledger.any.pending_get (transaction, nano::pending_key (destination.pub, send2->hash ())); ASSERT_TRUE (pending_send2); ASSERT_EQ (nano::dev::genesis_key.pub, pending_send2->source); - ASSERT_EQ (nano::Gxrb_ratio, pending_send2->amount.number ()); + ASSERT_EQ (nano::Knano_ratio, pending_send2->amount.number ()); ASSERT_EQ (nano::epoch::epoch_1, pending_send2->epoch); ASSERT_EQ (nano::block_status::progress, ledger.process (transaction, receive2)); ASSERT_EQ (nano::epoch::epoch_1, receive2->sideband ().details.epoch); @@ -3834,7 +3834,7 @@ TEST (ledger, epoch_blocks_receive_upgrade) .account (destination.pub) .previous (receive2->hash ()) .representative (destination.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (destination2.pub) .sign (destination.prv, destination.pub) .work (*pool.generate (receive2->hash ())) @@ -3856,7 +3856,7 @@ TEST (ledger, epoch_blocks_receive_upgrade) .account (nano::dev::genesis_key.pub) .previous (send2->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio * 2) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio * 2) .link (ledger.epoch_link (nano::epoch::epoch_2)) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (send2->hash ())) @@ -3867,7 +3867,7 @@ TEST (ledger, epoch_blocks_receive_upgrade) .account (nano::dev::genesis_key.pub) .previous (epoch2->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio * 3) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio * 3) .link (destination3.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (epoch2->hash ())) @@ -3888,7 +3888,7 @@ TEST (ledger, epoch_blocks_receive_upgrade) .account (nano::dev::genesis_key.pub) .previous (send4->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio * 4) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio * 4) .link (destination.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (send4->hash ())) @@ -3902,7 +3902,7 @@ TEST (ledger, epoch_blocks_receive_upgrade) .account (destination.pub) .previous (send3->hash ()) .representative (destination.pub) - .balance (nano::Gxrb_ratio * 2) + .balance (nano::Knano_ratio * 2) .link (send5->hash ()) .sign (destination.prv, destination.pub) .work (*pool.generate (send3->hash ())) @@ -3920,7 +3920,7 @@ TEST (ledger, epoch_blocks_receive_upgrade) .account (nano::dev::genesis_key.pub) .previous (send5->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio * 5) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio * 5) .link (destination4.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (send5->hash ())) @@ -4215,7 +4215,7 @@ TEST (ledger, unchecked_epoch) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (destination.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (0) @@ -4226,7 +4226,7 @@ TEST (ledger, unchecked_epoch) .account (destination.pub) .previous (0) .representative (destination.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send1->hash ()) .sign (destination.prv, destination.pub) .work (0) @@ -4237,7 +4237,7 @@ TEST (ledger, unchecked_epoch) .account (destination.pub) .previous (open1->hash ()) .representative (destination.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (node1.ledger.epoch_link (nano::epoch::epoch_1)) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (0) @@ -4275,7 +4275,7 @@ TEST (ledger, unchecked_epoch_invalid) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (destination.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (0) @@ -4286,7 +4286,7 @@ TEST (ledger, unchecked_epoch_invalid) .account (destination.pub) .previous (0) .representative (destination.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send1->hash ()) .sign (destination.prv, destination.pub) .work (0) @@ -4298,7 +4298,7 @@ TEST (ledger, unchecked_epoch_invalid) .account (destination.pub) .previous (open1->hash ()) .representative (destination.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (node1.ledger.epoch_link (nano::epoch::epoch_1)) .sign (destination.prv, destination.pub) .work (0) @@ -4310,7 +4310,7 @@ TEST (ledger, unchecked_epoch_invalid) .account (destination.pub) .previous (open1->hash ()) .representative (destination.pub) - .balance (nano::Gxrb_ratio - 1) + .balance (nano::Knano_ratio - 1) .link (node1.ledger.epoch_link (nano::epoch::epoch_1)) .sign (destination.prv, destination.pub) .work (0) @@ -4357,7 +4357,7 @@ TEST (ledger, unchecked_open) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (destination.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (0) @@ -4409,7 +4409,7 @@ TEST (ledger, unchecked_receive) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (destination.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (0) @@ -4420,7 +4420,7 @@ TEST (ledger, unchecked_receive) .account (nano::dev::genesis_key.pub) .previous (send1->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - 2 * nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - 2 * nano::Knano_ratio) .link (destination.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (0) @@ -4883,7 +4883,7 @@ TEST (ledger, pruning_action) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) @@ -4899,7 +4899,7 @@ TEST (ledger, pruning_action) .account (nano::dev::genesis_key.pub) .previous (send1->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio * 2) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio * 2) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (send1->hash ())) @@ -4926,7 +4926,7 @@ TEST (ledger, pruning_action) .account (nano::dev::genesis_key.pub) .previous (send2->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (send1->hash ()) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (send2->hash ())) @@ -4973,7 +4973,7 @@ TEST (ledger, pruning_large_chain) .account (nano::dev::genesis_key.pub) .previous (last_hash) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (last_hash)) @@ -5036,7 +5036,7 @@ TEST (ledger, pruning_source_rollback) .account (nano::dev::genesis_key.pub) .previous (epoch1->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (epoch1->hash ())) @@ -5048,7 +5048,7 @@ TEST (ledger, pruning_source_rollback) .account (nano::dev::genesis_key.pub) .previous (send1->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio * 2) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio * 2) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (send1->hash ())) @@ -5066,7 +5066,7 @@ TEST (ledger, pruning_source_rollback) auto info = ledger.any.pending_get (transaction, nano::pending_key (nano::dev::genesis_key.pub, send1->hash ())); ASSERT_TRUE (info); ASSERT_EQ (nano::dev::genesis_key.pub, info->source); - ASSERT_EQ (nano::Gxrb_ratio, info->amount.number ()); + ASSERT_EQ (nano::Knano_ratio, info->amount.number ()); ASSERT_EQ (nano::epoch::epoch_1, info->epoch); // Receiving pruned block auto receive1 = builder @@ -5074,7 +5074,7 @@ TEST (ledger, pruning_source_rollback) .account (nano::dev::genesis_key.pub) .previous (send2->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (send1->hash ()) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (send2->hash ())) @@ -5088,7 +5088,7 @@ TEST (ledger, pruning_source_rollback) auto info2 = ledger.any.pending_get (transaction, nano::pending_key (nano::dev::genesis_key.pub, send1->hash ())); ASSERT_TRUE (info2); ASSERT_NE (nano::dev::genesis_key.pub, info2->source); // Tradeoff to not store pruned blocks accounts - ASSERT_EQ (nano::Gxrb_ratio, info2->amount.number ()); + ASSERT_EQ (nano::Knano_ratio, info2->amount.number ()); ASSERT_EQ (nano::epoch::epoch_1, info2->epoch); // Process receive block again ASSERT_EQ (nano::block_status::progress, ledger.process (transaction, receive1)); @@ -5113,7 +5113,7 @@ TEST (ledger, pruning_source_rollback_legacy) .send () .previous (nano::dev::genesis->hash ()) .destination (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) .build (); @@ -5124,7 +5124,7 @@ TEST (ledger, pruning_source_rollback_legacy) .send () .previous (send1->hash ()) .destination (key1.pub) - .balance (nano::dev::constants.genesis_amount - 2 * nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - 2 * nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (send1->hash ())) .build (); @@ -5135,7 +5135,7 @@ TEST (ledger, pruning_source_rollback_legacy) .send () .previous (send2->hash ()) .destination (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - 3 * nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - 3 * nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (send2->hash ())) .build (); @@ -5153,12 +5153,12 @@ TEST (ledger, pruning_source_rollback_legacy) auto info1 = ledger.any.pending_get (transaction, nano::pending_key (nano::dev::genesis_key.pub, send1->hash ())); ASSERT_TRUE (info1); ASSERT_EQ (nano::dev::genesis_key.pub, info1->source); - ASSERT_EQ (nano::Gxrb_ratio, info1->amount.number ()); + ASSERT_EQ (nano::Knano_ratio, info1->amount.number ()); ASSERT_EQ (nano::epoch::epoch_0, info1->epoch); auto info2 = ledger.any.pending_get (transaction, nano::pending_key (key1.pub, send2->hash ())); ASSERT_TRUE (info2); ASSERT_EQ (nano::dev::genesis_key.pub, info2->source); - ASSERT_EQ (nano::Gxrb_ratio, info2->amount.number ()); + ASSERT_EQ (nano::Knano_ratio, info2->amount.number ()); ASSERT_EQ (nano::epoch::epoch_0, info2->epoch); // Receiving pruned block auto receive1 = builder @@ -5177,7 +5177,7 @@ TEST (ledger, pruning_source_rollback_legacy) auto info3 = ledger.any.pending_get (transaction, nano::pending_key (nano::dev::genesis_key.pub, send1->hash ())); ASSERT_TRUE (info3); ASSERT_NE (nano::dev::genesis_key.pub, info3->source); // Tradeoff to not store pruned blocks accounts - ASSERT_EQ (nano::Gxrb_ratio, info3->amount.number ()); + ASSERT_EQ (nano::Knano_ratio, info3->amount.number ()); ASSERT_EQ (nano::epoch::epoch_0, info3->epoch); // Process receive block again ASSERT_EQ (nano::block_status::progress, ledger.process (transaction, receive1)); @@ -5202,7 +5202,7 @@ TEST (ledger, pruning_source_rollback_legacy) auto info4 = ledger.any.pending_get (transaction, nano::pending_key (key1.pub, send2->hash ())); ASSERT_TRUE (info4); ASSERT_NE (nano::dev::genesis_key.pub, info4->source); // Tradeoff to not store pruned blocks accounts - ASSERT_EQ (nano::Gxrb_ratio, info4->amount.number ()); + ASSERT_EQ (nano::Knano_ratio, info4->amount.number ()); ASSERT_EQ (nano::epoch::epoch_0, info4->epoch); // Process open block again ASSERT_EQ (nano::block_status::progress, ledger.process (transaction, open1)); @@ -5228,7 +5228,7 @@ TEST (ledger, pruning_legacy_blocks) .send () .previous (nano::dev::genesis->hash ()) .destination (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) .build (); @@ -5254,7 +5254,7 @@ TEST (ledger, pruning_legacy_blocks) .send () .previous (change1->hash ()) .destination (key1.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (change1->hash ())) .build (); @@ -5315,7 +5315,7 @@ TEST (ledger, pruning_safe_functions) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) @@ -5327,7 +5327,7 @@ TEST (ledger, pruning_safe_functions) .account (nano::dev::genesis_key.pub) .previous (send1->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio * 2) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio * 2) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (send1->hash ())) @@ -5344,7 +5344,7 @@ TEST (ledger, pruning_safe_functions) ASSERT_TRUE (ledger.any.block_exists (transaction, send2->hash ())); // Safe ledger actions ASSERT_FALSE (ledger.any.block_balance (transaction, send1->hash ())); - ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Gxrb_ratio * 2, ledger.any.block_balance (transaction, send2->hash ()).value ().number ()); + ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Knano_ratio * 2, ledger.any.block_balance (transaction, send2->hash ()).value ().number ()); ASSERT_FALSE (ledger.any.block_amount (transaction, send2->hash ())); ASSERT_FALSE (ledger.any.block_account (transaction, send1->hash ())); ASSERT_EQ (nano::dev::genesis_key.pub, ledger.any.block_account (transaction, send2->hash ()).value ()); @@ -5367,7 +5367,7 @@ TEST (ledger, hash_root_random) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) @@ -5379,7 +5379,7 @@ TEST (ledger, hash_root_random) .account (nano::dev::genesis_key.pub) .previous (send1->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio * 2) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio * 2) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (send1->hash ())) @@ -5666,7 +5666,7 @@ TEST (ledger_receivable, upper_bound_account_key) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*ctx.pool ().generate (nano::dev::genesis->hash ())) @@ -5677,7 +5677,7 @@ TEST (ledger_receivable, upper_bound_account_key) .account (nano::dev::genesis_key.pub) .previous (send1->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - 2 * nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - 2 * nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*ctx.pool ().generate (send1->hash ())) @@ -5714,7 +5714,7 @@ TEST (ledger_receivable, key_two) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*ctx.pool ().generate (nano::dev::genesis->hash ())) @@ -5725,7 +5725,7 @@ TEST (ledger_receivable, key_two) .account (nano::dev::genesis_key.pub) .previous (send1->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - 2 * nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - 2 * nano::Knano_ratio) .link (key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*ctx.pool ().generate (send1->hash ())) @@ -5759,7 +5759,7 @@ TEST (ledger_receivable, any_one) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*ctx.pool ().generate (nano::dev::genesis->hash ())) @@ -5779,7 +5779,7 @@ TEST (ledger_transaction, write_refresh) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*ctx.pool ().generate (nano::dev::genesis->hash ())) @@ -5789,7 +5789,7 @@ TEST (ledger_transaction, write_refresh) .account (nano::dev::genesis_key.pub) .previous (send1->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - 2 * nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - 2 * nano::Knano_ratio) .link (key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*ctx.pool ().generate (send1->hash ())) diff --git a/nano/core_test/ledger_confirm.cpp b/nano/core_test/ledger_confirm.cpp index 65f351bacc..f1941d5497 100644 --- a/nano/core_test/ledger_confirm.cpp +++ b/nano/core_test/ledger_confirm.cpp @@ -460,7 +460,7 @@ TEST (ledger_confirm, all_block_types) .send () .previous (latest) .destination (key1.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (latest)) .build (); @@ -468,7 +468,7 @@ TEST (ledger_confirm, all_block_types) .send () .previous (send->hash ()) .destination (key2.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio * 2) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio * 2) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (send->hash ())) .build (); @@ -486,7 +486,7 @@ TEST (ledger_confirm, all_block_types) .account (key2.pub) .previous (0) .representative (0) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send1->hash ()) .sign (key2.prv, key2.pub) .work (*system.work.generate (key2.pub)) @@ -505,7 +505,7 @@ TEST (ledger_confirm, all_block_types) .account (key2.pub) .previous (state_open->hash ()) .representative (0) - .balance (nano::Gxrb_ratio * 2) + .balance (nano::Knano_ratio * 2) .link (send2->hash ()) .sign (key2.prv, key2.pub) .work (*system.work.generate (state_open->hash ())) @@ -516,7 +516,7 @@ TEST (ledger_confirm, all_block_types) .account (key2.pub) .previous (state_receive->hash ()) .representative (0) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (key1.pub) .sign (key2.prv, key2.pub) .work (*system.work.generate (state_receive->hash ())) @@ -542,7 +542,7 @@ TEST (ledger_confirm, all_block_types) .account (key2.pub) .previous (state_send->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (0) .sign (key2.prv, key2.pub) .work (*system.work.generate (state_send->hash ())) @@ -553,7 +553,7 @@ TEST (ledger_confirm, all_block_types) .account (key2.pub) .previous (state_change->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (node->ledger.epoch_link (nano::epoch::epoch_1)) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (state_change->hash ())) @@ -564,7 +564,7 @@ TEST (ledger_confirm, all_block_types) .account (key1.pub) .previous (change->hash ()) .representative (key2.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (node->ledger.epoch_link (nano::epoch::epoch_1)) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (change->hash ())) @@ -574,7 +574,7 @@ TEST (ledger_confirm, all_block_types) .account (key1.pub) .previous (epoch1->hash ()) .representative (0) - .balance (nano::Gxrb_ratio - 1) + .balance (nano::Knano_ratio - 1) .link (key2.pub) .sign (key1.prv, key1.pub) .work (*system.work.generate (epoch1->hash ())) @@ -584,7 +584,7 @@ TEST (ledger_confirm, all_block_types) .account (key2.pub) .previous (epoch->hash ()) .representative (0) - .balance (nano::Gxrb_ratio + 1) + .balance (nano::Knano_ratio + 1) .link (state_send1->hash ()) .sign (key2.prv, key2.pub) .work (*system.work.generate (epoch->hash ())) @@ -595,7 +595,7 @@ TEST (ledger_confirm, all_block_types) .account (key2.pub) .previous (state_receive2->hash ()) .representative (0) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (key1.pub) .sign (key2.prv, key2.pub) .work (*system.work.generate (state_receive2->hash ())) @@ -605,7 +605,7 @@ TEST (ledger_confirm, all_block_types) .account (key2.pub) .previous (state_send2->hash ()) .representative (0) - .balance (nano::Gxrb_ratio - 1) + .balance (nano::Knano_ratio - 1) .link (key1.pub) .sign (key2.prv, key2.pub) .work (*system.work.generate (state_send2->hash ())) @@ -616,7 +616,7 @@ TEST (ledger_confirm, all_block_types) .account (key1.pub) .previous (state_send1->hash ()) .representative (0) - .balance (nano::Gxrb_ratio - 2) + .balance (nano::Knano_ratio - 2) .link (nano::dev::genesis_key.pub) .sign (key1.prv, key1.pub) .work (*system.work.generate (state_send1->hash ())) @@ -626,7 +626,7 @@ TEST (ledger_confirm, all_block_types) .account (nano::dev::genesis_key.pub) .previous (send1->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio * 2 + 1) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio * 2 + 1) .link (state_send4->hash ()) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (send1->hash ())) @@ -763,7 +763,7 @@ TEST (ledger_confirm, election_winner_details_clearing_node_process_confirmed) .send () .previous (nano::dev::genesis->hash ()) .destination (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (nano::dev::genesis->hash ())) .build (); @@ -876,7 +876,7 @@ TEST (ledger_confirmDeathTest, rollback_added_block) .send () .previous (nano::dev::genesis->hash ()) .destination (key1.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*pool.generate (nano::dev::genesis->hash ())) .build (); diff --git a/nano/core_test/network_filter.cpp b/nano/core_test/network_filter.cpp index a886ae9564..be24fc2a5f 100644 --- a/nano/core_test/network_filter.cpp +++ b/nano/core_test/network_filter.cpp @@ -42,7 +42,7 @@ TEST (network_filter, unit) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - 10 * nano::xrb_ratio) + .balance (nano::dev::constants.genesis_amount - 1000 * nano::raw_ratio) .link (nano::public_key ()) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (0) @@ -71,7 +71,7 @@ TEST (network_filter, many) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - i * 10 * nano::xrb_ratio) + .balance (nano::dev::constants.genesis_amount - i * 1000 * nano::raw_ratio) .link (key1.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (0) diff --git a/nano/core_test/node.cpp b/nano/core_test/node.cpp index 7a3ea364bb..07ac81cecc 100644 --- a/nano/core_test/node.cpp +++ b/nano/core_test/node.cpp @@ -232,7 +232,7 @@ TEST (node, node_receive_quorum) auto send = nano::send_block_builder () .previous (previous) .destination (key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (previous)) .build (); @@ -482,13 +482,13 @@ TEST (node, working) TEST (node, price) { nano::test::system system (1); - auto price1 (system.nodes[0]->price (nano::Gxrb_ratio, 1)); + auto price1 (system.nodes[0]->price (nano::Knano_ratio, 1)); ASSERT_EQ (nano::node::price_max * 100.0, price1); - auto price2 (system.nodes[0]->price (nano::Gxrb_ratio * int (nano::node::free_cutoff + 1), 1)); + auto price2 (system.nodes[0]->price (nano::Knano_ratio * int (nano::node::free_cutoff + 1), 1)); ASSERT_EQ (0, price2); - auto price3 (system.nodes[0]->price (nano::Gxrb_ratio * int (nano::node::free_cutoff + 2) / 2, 1)); + auto price3 (system.nodes[0]->price (nano::Knano_ratio * int (nano::node::free_cutoff + 2) / 2, 1)); ASSERT_EQ (nano::node::price_max * 100.0 / 2, price3); - auto price4 (system.nodes[0]->price (nano::Gxrb_ratio * int (nano::node::free_cutoff) * 2, 1)); + auto price4 (system.nodes[0]->price (nano::Knano_ratio * int (nano::node::free_cutoff) * 2, 1)); ASSERT_EQ (0, price4); } @@ -799,7 +799,7 @@ TEST (node, fork_bootstrap_flip) auto send1 = builder.make_block () .previous (latest) .destination (key1.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (latest)) .build (); @@ -807,7 +807,7 @@ TEST (node, fork_bootstrap_flip) auto send2 = builder.make_block () .previous (latest) .destination (key2.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (latest)) .build (); @@ -1133,7 +1133,7 @@ TEST (node, DISABLED_fork_stale) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Mxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::nano_ratio) .link (key1.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (0) @@ -1150,7 +1150,7 @@ TEST (node, DISABLED_fork_stale) .account (nano::dev::genesis_key.pub) .previous (send3->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - 2 * nano::Mxrb_ratio) + .balance (nano::dev::constants.genesis_amount - 2 * nano::nano_ratio) .link (key1.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (0) @@ -1160,7 +1160,7 @@ TEST (node, DISABLED_fork_stale) .account (nano::dev::genesis_key.pub) .previous (send3->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - 2 * nano::Mxrb_ratio) + .balance (nano::dev::constants.genesis_amount - 2 * nano::nano_ratio) .link (key2.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (0) @@ -1210,7 +1210,7 @@ TEST (node, DISABLED_broadcast_elected) auto fund_big = builder.send () .previous (nano::dev::genesis->hash ()) .destination (rep_big.pub) - .balance (nano::Gxrb_ratio * 5) + .balance (nano::Knano_ratio * 5) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (nano::dev::genesis->hash ())) .build (); @@ -1224,7 +1224,7 @@ TEST (node, DISABLED_broadcast_elected) auto fund_small = builder.send () .previous (fund_big->hash ()) .destination (rep_small.pub) - .balance (nano::Gxrb_ratio * 2) + .balance (nano::Knano_ratio * 2) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (fund_big->hash ())) .build (); @@ -1238,7 +1238,7 @@ TEST (node, DISABLED_broadcast_elected) auto fund_other = builder.send () .previous (fund_small->hash ()) .destination (rep_other.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (fund_small->hash ())) .build (); @@ -1563,13 +1563,13 @@ 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_key.pub, key2.pub, 2 * nano::Mxrb_ratio); + auto send1 = wallet1->send_action (nano::dev::genesis_key.pub, key2.pub, 2 * nano::nano_ratio); ASSERT_TIMELY (5s, node1.block_confirmed (send1->hash ())); ASSERT_TIMELY (5s, node2.block_confirmed (send1->hash ())); // wait until receive1 (auto-receive created by wallet) is cemented ASSERT_TIMELY_EQ (5s, node2.ledger.confirmed.account_height (node2.ledger.tx_begin_read (), key2.pub), 1); - ASSERT_EQ (node2.balance (key2.pub), 2 * nano::Mxrb_ratio); + ASSERT_EQ (node2.balance (key2.pub), 2 * nano::nano_ratio); auto recv1 = node2.ledger.find_receive_block_by_send_hash (node2.ledger.tx_begin_read (), key2.pub, send1->hash ()); // create send2 to send from node2 to node1 and save it to node2's ledger without triggering an election (node1 does not hear about it) @@ -1578,14 +1578,14 @@ TEST (node, unconfirmed_send) .account (key2.pub) .previous (recv1->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::Mxrb_ratio) + .balance (nano::nano_ratio) .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_key.pub, nano::Mxrb_ratio); + auto send3 = wallet2->send_action (key2.pub, nano::dev::genesis_key.pub, nano::nano_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 ())); @@ -1610,7 +1610,7 @@ TEST (node, no_voting) nano::keypair key1; wallet1->insert_adhoc (key1.prv); // Broadcast a confirm so others should know this is a rep node - wallet1->send_action (nano::dev::genesis_key.pub, key1.pub, nano::Mxrb_ratio); + wallet1->send_action (nano::dev::genesis_key.pub, key1.pub, nano::nano_ratio); ASSERT_TIMELY (10s, node0.active.empty ()); ASSERT_EQ (0, node0.stats.count (nano::stat::type::message, nano::stat::detail::confirm_ack, nano::stat::dir::in)); } @@ -1740,7 +1740,7 @@ TEST (node, online_reps_election) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node1.work_generate_blocking (nano::dev::genesis->hash ())) @@ -1751,7 +1751,7 @@ TEST (node, online_reps_election) auto vote = std::make_shared (nano::dev::genesis_key.pub, nano::dev::genesis_key.prv, nano::milliseconds_since_epoch (), 0, std::vector{ send1->hash () }); ASSERT_EQ (0, node1.online_reps.online ()); node1.vote_processor.vote_blocking (vote, std::make_shared (node1)); - ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Gxrb_ratio, node1.online_reps.online ()); + ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Knano_ratio, node1.online_reps.online ()); } TEST (node, block_confirm) @@ -1767,7 +1767,7 @@ TEST (node, block_confirm) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node1.work_generate_blocking (nano::dev::genesis->hash ())) @@ -1798,7 +1798,7 @@ TEST (node, confirm_quorum) auto & node1 = *system.nodes[0]; system.wallet (0)->insert_adhoc (nano::dev::genesis_key.prv); // Put greater than node.delta () in pending so quorum can't be reached - nano::amount new_balance = node1.online_reps.delta () - nano::Gxrb_ratio; + nano::amount new_balance = node1.online_reps.delta () - nano::Knano_ratio; auto send1 = nano::state_block_builder () .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) @@ -1831,7 +1831,7 @@ TEST (node, DISABLED_local_votes_cache) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node.work_generate_blocking (nano::dev::genesis->hash ())) @@ -1840,7 +1840,7 @@ TEST (node, DISABLED_local_votes_cache) .account (nano::dev::genesis_key.pub) .previous (send1->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - 2 * nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - 2 * nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node.work_generate_blocking (send1->hash ())) @@ -1849,7 +1849,7 @@ TEST (node, DISABLED_local_votes_cache) .account (nano::dev::genesis_key.pub) .previous (send2->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - 3 * nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - 3 * nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node.work_generate_blocking (send2->hash ())) @@ -1916,7 +1916,7 @@ TEST (node, DISABLED_local_votes_cache_batch) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key1.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node.work_generate_blocking (nano::dev::genesis->hash ())) @@ -1928,7 +1928,7 @@ TEST (node, DISABLED_local_votes_cache_batch) .account (nano::dev::genesis_key.pub) .previous (send1->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - 2 * nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - 2 * nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node.work_generate_blocking (send1->hash ())) @@ -1938,7 +1938,7 @@ TEST (node, DISABLED_local_votes_cache_batch) .account (key1.pub) .previous (0) .representative (nano::dev::genesis_key.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send1->hash ()) .sign (key1.prv, key1.pub) .work (*node.work_generate_blocking (key1.pub)) @@ -2002,7 +2002,7 @@ TEST (node, DISABLED_local_votes_cache_generate_new_vote) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node.work_generate_blocking (nano::dev::genesis->hash ())) @@ -2042,7 +2042,7 @@ TEST (node, DISABLED_local_votes_cache_fork) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node1.work_generate_blocking (nano::dev::genesis->hash ())) @@ -2051,7 +2051,7 @@ TEST (node, DISABLED_local_votes_cache_fork) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - 2 * nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - 2 * nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node1.work_generate_blocking (nano::dev::genesis->hash ())) @@ -2429,7 +2429,7 @@ TEST (node, fork_election_invalid_block_signature) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .work (*system.work.generate (nano::dev::genesis->hash ())) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) @@ -2438,7 +2438,7 @@ TEST (node, fork_election_invalid_block_signature) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - 2 * nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - 2 * nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .work (*system.work.generate (nano::dev::genesis->hash ())) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) @@ -2447,7 +2447,7 @@ TEST (node, fork_election_invalid_block_signature) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - 2 * nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - 2 * nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .work (*system.work.generate (nano::dev::genesis->hash ())) .sign (nano::dev::genesis_key.prv, 0) // Invalid signature @@ -2479,7 +2479,7 @@ TEST (node, block_processor_signatures) .account (nano::dev::genesis_key.pub) .previous (latest) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key1.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node1.work_generate_blocking (latest)) @@ -2488,7 +2488,7 @@ TEST (node, block_processor_signatures) .account (nano::dev::genesis_key.pub) .previous (send1->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - 2 * nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - 2 * nano::Knano_ratio) .link (key2.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node1.work_generate_blocking (send1->hash ())) @@ -2497,7 +2497,7 @@ TEST (node, block_processor_signatures) .account (nano::dev::genesis_key.pub) .previous (send2->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - 3 * nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - 3 * nano::Knano_ratio) .link (key3.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node1.work_generate_blocking (send2->hash ())) @@ -2507,7 +2507,7 @@ TEST (node, block_processor_signatures) .account (nano::dev::genesis_key.pub) .previous (send3->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - 4 * nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - 4 * nano::Knano_ratio) .link (key3.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node1.work_generate_blocking (send3->hash ())) @@ -2518,7 +2518,7 @@ TEST (node, block_processor_signatures) .account (nano::dev::genesis_key.pub) .previous (send3->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - 5 * nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - 5 * nano::Knano_ratio) .link (key3.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node1.work_generate_blocking (send3->hash ())) @@ -2530,7 +2530,7 @@ TEST (node, block_processor_signatures) .account (key1.pub) .previous (0) .representative (nano::dev::genesis_key.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send1->hash ()) .sign (key1.prv, key1.pub) .work (*node1.work_generate_blocking (key1.pub)) @@ -2539,7 +2539,7 @@ TEST (node, block_processor_signatures) .account (key2.pub) .previous (0) .representative (nano::dev::genesis_key.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send2->hash ()) .sign (key2.prv, key2.pub) .work (*node1.work_generate_blocking (key2.pub)) @@ -2549,7 +2549,7 @@ TEST (node, block_processor_signatures) .account (key3.pub) .previous (0) .representative (nano::dev::genesis_key.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send3->hash ()) .sign (key2.prv, key3.pub) .work (*node1.work_generate_blocking (key3.pub)) @@ -2581,7 +2581,7 @@ TEST (node, block_processor_reject_state) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node.work_generate_blocking (nano::dev::genesis->hash ())) @@ -2595,7 +2595,7 @@ TEST (node, block_processor_reject_state) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - 2 * nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - 2 * nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node.work_generate_blocking (nano::dev::genesis->hash ())) @@ -2815,7 +2815,7 @@ TEST (node, bidirectional_tcp) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node1->work_generate_blocking (nano::dev::genesis->hash ())) @@ -2848,7 +2848,7 @@ TEST (node, bidirectional_tcp) .account (nano::dev::genesis_key.pub) .previous (send1->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - 2 * nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - 2 * nano::Knano_ratio) .link (key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node1->work_generate_blocking (send1->hash ())) @@ -3559,7 +3559,7 @@ TEST (node, pruning_automatic) auto send1 = builder.make_block () .previous (latest_hash) .destination (key1.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (latest_hash)) .build (); @@ -3611,7 +3611,7 @@ TEST (node, DISABLED_pruning_age) auto send1 = builder.make_block () .previous (latest_hash) .destination (key1.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (latest_hash)) .build (); @@ -3672,7 +3672,7 @@ TEST (node, DISABLED_pruning_depth) auto send1 = builder.make_block () .previous (latest_hash) .destination (key1.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (latest_hash)) .build (); @@ -3759,7 +3759,7 @@ TEST (node, process_local_overflow) auto send1 = builder.make_block () .previous (latest_hash) .destination (key1.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (latest_hash)) .build (); @@ -3787,7 +3787,7 @@ TEST (node, local_block_broadcast) auto send1 = builder.make_block () .previous (latest_hash) .destination (key1.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (latest_hash)) .build (); diff --git a/nano/core_test/request_aggregator.cpp b/nano/core_test/request_aggregator.cpp index f25f5185f8..b0da7dd3b6 100644 --- a/nano/core_test/request_aggregator.cpp +++ b/nano/core_test/request_aggregator.cpp @@ -29,7 +29,7 @@ TEST (request_aggregator, one) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node.work_generate_blocking (nano::dev::genesis->hash ())) @@ -78,7 +78,7 @@ TEST (request_aggregator, one_update) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .link (key1.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) @@ -90,7 +90,7 @@ TEST (request_aggregator, one_update) .account (nano::dev::genesis_key.pub) .previous (send1->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - 2 * nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - 2 * nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node.work_generate_blocking (send1->hash ())) @@ -101,7 +101,7 @@ TEST (request_aggregator, one_update) .account (key1.pub) .previous (0) .representative (nano::dev::genesis_key.pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (send1->hash ()) .sign (key1.prv, key1.pub) .work (*node.work_generate_blocking (key1.pub)) @@ -328,7 +328,7 @@ TEST (request_aggregator, channel_max_queue) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node.work_generate_blocking (nano::dev::genesis->hash ())) @@ -357,7 +357,7 @@ TEST (request_aggregator, DISABLED_unique) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (nano::dev::genesis_key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*node.work_generate_blocking (nano::dev::genesis->hash ())) diff --git a/nano/core_test/scheduler_buckets.cpp b/nano/core_test/scheduler_buckets.cpp index e17d2cb50c..a664fc881b 100644 --- a/nano/core_test/scheduler_buckets.cpp +++ b/nano/core_test/scheduler_buckets.cpp @@ -53,7 +53,7 @@ std::shared_ptr & block0 () .account (key0 ().pub) .previous (0) .representative (key0 ().pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (0) .sign (key0 ().prv, key0 ().pub) .work (0) @@ -68,7 +68,7 @@ std::shared_ptr & block1 () .account (key1 ().pub) .previous (0) .representative (key1 ().pub) - .balance (nano::Mxrb_ratio) + .balance (nano::nano_ratio) .link (0) .sign (key1 ().prv, key1 ().pub) .work (0) @@ -83,7 +83,7 @@ std::shared_ptr & block2 () .account (key2 ().pub) .previous (0) .representative (key2 ().pub) - .balance (nano::Gxrb_ratio) + .balance (nano::Knano_ratio) .link (0) .sign (key2 ().prv, key2 ().pub) .work (0) @@ -98,7 +98,7 @@ std::shared_ptr & block3 () .account (key3 ().pub) .previous (0) .representative (key3 ().pub) - .balance (nano::Mxrb_ratio) + .balance (nano::nano_ratio) .link (0) .sign (key3 ().prv, key3 ().pub) .work (0) @@ -118,7 +118,7 @@ TEST (buckets, construction) TEST (buckets, insert_Gxrb) { nano::scheduler::buckets buckets; - buckets.push (1000, block0 (), nano::Gxrb_ratio); + buckets.push (1000, block0 (), nano::Knano_ratio); ASSERT_EQ (1, buckets.size ()); ASSERT_EQ (1, buckets.bucket_size (49)); } @@ -126,7 +126,7 @@ TEST (buckets, insert_Gxrb) TEST (buckets, insert_Mxrb) { nano::scheduler::buckets buckets; - buckets.push (1000, block1 (), nano::Mxrb_ratio); + buckets.push (1000, block1 (), nano::nano_ratio); ASSERT_EQ (1, buckets.size ()); ASSERT_EQ (1, buckets.bucket_size (14)); } @@ -135,8 +135,8 @@ TEST (buckets, insert_Mxrb) TEST (buckets, insert_same_priority) { nano::scheduler::buckets buckets; - buckets.push (1000, block0 (), nano::Gxrb_ratio); - buckets.push (1000, block2 (), nano::Gxrb_ratio); + buckets.push (1000, block0 (), nano::Knano_ratio); + buckets.push (1000, block2 (), nano::Knano_ratio); ASSERT_EQ (2, buckets.size ()); ASSERT_EQ (2, buckets.bucket_size (49)); } @@ -145,8 +145,8 @@ TEST (buckets, insert_same_priority) TEST (buckets, insert_duplicate) { nano::scheduler::buckets buckets; - buckets.push (1000, block0 (), nano::Gxrb_ratio); - buckets.push (1000, block0 (), nano::Gxrb_ratio); + buckets.push (1000, block0 (), nano::Knano_ratio); + buckets.push (1000, block0 (), nano::Knano_ratio); ASSERT_EQ (1, buckets.size ()); ASSERT_EQ (1, buckets.bucket_size (49)); } @@ -154,8 +154,8 @@ TEST (buckets, insert_duplicate) TEST (buckets, insert_older) { nano::scheduler::buckets buckets; - buckets.push (1000, block0 (), nano::Gxrb_ratio); - buckets.push (1100, block2 (), nano::Gxrb_ratio); + buckets.push (1000, block0 (), nano::Knano_ratio); + buckets.push (1100, block2 (), nano::Knano_ratio); ASSERT_EQ (block0 (), buckets.top ()); buckets.pop (); ASSERT_EQ (block2 (), buckets.top ()); @@ -166,7 +166,7 @@ TEST (buckets, pop) { nano::scheduler::buckets buckets; ASSERT_TRUE (buckets.empty ()); - buckets.push (1000, block0 (), nano::Gxrb_ratio); + buckets.push (1000, block0 (), nano::Knano_ratio); ASSERT_FALSE (buckets.empty ()); buckets.pop (); ASSERT_TRUE (buckets.empty ()); @@ -175,15 +175,15 @@ TEST (buckets, pop) TEST (buckets, top_one) { nano::scheduler::buckets buckets; - buckets.push (1000, block0 (), nano::Gxrb_ratio); + buckets.push (1000, block0 (), nano::Knano_ratio); ASSERT_EQ (block0 (), buckets.top ()); } TEST (buckets, top_two) { nano::scheduler::buckets buckets; - buckets.push (1000, block0 (), nano::Gxrb_ratio); - buckets.push (1, block1 (), nano::Mxrb_ratio); + buckets.push (1000, block0 (), nano::Knano_ratio); + buckets.push (1, block1 (), nano::nano_ratio); ASSERT_EQ (block0 (), buckets.top ()); buckets.pop (); ASSERT_EQ (block1 (), buckets.top ()); @@ -196,9 +196,9 @@ TEST (buckets, top_round_robin) nano::scheduler::buckets buckets; buckets.push (1000, blockzero (), 0); ASSERT_EQ (blockzero (), buckets.top ()); - buckets.push (1000, block0 (), nano::Gxrb_ratio); - buckets.push (1000, block1 (), nano::Mxrb_ratio); - buckets.push (1100, block3 (), nano::Mxrb_ratio); + buckets.push (1000, block0 (), nano::Knano_ratio); + buckets.push (1000, block1 (), nano::nano_ratio); + buckets.push (1100, block3 (), nano::nano_ratio); buckets.pop (); // blockzero EXPECT_EQ (block1 (), buckets.top ()); buckets.pop (); @@ -212,8 +212,8 @@ TEST (buckets, top_round_robin) TEST (buckets, trim_normal) { nano::scheduler::buckets buckets{ 1 }; - buckets.push (1000, block0 (), nano::Gxrb_ratio); - buckets.push (1100, block2 (), nano::Gxrb_ratio); + buckets.push (1000, block0 (), nano::Knano_ratio); + buckets.push (1100, block2 (), nano::Knano_ratio); ASSERT_EQ (1, buckets.size ()); ASSERT_EQ (block0 (), buckets.top ()); } @@ -221,8 +221,8 @@ TEST (buckets, trim_normal) TEST (buckets, trim_reverse) { nano::scheduler::buckets buckets{ 1 }; - buckets.push (1100, block2 (), nano::Gxrb_ratio); - buckets.push (1000, block0 (), nano::Gxrb_ratio); + buckets.push (1100, block2 (), nano::Knano_ratio); + buckets.push (1000, block0 (), nano::Knano_ratio); ASSERT_EQ (1, buckets.size ()); ASSERT_EQ (block0 (), buckets.top ()); } @@ -230,11 +230,11 @@ TEST (buckets, trim_reverse) TEST (buckets, trim_even) { nano::scheduler::buckets buckets{ 2 }; - buckets.push (1000, block0 (), nano::Gxrb_ratio); - buckets.push (1100, block2 (), nano::Gxrb_ratio); + buckets.push (1000, block0 (), nano::Knano_ratio); + buckets.push (1100, block2 (), nano::Knano_ratio); ASSERT_EQ (1, buckets.size ()); ASSERT_EQ (block0 (), buckets.top ()); - buckets.push (1000, block1 (), nano::Mxrb_ratio); + buckets.push (1000, block1 (), nano::nano_ratio); ASSERT_EQ (2, buckets.size ()); ASSERT_EQ (block0 (), buckets.top ()); buckets.pop (); diff --git a/nano/core_test/system.cpp b/nano/core_test/system.cpp index fc393a8f49..2072fe8cf9 100644 --- a/nano/core_test/system.cpp +++ b/nano/core_test/system.cpp @@ -168,10 +168,10 @@ TEST (system, rep_initialize_one_reserve) { nano::test::system system; nano::keypair key; - system.ledger_initialization_set ({ key }, nano::Gxrb_ratio); + system.ledger_initialization_set ({ key }, nano::Knano_ratio); auto node = system.add_node (); - ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Gxrb_ratio, node->balance (key.pub)); - ASSERT_EQ (nano::Gxrb_ratio, node->balance (nano::dev::genesis_key.pub)); + ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Knano_ratio, node->balance (key.pub)); + ASSERT_EQ (nano::Knano_ratio, node->balance (nano::dev::genesis_key.pub)); } TEST (system, rep_initialize_two_reserve) @@ -179,10 +179,10 @@ TEST (system, rep_initialize_two_reserve) nano::test::system system; nano::keypair key0; nano::keypair key1; - system.ledger_initialization_set ({ key0, key1 }, nano::Gxrb_ratio); + system.ledger_initialization_set ({ key0, key1 }, nano::Knano_ratio); auto node = system.add_node (); - ASSERT_EQ ((nano::dev::constants.genesis_amount - nano::Gxrb_ratio) / 2, node->balance (key0.pub)); - ASSERT_EQ ((nano::dev::constants.genesis_amount - nano::Gxrb_ratio) / 2, node->balance (key1.pub)); + ASSERT_EQ ((nano::dev::constants.genesis_amount - nano::Knano_ratio) / 2, node->balance (key0.pub)); + ASSERT_EQ ((nano::dev::constants.genesis_amount - nano::Knano_ratio) / 2, node->balance (key1.pub)); } TEST (system, rep_initialize_many) @@ -190,13 +190,13 @@ TEST (system, rep_initialize_many) nano::test::system system; nano::keypair key0; nano::keypair key1; - system.ledger_initialization_set ({ key0, key1 }, nano::Gxrb_ratio); + system.ledger_initialization_set ({ key0, key1 }, nano::Knano_ratio); auto node0 = system.add_node (); - ASSERT_EQ ((nano::dev::constants.genesis_amount - nano::Gxrb_ratio) / 2, node0->balance (key0.pub)); - ASSERT_EQ ((nano::dev::constants.genesis_amount - nano::Gxrb_ratio) / 2, node0->balance (key1.pub)); + ASSERT_EQ ((nano::dev::constants.genesis_amount - nano::Knano_ratio) / 2, node0->balance (key0.pub)); + ASSERT_EQ ((nano::dev::constants.genesis_amount - nano::Knano_ratio) / 2, node0->balance (key1.pub)); auto node1 = system.add_node (); - ASSERT_EQ ((nano::dev::constants.genesis_amount - nano::Gxrb_ratio) / 2, node1->balance (key0.pub)); - ASSERT_EQ ((nano::dev::constants.genesis_amount - nano::Gxrb_ratio) / 2, node1->balance (key1.pub)); + ASSERT_EQ ((nano::dev::constants.genesis_amount - nano::Knano_ratio) / 2, node1->balance (key0.pub)); + ASSERT_EQ ((nano::dev::constants.genesis_amount - nano::Knano_ratio) / 2, node1->balance (key1.pub)); } TEST (system, transport_basic) diff --git a/nano/core_test/uint256_union.cpp b/nano/core_test/uint256_union.cpp index 16483cab15..60f5bcacc6 100644 --- a/nano/core_test/uint256_union.cpp +++ b/nano/core_test/uint256_union.cpp @@ -100,24 +100,24 @@ struct test_punct : std::moneypunct TEST (uint128_union, balance_format) { - ASSERT_EQ ("0", nano::amount (nano::uint128_t ("0")).format_balance (nano::Mxrb_ratio, 0, false)); - ASSERT_EQ ("0", nano::amount (nano::uint128_t ("0")).format_balance (nano::Mxrb_ratio, 2, true)); - ASSERT_EQ ("340,282,366", nano::amount (nano::uint128_t ("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF")).format_balance (nano::Mxrb_ratio, 0, true)); - ASSERT_EQ ("340,282,366.920938463463374607431768211455", nano::amount (nano::uint128_t ("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF")).format_balance (nano::Mxrb_ratio, 64, true)); + ASSERT_EQ ("0", nano::amount (nano::uint128_t ("0")).format_balance (nano::nano_ratio, 0, false)); + ASSERT_EQ ("0", nano::amount (nano::uint128_t ("0")).format_balance (nano::nano_ratio, 2, true)); + ASSERT_EQ ("340,282,366", nano::amount (nano::uint128_t ("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF")).format_balance (nano::nano_ratio, 0, true)); + ASSERT_EQ ("340,282,366.920938463463374607431768211455", nano::amount (nano::uint128_t ("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF")).format_balance (nano::nano_ratio, 64, true)); ASSERT_EQ ("340,282,366,920,938,463,463,374,607,431,768,211,455", nano::amount (nano::uint128_t ("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF")).format_balance (1, 4, true)); - ASSERT_EQ ("340,282,366", nano::amount (nano::uint128_t ("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE")).format_balance (nano::Mxrb_ratio, 0, true)); - ASSERT_EQ ("340,282,366.920938463463374607431768211454", nano::amount (nano::uint128_t ("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE")).format_balance (nano::Mxrb_ratio, 64, true)); + ASSERT_EQ ("340,282,366", nano::amount (nano::uint128_t ("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE")).format_balance (nano::nano_ratio, 0, true)); + ASSERT_EQ ("340,282,366.920938463463374607431768211454", nano::amount (nano::uint128_t ("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE")).format_balance (nano::nano_ratio, 64, true)); ASSERT_EQ ("340282366920938463463374607431768211454", nano::amount (nano::uint128_t ("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE")).format_balance (1, 4, false)); - ASSERT_EQ ("170,141,183", nano::amount (nano::uint128_t ("0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE")).format_balance (nano::Mxrb_ratio, 0, true)); - ASSERT_EQ ("170,141,183.460469231731687303715884105726", nano::amount (nano::uint128_t ("0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE")).format_balance (nano::Mxrb_ratio, 64, true)); + ASSERT_EQ ("170,141,183", nano::amount (nano::uint128_t ("0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE")).format_balance (nano::nano_ratio, 0, true)); + ASSERT_EQ ("170,141,183.460469231731687303715884105726", nano::amount (nano::uint128_t ("0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE")).format_balance (nano::nano_ratio, 64, true)); ASSERT_EQ ("170141183460469231731687303715884105726", nano::amount (nano::uint128_t ("0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE")).format_balance (1, 4, false)); - ASSERT_EQ ("1", nano::amount (nano::uint128_t ("1000000000000000000000000000000")).format_balance (nano::Mxrb_ratio, 2, true)); - ASSERT_EQ ("1.2", nano::amount (nano::uint128_t ("1200000000000000000000000000000")).format_balance (nano::Mxrb_ratio, 2, true)); - ASSERT_EQ ("1.23", nano::amount (nano::uint128_t ("1230000000000000000000000000000")).format_balance (nano::Mxrb_ratio, 2, true)); - ASSERT_EQ ("1.2", nano::amount (nano::uint128_t ("1230000000000000000000000000000")).format_balance (nano::Mxrb_ratio, 1, true)); - ASSERT_EQ ("1", nano::amount (nano::uint128_t ("1230000000000000000000000000000")).format_balance (nano::Mxrb_ratio, 0, true)); - ASSERT_EQ ("123456789", nano::amount (nano::Mxrb_ratio * 123456789).format_balance (nano::Mxrb_ratio, 2, false)); - ASSERT_EQ ("123,456,789", nano::amount (nano::Mxrb_ratio * 123456789).format_balance (nano::Mxrb_ratio, 2, true)); + ASSERT_EQ ("1", nano::amount (nano::uint128_t ("1000000000000000000000000000000")).format_balance (nano::nano_ratio, 2, true)); + ASSERT_EQ ("1.2", nano::amount (nano::uint128_t ("1200000000000000000000000000000")).format_balance (nano::nano_ratio, 2, true)); + ASSERT_EQ ("1.23", nano::amount (nano::uint128_t ("1230000000000000000000000000000")).format_balance (nano::nano_ratio, 2, true)); + ASSERT_EQ ("1.2", nano::amount (nano::uint128_t ("1230000000000000000000000000000")).format_balance (nano::nano_ratio, 1, true)); + ASSERT_EQ ("1", nano::amount (nano::uint128_t ("1230000000000000000000000000000")).format_balance (nano::nano_ratio, 0, true)); + ASSERT_EQ ("123456789", nano::amount (nano::nano_ratio * 123456789).format_balance (nano::nano_ratio, 2, false)); + ASSERT_EQ ("123,456,789", nano::amount (nano::nano_ratio * 123456789).format_balance (nano::nano_ratio, 2, true)); } TEST (uint128_union, decode_decimal) @@ -130,18 +130,18 @@ TEST (uint128_union, decode_decimal) ASSERT_TRUE (amount.decode_dec ("0.1", nano::raw_ratio)); ASSERT_FALSE (amount.decode_dec ("1", nano::raw_ratio)); ASSERT_EQ (1, amount.number ()); - ASSERT_FALSE (amount.decode_dec ("340282366.920938463463374607431768211454", nano::Mxrb_ratio)); + ASSERT_FALSE (amount.decode_dec ("340282366.920938463463374607431768211454", nano::nano_ratio)); ASSERT_EQ (std::numeric_limits::max () - 1, amount.number ()); - ASSERT_TRUE (amount.decode_dec ("340282366.920938463463374607431768211456", nano::Mxrb_ratio)); - ASSERT_TRUE (amount.decode_dec ("340282367", nano::Mxrb_ratio)); - ASSERT_FALSE (amount.decode_dec ("0.000000000000000000000001", nano::Mxrb_ratio)); + ASSERT_TRUE (amount.decode_dec ("340282366.920938463463374607431768211456", nano::nano_ratio)); + ASSERT_TRUE (amount.decode_dec ("340282367", nano::nano_ratio)); + ASSERT_FALSE (amount.decode_dec ("0.000000000000000000000001", nano::nano_ratio)); ASSERT_EQ (1000000, amount.number ()); - ASSERT_FALSE (amount.decode_dec ("0.000000000000000000000000000001", nano::Mxrb_ratio)); + ASSERT_FALSE (amount.decode_dec ("0.000000000000000000000000000001", nano::nano_ratio)); ASSERT_EQ (1, amount.number ()); - ASSERT_TRUE (amount.decode_dec ("0.0000000000000000000000000000001", nano::Mxrb_ratio)); - ASSERT_TRUE (amount.decode_dec (".1", nano::Mxrb_ratio)); - ASSERT_TRUE (amount.decode_dec ("0.", nano::Mxrb_ratio)); - ASSERT_FALSE (amount.decode_dec ("9.999999999999999999999999999999", nano::Mxrb_ratio)); + ASSERT_TRUE (amount.decode_dec ("0.0000000000000000000000000000001", nano::nano_ratio)); + ASSERT_TRUE (amount.decode_dec (".1", nano::nano_ratio)); + ASSERT_TRUE (amount.decode_dec ("0.", nano::nano_ratio)); + ASSERT_FALSE (amount.decode_dec ("9.999999999999999999999999999999", nano::nano_ratio)); ASSERT_EQ (nano::uint128_t ("9999999999999999999999999999999"), amount.number ()); ASSERT_FALSE (amount.decode_dec ("170141183460469.231731687303715884105727", nano::xrb_ratio)); ASSERT_EQ (nano::uint128_t ("170141183460469231731687303715884105727"), amount.number ()); @@ -149,8 +149,8 @@ TEST (uint128_union, decode_decimal) ASSERT_EQ (2 * nano::xrb_ratio + 2, amount.number ()); ASSERT_FALSE (amount.decode_dec ("2", nano::xrb_ratio)); ASSERT_EQ (2 * nano::xrb_ratio, amount.number ()); - ASSERT_FALSE (amount.decode_dec ("1230", nano::Gxrb_ratio)); - ASSERT_EQ (1230 * nano::Gxrb_ratio, amount.number ()); + ASSERT_FALSE (amount.decode_dec ("1230", nano::Knano_ratio)); + ASSERT_EQ (1230 * nano::Knano_ratio, amount.number ()); } TEST (unions, identity) diff --git a/nano/core_test/voting.cpp b/nano/core_test/voting.cpp index 06241a13af..3389a8a96f 100644 --- a/nano/core_test/voting.cpp +++ b/nano/core_test/voting.cpp @@ -82,7 +82,7 @@ TEST (vote_generator, multiple_representatives) wallet.insert_adhoc (key1.prv); wallet.insert_adhoc (key2.prv); wallet.insert_adhoc (key3.prv); - auto const amount = 100 * nano::Gxrb_ratio; + auto const amount = 100 * nano::Knano_ratio; wallet.send_sync (nano::dev::genesis_key.pub, key1.pub, amount); wallet.send_sync (nano::dev::genesis_key.pub, key2.pub, amount); wallet.send_sync (nano::dev::genesis_key.pub, key3.pub, amount); @@ -158,7 +158,7 @@ TEST (vote_spacing, vote_generator) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .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 ())) @@ -167,7 +167,7 @@ TEST (vote_spacing, vote_generator) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio - 1) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio - 1) .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 ())) @@ -202,7 +202,7 @@ TEST (vote_spacing, rapid) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .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 ())) @@ -211,7 +211,7 @@ TEST (vote_spacing, rapid) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio - 1) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio - 1) .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 ())) diff --git a/nano/core_test/wallet.cpp b/nano/core_test/wallet.cpp index a2fe0639f4..bd3b41325a 100644 --- a/nano/core_test/wallet.cpp +++ b/nano/core_test/wallet.cpp @@ -820,8 +820,8 @@ TEST (wallet, send_race) nano::keypair key2; for (auto i (1); i < 60; ++i) { - ASSERT_NE (nullptr, system.wallet (0)->send_action (nano::dev::genesis_key.pub, key2.pub, nano::Gxrb_ratio)); - ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Gxrb_ratio * i, system.nodes[0]->balance (nano::dev::genesis_key.pub)); + ASSERT_NE (nullptr, system.wallet (0)->send_action (nano::dev::genesis_key.pub, key2.pub, nano::Knano_ratio)); + ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Knano_ratio * i, system.nodes[0]->balance (nano::dev::genesis_key.pub)); } } diff --git a/nano/core_test/websocket.cpp b/nano/core_test/websocket.cpp index 07c2ed72c0..dacfd7b10e 100644 --- a/nano/core_test/websocket.cpp +++ b/nano/core_test/websocket.cpp @@ -574,7 +574,7 @@ TEST (websocket, confirmation_options_update) .account (nano::dev::genesis_key.pub) .previous (previous) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (previous)) @@ -592,7 +592,7 @@ TEST (websocket, confirmation_options_update) .account (nano::dev::genesis_key.pub) .previous (previous) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - 2 * nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - 2 * nano::Knano_ratio) .link (key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (previous)) From 62d53edcd8b11fd957a0b91441337c1b5f492077 Mon Sep 17 00:00:00 2001 From: RickiNano <81099017+RickiNano@users.noreply.github.com> Date: Sun, 22 Sep 2024 20:19:41 +0200 Subject: [PATCH 08/12] Removed legacy tests --- nano/core_test/node.cpp | 13 ------------- nano/core_test/uint256_union.cpp | 5 ----- 2 files changed, 18 deletions(-) diff --git a/nano/core_test/node.cpp b/nano/core_test/node.cpp index 07ac81cecc..1c227bbf84 100644 --- a/nano/core_test/node.cpp +++ b/nano/core_test/node.cpp @@ -479,19 +479,6 @@ TEST (node, working) ASSERT_FALSE (path.empty ()); } -TEST (node, price) -{ - nano::test::system system (1); - auto price1 (system.nodes[0]->price (nano::Knano_ratio, 1)); - ASSERT_EQ (nano::node::price_max * 100.0, price1); - auto price2 (system.nodes[0]->price (nano::Knano_ratio * int (nano::node::free_cutoff + 1), 1)); - ASSERT_EQ (0, price2); - auto price3 (system.nodes[0]->price (nano::Knano_ratio * int (nano::node::free_cutoff + 2) / 2, 1)); - ASSERT_EQ (nano::node::price_max * 100.0 / 2, price3); - auto price4 (system.nodes[0]->price (nano::Knano_ratio * int (nano::node::free_cutoff) * 2, 1)); - ASSERT_EQ (0, price4); -} - TEST (node, confirm_locked) { nano::test::system system (1); diff --git a/nano/core_test/uint256_union.cpp b/nano/core_test/uint256_union.cpp index 60f5bcacc6..21ae224c53 100644 --- a/nano/core_test/uint256_union.cpp +++ b/nano/core_test/uint256_union.cpp @@ -143,12 +143,7 @@ TEST (uint128_union, decode_decimal) ASSERT_TRUE (amount.decode_dec ("0.", nano::nano_ratio)); ASSERT_FALSE (amount.decode_dec ("9.999999999999999999999999999999", nano::nano_ratio)); ASSERT_EQ (nano::uint128_t ("9999999999999999999999999999999"), amount.number ()); - ASSERT_FALSE (amount.decode_dec ("170141183460469.231731687303715884105727", nano::xrb_ratio)); ASSERT_EQ (nano::uint128_t ("170141183460469231731687303715884105727"), amount.number ()); - ASSERT_FALSE (amount.decode_dec ("2.000000000000000000000002", nano::xrb_ratio)); - ASSERT_EQ (2 * nano::xrb_ratio + 2, amount.number ()); - ASSERT_FALSE (amount.decode_dec ("2", nano::xrb_ratio)); - ASSERT_EQ (2 * nano::xrb_ratio, amount.number ()); ASSERT_FALSE (amount.decode_dec ("1230", nano::Knano_ratio)); ASSERT_EQ (1230 * nano::Knano_ratio, amount.number ()); } From 1327d99be97fbbb71847ec880b4926cc98079dc4 Mon Sep 17 00:00:00 2001 From: RickiNano <81099017+RickiNano@users.noreply.github.com> Date: Sun, 22 Sep 2024 19:57:55 +0200 Subject: [PATCH 09/12] Fixed slow tests --- nano/slow_test/flamegraph.cpp | 8 ++++---- nano/slow_test/node.cpp | 18 +++++++++--------- nano/slow_test/vote_cache.cpp | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/nano/slow_test/flamegraph.cpp b/nano/slow_test/flamegraph.cpp index 48bbc6eafb..8a21b4540a 100644 --- a/nano/slow_test/flamegraph.cpp +++ b/nano/slow_test/flamegraph.cpp @@ -25,7 +25,7 @@ std::deque rep_set (size_t count) TEST (flamegraph, large_direct_processing) { auto reps = rep_set (4); - auto circulating = 10 * nano::Gxrb_ratio; + auto circulating = 10 * nano::Knano_ratio; nano::test::system system; system.ledger_initialization_set (reps, circulating); auto & node = *system.add_node (); @@ -43,7 +43,7 @@ TEST (flamegraph, large_direct_processing) .representative (nano::dev::genesis_key.pub) .previous (previous->hash ()) .link (key.pub) - .balance (previous->balance_field ().value ().number () - nano::xrb_ratio) + .balance (previous->balance_field ().value ().number () - 1000 * nano::raw_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (previous->hash ())) .build (); @@ -66,7 +66,7 @@ TEST (flamegraph, large_direct_processing) TEST (flamegraph, large_confirmation) { auto reps = rep_set (4); - auto circulating = 10 * nano::Gxrb_ratio; + auto circulating = 10 * nano::Knano_ratio; nano::test::system system; system.ledger_initialization_set (reps, circulating); auto prepare = [&] () { @@ -83,7 +83,7 @@ TEST (flamegraph, large_confirmation) .representative (nano::dev::genesis_key.pub) .previous (previous->hash ()) .link (key.pub) - .balance (previous->balance_field ().value ().number () - nano::xrb_ratio) + .balance (previous->balance_field ().value ().number () - 1000 * nano::raw_ratio) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (previous->hash ())) .build (); diff --git a/nano/slow_test/node.cpp b/nano/slow_test/node.cpp index 09c2f22fbb..1d98d2eaa7 100644 --- a/nano/slow_test/node.cpp +++ b/nano/slow_test/node.cpp @@ -620,7 +620,7 @@ TEST (node, mass_vote_by_hash) .account (nano::dev::genesis_key.pub) .previous (previous) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - (i + 1) * nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - (i + 1) * nano::Knano_ratio) .link (key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (previous)) @@ -815,7 +815,7 @@ TEST (confirmation_height, long_chains) .send () .previous (latest) .destination (key1.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio + num_blocks + 1) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio + num_blocks + 1) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (latest)) .build (); @@ -844,7 +844,7 @@ TEST (confirmation_height, long_chains) .send () .previous (previous_genesis_chain_hash) .destination (key1.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio + i + 1) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio + i + 1) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (previous_genesis_chain_hash)) .build (); @@ -868,7 +868,7 @@ TEST (confirmation_height, long_chains) .send () .previous (previous_destination_chain_hash) .destination (nano::dev::genesis_key.pub) - .balance (nano::Gxrb_ratio - 2) + .balance (nano::Knano_ratio - 2) .sign (key1.prv, key1.pub) .work (*system.work.generate (previous_destination_chain_hash)) .build (); @@ -877,7 +877,7 @@ TEST (confirmation_height, long_chains) .account (nano::dev::genesis_key.pub) .previous (previous_genesis_chain_hash) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio + 1) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio + 1) .link (send1->hash ()) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (previous_genesis_chain_hash)) @@ -890,7 +890,7 @@ TEST (confirmation_height, long_chains) .account (nano::dev::genesis_key.pub) .previous (receive1->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio) .link (key2.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (receive1->hash ())) @@ -1591,7 +1591,7 @@ TEST (telemetry, many_nodes) .account (nano::dev::genesis_key.pub) .previous (nano::dev::genesis->hash ()) .representative (nano::dev::genesis_key.pub) - .balance (nano::dev::constants.genesis_amount - nano::Mxrb_ratio) + .balance (nano::dev::constants.genesis_amount - nano::nano_ratio) .link (key.pub) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (nano::dev::genesis->hash ())) @@ -2052,7 +2052,7 @@ TEST (node, wallet_create_block_confirm_conflicts) .send () .previous (latest) .destination (key1.pub) - .balance (nano::dev::constants.genesis_amount - nano::Gxrb_ratio + i + 1) + .balance (nano::dev::constants.genesis_amount - nano::Knano_ratio + i + 1) .sign (nano::dev::genesis_key.prv, nano::dev::genesis_key.pub) .work (*system.work.generate (latest)) .build (); @@ -2102,7 +2102,7 @@ TEST (system, block_sequence) { reps.push_back (nano::keypair{}); } - system.ledger_initialization_set (reps, nano::Gxrb_ratio); + system.ledger_initialization_set (reps, nano::Knano_ratio); system.deadline_set (3600s); nano::node_config config; config.peering_port = system.get_available_port (); diff --git a/nano/slow_test/vote_cache.cpp b/nano/slow_test/vote_cache.cpp index 7ef639208b..f7d8e61bb9 100644 --- a/nano/slow_test/vote_cache.cpp +++ b/nano/slow_test/vote_cache.cpp @@ -48,7 +48,7 @@ nano::keypair setup_rep (nano::test::system & system, nano::node & node, nano::u std::vector setup_reps (nano::test::system & system, nano::node & node, int count) { - const nano::uint128_t weight = nano::Gxrb_ratio * 1000; + const nano::uint128_t weight = nano::Knano_ratio * 1000; std::vector reps; for (int n = 0; n < count; ++n) { From 858ff419dd9e40396731daf79f290246d038004f Mon Sep 17 00:00:00 2001 From: RickiNano <81099017+RickiNano@users.noreply.github.com> Date: Sun, 22 Sep 2024 20:52:50 +0200 Subject: [PATCH 10/12] Fixed qt ratios --- nano/qt/qt.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nano/qt/qt.cpp b/nano/qt/qt.cpp index 45e0bc93d2..b7e1e13be1 100644 --- a/nano/qt/qt.cpp +++ b/nano/qt/qt.cpp @@ -1025,7 +1025,7 @@ std::string nano_qt::status::color () } nano_qt::wallet::wallet (QApplication & application_a, nano_qt::eventloop_processor & processor_a, nano::node & node_a, std::shared_ptr const & wallet_a, nano::account & account_a) : - rendering_ratio (nano::Mxrb_ratio), + rendering_ratio (nano::nano_ratio), node (node_a), wallet_m (wallet_a), account (account_a), @@ -1851,7 +1851,7 @@ nano_qt::advanced_actions::advanced_actions (nano_qt::wallet & wallet_a) : QObject::connect (nano_unit, &QRadioButton::toggled, [this] () { if (nano_unit->isChecked ()) { - this->wallet.change_rendering_ratio (nano::Mxrb_ratio); + this->wallet.change_rendering_ratio (nano::nano_ratio); QSettings ().setValue (saved_ratio_key, ratio_group->id (nano_unit)); } }); From d6cbeb009e472445c8cace2674a9e2d616c8ae33 Mon Sep 17 00:00:00 2001 From: RickiNano <81099017+RickiNano@users.noreply.github.com> Date: Sun, 22 Sep 2024 22:09:26 +0200 Subject: [PATCH 11/12] Reinsert modified decode_dec to fix test --- nano/core_test/uint256_union.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/nano/core_test/uint256_union.cpp b/nano/core_test/uint256_union.cpp index 21ae224c53..743d0fe1c7 100644 --- a/nano/core_test/uint256_union.cpp +++ b/nano/core_test/uint256_union.cpp @@ -143,6 +143,7 @@ TEST (uint128_union, decode_decimal) ASSERT_TRUE (amount.decode_dec ("0.", nano::nano_ratio)); ASSERT_FALSE (amount.decode_dec ("9.999999999999999999999999999999", nano::nano_ratio)); ASSERT_EQ (nano::uint128_t ("9999999999999999999999999999999"), amount.number ()); + ASSERT_FALSE (amount.decode_dec ("170141183.460469231731687303715884105727", nano::nano_ratio)); ASSERT_EQ (nano::uint128_t ("170141183460469231731687303715884105727"), amount.number ()); ASSERT_FALSE (amount.decode_dec ("1230", nano::Knano_ratio)); ASSERT_EQ (1230 * nano::Knano_ratio, amount.number ()); From 78975aa6c9445be60761dddf5258a7da10f935aa Mon Sep 17 00:00:00 2001 From: RickiNano <81099017+RickiNano@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:51:12 +0200 Subject: [PATCH 12/12] Changed to Knano_ratio --- nano/node/nodeconfig.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nano/node/nodeconfig.hpp b/nano/node/nodeconfig.hpp index 98fd01266a..6c8bbfb4c6 100644 --- a/nano/node/nodeconfig.hpp +++ b/nano/node/nodeconfig.hpp @@ -70,7 +70,7 @@ class node_config std::vector preconfigured_representatives; unsigned bootstrap_fraction_numerator{ 1 }; nano::amount receive_minimum{ nano::nano_ratio / 1000 / 1000 }; // 0.000001 nano - nano::amount vote_minimum{ nano::nano_ratio * 1000 }; + nano::amount vote_minimum{ nano::Knano_ratio }; // 1000 nano nano::amount rep_crawler_weight_minimum{ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" }; std::chrono::milliseconds vote_generator_delay{ std::chrono::milliseconds (100) }; unsigned vote_generator_threshold{ 3 };