Skip to content
Open
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
37 changes: 37 additions & 0 deletions include/xrpl/ledger/helpers/AMMEntry.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#pragma once

#include <xrpl/basics/base_uint.h>
#include <xrpl/beast/utility/Journal.h>
#include <xrpl/ledger/helpers/SLEBase.h>
#include <xrpl/protocol/Asset.h>
#include <xrpl/protocol/Indexes.h>

namespace xrpl {

template <typename ViewT>
class AMMEntry : public SLEBase<ViewT>
{
public:
// Inherit base constructors: adopt an existing SLE, or resolve one from a
// Keylet against the view.
using SLEBase<ViewT>::SLEBase;

explicit AMMEntry(
Asset const& issue1,
Asset const& issue2,
SLEBase<ViewT>::view_ref_type view,
Comment thread
mvadari marked this conversation as resolved.
beast::Journal j = beast::Journal{beast::Journal::getNullSink()})
: SLEBase<ViewT>(keylet::amm(issue1, issue2), view, j)
{
}

explicit AMMEntry(
uint256 const& ammID,
SLEBase<ViewT>::view_ref_type view,
beast::Journal j = beast::Journal{beast::Journal::getNullSink()})
: SLEBase<ViewT>(keylet::amm(ammID), view, j)
{
}
};

} // namespace xrpl
32 changes: 32 additions & 0 deletions include/xrpl/ledger/helpers/AccountRootEntry.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#pragma once

#include <xrpl/beast/utility/Journal.h>
#include <xrpl/ledger/ApplyView.h>
#include <xrpl/ledger/ReadView.h>
#include <xrpl/ledger/helpers/SLEBase.h>
#include <xrpl/protocol/AccountID.h>
#include <xrpl/protocol/Indexes.h>

namespace xrpl {

template <typename ViewT>
class AccountRootEntry : public SLEBase<ViewT>
{
public:
// Inherit base constructors: adopt an existing SLE, or resolve one from a
// Keylet against the view.
using SLEBase<ViewT>::SLEBase;

explicit AccountRootEntry(
AccountID const& id,
SLEBase<ViewT>::view_ref_type view,
Comment thread
mvadari marked this conversation as resolved.
beast::Journal j = beast::Journal{beast::Journal::getNullSink()})
: SLEBase<ViewT>(keylet::account(id), view, j)
{
}
};

using RAccountRootEntry = AccountRootEntry<ReadView>;
using WAccountRootEntry = AccountRootEntry<ApplyView>;

} // namespace xrpl
25 changes: 25 additions & 0 deletions include/xrpl/ledger/helpers/AmendmentsEntry.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#pragma once

#include <xrpl/beast/utility/Journal.h>
#include <xrpl/ledger/helpers/SLEBase.h>
#include <xrpl/protocol/Indexes.h>

namespace xrpl {

template <typename ViewT>
class AmendmentsEntry : public SLEBase<ViewT>
{
public:
// Inherit base constructors: adopt an existing SLE, or resolve one from a
// Keylet against the view.
using SLEBase<ViewT>::SLEBase;

explicit AmendmentsEntry(
SLEBase<ViewT>::view_ref_type view,
Comment thread
mvadari marked this conversation as resolved.
beast::Journal j = beast::Journal{beast::Journal::getNullSink()})
: SLEBase<ViewT>(keylet::amendments(), view, j)
{
}
};

} // namespace xrpl
28 changes: 28 additions & 0 deletions include/xrpl/ledger/helpers/BridgeEntry.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#pragma once

#include <xrpl/beast/utility/Journal.h>
#include <xrpl/ledger/helpers/SLEBase.h>
#include <xrpl/protocol/Indexes.h>
#include <xrpl/protocol/STXChainBridge.h>

namespace xrpl {

template <typename ViewT>
class BridgeEntry : public SLEBase<ViewT>
{
public:
// Inherit base constructors: adopt an existing SLE, or resolve one from a
// Keylet against the view.
using SLEBase<ViewT>::SLEBase;

explicit BridgeEntry(
STXChainBridge const& bridge,
STXChainBridge::ChainType chainType,
SLEBase<ViewT>::view_ref_type view,
Comment thread
mvadari marked this conversation as resolved.
beast::Journal j = beast::Journal{beast::Journal::getNullSink()})
: SLEBase<ViewT>(keylet::bridge(bridge, chainType), view, j)
{
}
};

} // namespace xrpl
39 changes: 39 additions & 0 deletions include/xrpl/ledger/helpers/CheckEntry.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#pragma once

