Skip to content

Commit

Permalink
Remove redundant code pertaining to Checks wrapper class. Include the…
Browse files Browse the repository at this point in the history
… header file for the wrapper in CancelChecks impl file.
  • Loading branch information
ckeshava committed May 27, 2023
1 parent 64cc845 commit bcd11f7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 57 deletions.
1 change: 1 addition & 0 deletions src/ripple/app/tx/impl/CancelCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#define RIPPLE_TX_CANCELCHECK_H_INCLUDED

#include <ripple/app/tx/impl/Transactor.h>
#include <ripple/protocol/Checks.h>

namespace ripple {

Expand Down
57 changes: 0 additions & 57 deletions src/ripple/protocol/AcctRoot.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,63 +26,6 @@

namespace ripple {

template <bool Writable>
class ChecksImpl final : public LedgerEntryWrapper<Writable> {
private:
using Base = LedgerEntryWrapper<Writable>;
using SleT = typename Base::SleT;
using Base::wrapped_;

ChecksImpl(std::shared_ptr<SleT>&& w) : Base(std::move(w))
{
}

// Friend declarations of factory functions.
//
// For classes that contain factories we must declare the entire class
// as a friend unless the class declaration is visible at this point.
friend class ReadView;
friend class ApplyView;

public:
// Conversion operator from ChecksImpl<true> to ChecksImpl<false>.
operator ChecksImpl<true>() const
{
return ChecksImpl<false>(
std::const_pointer_cast<std::shared_ptr<STLedgerEntry const>>(
wrapped_));
}

uint256 key() const {
return wrapped_->key();
}

auto getCheckExpiration() const {
return wrapped_->at(~sfExpiration);
}

// Keshava: I think this is identical to the function STObject::getAccountID ?
// should I piggy-back on that function instead?
AccountID getCheckCreator() const
{
return wrapped_->at(sfAccount);
}

AccountID getCheckRecipient() const {
return wrapped_->at(sfDestination);
}

// Keshava: The below two functions refer to a page in a directory of an account.
// What is an appropriate name? These function names are cryptic :((
std::uint64_t getDestinationNode() const {
return wrapped_->at(sfDestinationNode);
}

std::uint64_t getOwnerNode() const {
return wrapped_->at(sfOwnerNode);
}
};

template <bool Writable>
class AcctRootImpl final : public LedgerEntryWrapper<Writable>
{
Expand Down

0 comments on commit bcd11f7

Please sign in to comment.