Skip to content

Commit

Permalink
Remove overload of ledger::amount that was only used in one test and …
Browse files Browse the repository at this point in the history
…didn't have a meaningful function. (#4436)
  • Loading branch information
clemahieu authored Feb 15, 2024
1 parent 166b7ce commit c195663
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 10 deletions.
2 changes: 0 additions & 2 deletions nano/core_test/ledger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ TEST (ledger, genesis_balance)
auto transaction = store.tx_begin_write ();
auto balance = ledger.account_balance (transaction, nano::dev::genesis->account ());
ASSERT_EQ (nano::dev::constants.genesis_amount, balance);
auto amount = ledger.amount (transaction, nano::dev::genesis->account ());
ASSERT_EQ (nano::dev::constants.genesis_amount, amount);
auto info = ledger.account_info (transaction, nano::dev::genesis->account ());
ASSERT_TRUE (info);
ASSERT_EQ (1, ledger.cache.account_count);
Expand Down
7 changes: 0 additions & 7 deletions nano/secure/ledger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1192,13 +1192,6 @@ std::optional<nano::account_info> nano::ledger::account_info (store::transaction
return store.account.get (transaction, account);
}

// Return amount decrease or increase for block
nano::uint128_t nano::ledger::amount (store::transaction const & transaction_a, nano::account const & account_a)
{
release_assert (account_a == constants.genesis->account ());
return nano::dev::constants.genesis_amount;
}

nano::uint128_t nano::ledger::amount (store::transaction const & transaction_a, nano::block_hash const & hash_a)
{
auto block (store.block.get (transaction_a, hash_a));
Expand Down
1 change: 0 additions & 1 deletion nano/secure/ledger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class ledger final
* Return account containing hash, returns zero account if account can not be found
*/
nano::account account_safe (store::transaction const &, nano::block_hash const &) const;
nano::uint128_t amount (store::transaction const &, nano::account const &);
nano::uint128_t amount (store::transaction const &, nano::block_hash const &);
/** Safe for previous block, but block hash_a must exist */
nano::uint128_t amount_safe (store::transaction const &, nano::block_hash const & hash_a, bool &) const;
Expand Down

0 comments on commit c195663

Please sign in to comment.