#include <xrpl/basics/base_uint.h>
#include <xrpl/beast/utility/Journal.h>
#include <xrpl/ledger/helpers/SLEBase.h>
#include <xrpl/protocol/AccountID.h>
#include <xrpl/protocol/Indexes.h>

#include <cstdint>

namespace xrpl {

template <typename ViewT>
class CheckEntry : public SLEBase<ViewT>
{
public:
// Inherit base constructors: adopt an existing SLE, or resolve one from a
// Keylet against the view.
using SLEBase<ViewT>::SLEBase;

explicit CheckEntry(
AccountID const& id,
std::uint32_t seq,
SLEBase<ViewT>::view_ref_type view,
Comment thread
mvadari marked this conversation as resolved.
beast::Journal j = beast::Journal{beast::Journal::getNullSink()})
: SLEBase<ViewT>(keylet::check(id, seq), view, j)
{
}

explicit CheckEntry(
uint256 const& checkID,
SLEBase<ViewT>::view_ref_type view,
beast::Journal j = beast::Journal{beast::Journal::getNullSink()})
: SLEBase<ViewT>(keylet::check(checkID), view, j)
{
}
};

} // namespace xrpl
39 changes: 39 additions & 0 deletions include/xrpl/ledger/helpers/CredentialEntry.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#pragma once

#include <xrpl/basics/Slice.h>
#include <xrpl/basics/base_uint.h>
#include <xrpl/beast/utility/Journal.h>
#include <xrpl/ledger/helpers/SLEBase.h>
#include <xrpl/protocol/AccountID.h>
#include <xrpl/protocol/Indexes.h>

namespace xrpl {

template <typename ViewT>
class CredentialEntry : public SLEBase<ViewT>
{
public:
// Inherit base constructors: adopt an existing SLE, or resolve one from a
// Keylet against the view.
using SLEBase<ViewT>::SLEBase;

explicit CredentialEntry(
AccountID const& subject,
AccountID const& issuer,
Slice const& credType,
SLEBase<ViewT>::view_ref_type view,
Comment thread
mvadari marked this conversation as resolved.
beast::Journal j = beast::Journal{beast::Journal::getNullSink()})
: SLEBase<ViewT>(keylet::credential(subject, issuer, credType), view, j)
{
}

explicit CredentialEntry(
uint256 const& credentialID,
SLEBase<ViewT>::view_ref_type view,
beast::Journal j = beast::Journal{beast::Journal::getNullSink()})
: SLEBase<ViewT>(keylet::credential(credentialID), view, j)
{
}
};

} // namespace xrpl
27 changes: 27 additions & 0 deletions include/xrpl/ledger/helpers/DIDEntry.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#pragma once

#include <xrpl/beast/utility/Journal.h>
#include <xrpl/ledger/helpers/SLEBase.h>
#include <xrpl/protocol/AccountID.h>
#include <xrpl/protocol/Indexes.h>

namespace xrpl {

template <typename ViewT>
class DIDEntry : public SLEBase<ViewT>
{
public:
// Inherit base constructors: adopt an existing SLE, or resolve one from a
// Keylet against the view.
using SLEBase<ViewT>::SLEBase;

explicit DIDEntry(
AccountID const& account,
SLEBase<ViewT>::view_ref_type view,
Comment thread
mvadari marked this conversation as resolved.
beast::Journal j = beast::Journal{beast::Journal::getNullSink()})
: SLEBase<ViewT>(keylet::did(account), view, j)
{
}
};

} // namespace xrpl
28 changes: 28 additions & 0 deletions include/xrpl/ledger/helpers/DelegateEntry.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#pragma once

#include <xrpl/beast/utility/Journal.h>
#include <xrpl/ledger/helpers/SLEBase.h>
#include <xrpl/protocol/AccountID.h>
#include <xrpl/protocol/Indexes.h>

namespace xrpl {

template <typename ViewT>
class DelegateEntry : public SLEBase<ViewT>
{
public:
// Inherit base constructors: adopt an existing SLE, or resolve one from a
// Keylet against the view.
using SLEBase<ViewT>::SLEBase;

explicit DelegateEntry(
AccountID const& account,
AccountID const& authorizedAccount,
SLEBase<ViewT>::view_ref_type view,
Comment thread
mvadari marked this conversation as resolved.
beast::Journal j = beast::Journal{beast::Journal::getNullSink()})
: SLEBase<ViewT>(keylet::delegate(account, authorizedAccount), view, j)
{
}
};

} // namespace xrpl
50 changes: 50 additions & 0 deletions include/xrpl/ledger/helpers/DepositPreauthEntry.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#pragma once

