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

Strongly typed wrapper for Negative UNL Ledger Object #25

Open
wants to merge 3 commits into
base: wrapper
Choose a base branch
from

Conversation

ckeshava
Copy link

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Tests (You added tests for code that already exists, or your new feature included in this PR)
  • Documentation Updates
  • Release

@@ -737,10 +737,10 @@ Ledger::negativeUNL() const
std::optional<PublicKey>
Ledger::validatorToDisable() const
{
if (auto sle = readSLE(keylet::negativeUNL());
sle && sle->isFieldPresent(sfValidatorToDisable))
if (auto nUNLLedgerObj = read<NegUNLKeylet, NegUNLImpl<false>>(keylet::negativeUNL());
Copy link
Author

Choose a reason for hiding this comment

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

I don't remember the details, but the compiler was throwing an error without an explicit specialization of the read<> function template. I'll investigate if I can remove the verbosity.

#define RIPPLE_PROTOCOL_NEGATIVE_UNL_H_INCLUDED

#include <ripple/protocol/LedgerEntryWrapper.h>
//#include <ripple/protocol/STAccount.h>
Copy link
Author

Choose a reason for hiding this comment

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

i forgot to remove these comments, will do while addressing the PR comments. I hope that's ok

}

[[nodiscard]] bool
isFieldPresent(SField const& field) const {
Copy link
Author

Choose a reason for hiding this comment

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

My understanding is that the NegativeUNL and Amendments ledger objects are singletons. Hence, there is possibility of re-writing some of these functions as static functions.

But I'm not sure if that is a good design decision.

ckeshava added 2 commits June 7, 2023 13:36
- Remove old comments
- Update copyrights information to year 2023
- Include explicit type information instead of using auto keyword
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant