Skip to content
New issue

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

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

Already on GitHub? # to your account

Add ledger::account_info as interface to access account information #4081

Merged
merged 2 commits into from
Jan 27, 2023

Conversation

clemahieu
Copy link
Contributor

@clemahieu clemahieu commented Jan 26, 2023

Rather than directly accessing the block store, users should use the ledger::account_info interface to query for account information.

Result is returned as an std::optional instead of the less-obvious way it's currently reported through an error code.

Most though not all of the account_store::get references have been updated to use ledger::account_info.

dsiganos
dsiganos previously approved these changes Jan 27, 2023
[[maybe_unused]] auto error (ledger.store.account.get (transaction, pending.source, info));
debug_assert (!error);
auto info = ledger.account_info (transaction, pending.source);
debug_assert (info);
Copy link
Contributor

@pwojcikdev pwojcikdev Jan 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering whether those asserts inside rollback_visitor & ledger_processor should become release asserts. The check itself is very cheap and the logic it guards is very critical.

pwojcikdev
pwojcikdev previously approved these changes Jan 27, 2023
…store.account.get. Rather than directly accessing the block store, users should use the ledger interface to query for this information.
…account_store::get.

Rather than directly accessing the block store, users should use the ledger interface to query for this information.

Result is returned as an std::optional instead of the less-obvious way it's currently reported through an error code.

Most though not all of the account_store::get references have been updated to use ledger::account_info.
@clemahieu clemahieu merged commit 0d30fbe into nanocurrency:develop Jan 27, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants