Rename nano:📒:representative
to nano:📒:representative_block
This commit is contained in:
parent
6305af8df2
commit
9fa214084c
5 changed files with 10 additions and 10 deletions
|
@ -496,7 +496,7 @@ TEST (ledger, representative_genesis)
|
|||
auto transaction = ledger.tx_begin_write ();
|
||||
auto latest = ledger.any.account_head (transaction, nano::dev::genesis_key.pub);
|
||||
ASSERT_FALSE (latest.is_zero ());
|
||||
ASSERT_EQ (nano::dev::genesis->hash (), ledger.representative (transaction, latest));
|
||||
ASSERT_EQ (nano::dev::genesis->hash (), ledger.representative_block (transaction, latest));
|
||||
}
|
||||
|
||||
TEST (ledger, weight)
|
||||
|
|
|
@ -616,7 +616,7 @@ void nano::json_handler::account_info ()
|
|||
{
|
||||
response_l.put ("frontier", info.head.to_string ());
|
||||
response_l.put ("open_block", info.open_block.to_string ());
|
||||
response_l.put ("representative_block", node.ledger.representative (transaction, info.head).to_string ());
|
||||
response_l.put ("representative_block", node.ledger.representative_block (transaction, info.head).to_string ());
|
||||
nano::amount balance_l (info.balance);
|
||||
std::string balance = balance_l.to_string_dec ();
|
||||
|
||||
|
@ -671,7 +671,7 @@ void nano::json_handler::account_info ()
|
|||
confirmed_representative = confirmed_frontier_block->representative_field ().value_or (0);
|
||||
if (confirmed_representative.is_zero ())
|
||||
{
|
||||
confirmed_representative = node.ledger.any.block_get (transaction, node.ledger.representative (transaction, confirmation_height_info.frontier))->representative_field ().value ();
|
||||
confirmed_representative = node.ledger.any.block_get (transaction, node.ledger.representative_block (transaction, confirmation_height_info.frontier))->representative_field ().value ();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2834,7 +2834,7 @@ void nano::json_handler::ledger ()
|
|||
}
|
||||
response_a.put ("frontier", info.head.to_string ());
|
||||
response_a.put ("open_block", info.open_block.to_string ());
|
||||
response_a.put ("representative_block", node.ledger.representative (transaction, info.head).to_string ());
|
||||
response_a.put ("representative_block", node.ledger.representative_block (transaction, info.head).to_string ());
|
||||
std::string balance = nano::uint128_union (info.balance).to_string_dec ();
|
||||
response_a.put ("balance", balance);
|
||||
response_a.put ("modified_timestamp", std::to_string (info.modified));
|
||||
|
@ -2886,7 +2886,7 @@ void nano::json_handler::ledger ()
|
|||
}
|
||||
response_a.put ("frontier", info.head.to_string ());
|
||||
response_a.put ("open_block", info.open_block.to_string ());
|
||||
response_a.put ("representative_block", node.ledger.representative (transaction, info.head).to_string ());
|
||||
response_a.put ("representative_block", node.ledger.representative_block (transaction, info.head).to_string ());
|
||||
std::string balance = (i->first).to_string_dec ();
|
||||
response_a.put ("balance", balance);
|
||||
response_a.put ("modified_timestamp", std::to_string (info.modified));
|
||||
|
@ -4748,7 +4748,7 @@ void nano::json_handler::wallet_ledger ()
|
|||
boost::property_tree::ptree entry;
|
||||
entry.put ("frontier", info->head.to_string ());
|
||||
entry.put ("open_block", info->open_block.to_string ());
|
||||
entry.put ("representative_block", node.ledger.representative (block_transaction, info->head).to_string ());
|
||||
entry.put ("representative_block", node.ledger.representative_block (block_transaction, info->head).to_string ());
|
||||
std::string balance = nano::uint128_union (info->balance).to_string_dec ();
|
||||
entry.put ("balance", balance);
|
||||
entry.put ("modified_timestamp", std::to_string (info->modified));
|
||||
|
|
|
@ -423,7 +423,7 @@ public:
|
|||
};
|
||||
}
|
||||
|
||||
nano::block_hash nano::ledger::representative (secure::transaction const & transaction, nano::block_hash const & hash)
|
||||
nano::block_hash nano::ledger::representative_block (secure::transaction const & transaction, nano::block_hash const & hash)
|
||||
{
|
||||
representative_block_visitor visitor{ transaction, *this };
|
||||
visitor.compute (hash);
|
||||
|
|
|
@ -57,7 +57,7 @@ public:
|
|||
nano::uint128_t weight_exact (secure::transaction const &, nano::account const &) const;
|
||||
std::shared_ptr<nano::block> forked_block (secure::transaction const &, nano::block const &);
|
||||
nano::root latest_root (secure::transaction const &, nano::account const &);
|
||||
nano::block_hash representative (secure::transaction const &, nano::block_hash const &);
|
||||
nano::block_hash representative_block (secure::transaction const &, nano::block_hash const &);
|
||||
std::string block_text (char const *);
|
||||
std::string block_text (nano::block_hash const &);
|
||||
std::deque<std::shared_ptr<nano::block>> random_blocks (secure::transaction const &, size_t count) const;
|
||||
|
|
|
@ -79,7 +79,7 @@ void nano::ledger_rollback::open_block (nano::open_block const & block_a)
|
|||
void nano::ledger_rollback::change_block (nano::change_block const & block_a)
|
||||
{
|
||||
auto hash (block_a.hash ());
|
||||
auto rep_block_hash (ledger.representative (transaction, block_a.hashables.previous));
|
||||
auto rep_block_hash (ledger.representative_block (transaction, block_a.hashables.previous));
|
||||
auto account = block_a.account ();
|
||||
auto info = ledger.any.account_get (transaction, account);
|
||||
release_assert (info);
|
||||
|
@ -132,7 +132,7 @@ void nano::ledger_rollback::state_block (nano::state_block const & block_a)
|
|||
nano::block_hash rep_block_hash (0);
|
||||
if (!block_a.hashables.previous.is_zero ())
|
||||
{
|
||||
rep_block_hash = ledger.representative (transaction, block_a.hashables.previous);
|
||||
rep_block_hash = ledger.representative_block (transaction, block_a.hashables.previous);
|
||||
}
|
||||
|
||||
nano::account previous_representative{};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue