Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove node::rep_block function that was only used in tests. #4444

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions nano/core_test/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,6 @@ TEST (node, balance)
ASSERT_EQ (std::numeric_limits<nano::uint128_t>::max (), system.nodes[0]->ledger.account_balance (transaction, nano::dev::genesis_key.pub));
}

TEST (node, representative)
{
nano::test::system system (1);
auto block1 (system.nodes[0]->rep_block (nano::dev::genesis_key.pub));
{
auto transaction (system.nodes[0]->store.tx_begin_read ());
ASSERT_TRUE (system.nodes[0]->ledger.store.block.exists (transaction, block1));
}
nano::keypair key;
ASSERT_TRUE (system.nodes[0]->rep_block (key.pub).is_zero ());
}

TEST (node, send_unkeyed)
{
nano::test::system system (1);
Expand Down
13 changes: 0 additions & 13 deletions nano/core_test/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,19 +223,6 @@ TEST (wallet, spend)
ASSERT_EQ (0, node1.balance (nano::dev::genesis_key.pub));
}

TEST (wallet, change)
{
nano::test::system system (1);
system.wallet (0)->insert_adhoc (nano::dev::genesis_key.prv);
nano::keypair key2;
auto block1 (system.nodes[0]->rep_block (nano::dev::genesis_key.pub));
ASSERT_FALSE (block1.is_zero ());
ASSERT_NE (nullptr, system.wallet (0)->change_action (nano::dev::genesis_key.pub, key2.pub));
auto block2 (system.nodes[0]->rep_block (nano::dev::genesis_key.pub));
ASSERT_FALSE (block2.is_zero ());
ASSERT_NE (block1, block2);
}

TEST (wallet, partial_spend)
{
nano::test::system system (1);
Expand Down
12 changes: 0 additions & 12 deletions nano/node/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -744,18 +744,6 @@ nano::uint128_t nano::node::weight (nano::account const & account_a)
return ledger.weight (account_a);
}

nano::block_hash nano::node::rep_block (nano::account const & account_a)
{
auto const transaction (store.tx_begin_read ());
nano::block_hash result (0);
auto info = ledger.account_info (transaction, account_a);
if (info)
{
result = ledger.representative (transaction, info->head);
}
return result;
}

nano::uint128_t nano::node::minimum_principal_weight ()
{
return online_reps.trended () / network_params.network.principal_weight_factor;
Expand Down
1 change: 0 additions & 1 deletion nano/node/node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ class node final : public std::enable_shared_from_this<nano::node>
std::shared_ptr<nano::block> block (nano::block_hash const &);
std::pair<nano::uint128_t, nano::uint128_t> balance_pending (nano::account const &, bool only_confirmed);
nano::uint128_t weight (nano::account const &);
nano::block_hash rep_block (nano::account const &);
nano::uint128_t minimum_principal_weight ();
void ongoing_rep_calculation ();
void ongoing_bootstrap ();
Expand Down
Loading