#include <xrpl/basics/Slice.h>
#include <xrpl/basics/base_uint.h>
#include <xrpl/beast/utility/Journal.h>
#include <xrpl/ledger/helpers/SLEBase.h>
#include <xrpl/protocol/AccountID.h>
#include <xrpl/protocol/Indexes.h>

#include <set>
#include <utility>

namespace xrpl {

template <typename ViewT>
class DepositPreauthEntry : public SLEBase<ViewT>
{
public:
// Inherit base constructors: adopt an existing SLE, or resolve one from a
// Keylet against the view.
using SLEBase<ViewT>::SLEBase;

explicit DepositPreauthEntry(
AccountID const& owner,
AccountID const& preauthorized,
SLEBase<ViewT>::view_ref_type view,
Comment thread
mvadari marked this conversation as resolved.
beast::Journal j = beast::Journal{beast::Journal::getNullSink()})
: SLEBase<ViewT>(keylet::depositPreauth(owner, preauthorized), view, j)
{
}

explicit DepositPreauthEntry(
AccountID const& owner,
std::set<std::pair<AccountID, Slice>> const& authCreds,
SLEBase<ViewT>::view_ref_type view,
beast::Journal j = beast::Journal{beast::Journal::getNullSink()})
: SLEBase<ViewT>(keylet::depositPreauth(owner, authCreds), view, j)
{
}

explicit DepositPreauthEntry(
uint256 const& preauthID,
SLEBase<ViewT>::view_ref_type view,
beast::Journal j = beast::Journal{beast::Journal::getNullSink()})
: SLEBase<ViewT>(keylet::depositPreauth(preauthID), view, j)
{
}
};

} // namespace xrpl
42 changes: 42 additions & 0 deletions include/xrpl/ledger/helpers/DirectoryNodeEntry.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#pragma once

#include <xrpl/basics/base_uint.h>
#include <xrpl/beast/utility/Journal.h>
#include <xrpl/ledger/helpers/SLEBase.h>
#include <xrpl/protocol/AccountID.h>
#include <xrpl/protocol/Indexes.h>

#include <cstdint>

namespace xrpl {

template <typename ViewT>
class DirectoryNodeEntry : public SLEBase<ViewT>
{
public:
// Inherit base constructors: adopt an existing SLE, or resolve one from a
// Keylet against the view.
using SLEBase<ViewT>::SLEBase;

explicit DirectoryNodeEntry(
AccountID const& id,
SLEBase<ViewT>::view_ref_type view,
Comment thread
mvadari marked this conversation as resolved.
beast::Journal j = beast::Journal{beast::Journal::getNullSink()})
: SLEBase<ViewT>(keylet::ownerDir(id), view, j)
{
}

/**
* Resolve a specific page of the directory rooted at @p root.
*/
explicit DirectoryNodeEntry(
uint256 const& root,
std::uint64_t index,
SLEBase<ViewT>::view_ref_type view,
beast::Journal j = beast::Journal{beast::Journal::getNullSink()})
: SLEBase<ViewT>(keylet::page(root, index), view, j)
{
}
};

} // namespace xrpl
30 changes: 30 additions & 0 deletions include/xrpl/ledger/helpers/EscrowEntry.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#pragma once

#include <xrpl/beast/utility/Journal.h>
#include <xrpl/ledger/helpers/SLEBase.h>
#include <xrpl/protocol/AccountID.h>
#include <xrpl/protocol/Indexes.h>

#include <cstdint>

namespace xrpl {

template <typename ViewT>
class EscrowEntry : public SLEBase<ViewT>
{
public:
// Inherit base constructors: adopt an existing SLE, or resolve one from a
// Keylet against the view.
using SLEBase<ViewT>::SLEBase;

explicit EscrowEntry(
AccountID const& src,
std::uint32_t seq,
SLEBase<ViewT>::view_ref_type view,
Comment thread
mvadari marked this conversation as resolved.
beast::Journal j = beast::Journal{beast::Journal::getNullSink()})
: SLEBase<ViewT>(keylet::escrow(src, seq), view, j)
{
}
};

} // namespace xrpl
Loading
Loading