mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Make Keylet strongly typed so that we can get strongly typed ledger obejcts from views
Signed-off-by: JCW <a1q123456@users.noreply.github.com>
This commit is contained in:
@@ -54,11 +54,11 @@ class SeqProxy;
|
|||||||
namespace keylet {
|
namespace keylet {
|
||||||
|
|
||||||
/** AccountID root */
|
/** AccountID root */
|
||||||
Keylet
|
TypedKeylet<ltACCOUNT_ROOT>
|
||||||
account(AccountID const& id) noexcept;
|
account(AccountID const& id) noexcept;
|
||||||
|
|
||||||
/** The index of the amendment table */
|
/** The index of the amendment table */
|
||||||
Keylet const&
|
TypedKeylet<ltAMENDMENTS> const&
|
||||||
amendments() noexcept;
|
amendments() noexcept;
|
||||||
|
|
||||||
/** Any item that can be in an owner dir. */
|
/** Any item that can be in an owner dir. */
|
||||||
@@ -70,7 +70,7 @@ child(uint256 const& key) noexcept;
|
|||||||
The "short" skip list is a node (at a fixed index) that holds the hashes
|
The "short" skip list is a node (at a fixed index) that holds the hashes
|
||||||
of ledgers since the last flag ledger. It will contain, at most, 256 hashes.
|
of ledgers since the last flag ledger. It will contain, at most, 256 hashes.
|
||||||
*/
|
*/
|
||||||
Keylet const&
|
TypedKeylet<ltLEDGER_HASHES> const&
|
||||||
skip() noexcept;
|
skip() noexcept;
|
||||||
|
|
||||||
/** The index of the long skip for a particular ledger range.
|
/** The index of the long skip for a particular ledger range.
|
||||||
@@ -83,15 +83,15 @@ skip() noexcept;
|
|||||||
and uses it to get the hash of the flag ledger whose short skip list will
|
and uses it to get the hash of the flag ledger whose short skip list will
|
||||||
contain the hash of the requested ledger.
|
contain the hash of the requested ledger.
|
||||||
*/
|
*/
|
||||||
Keylet
|
TypedKeylet<ltLEDGER_HASHES>
|
||||||
skip(LedgerIndex ledger) noexcept;
|
skip(LedgerIndex ledger) noexcept;
|
||||||
|
|
||||||
/** The (fixed) index of the object containing the ledger fees. */
|
/** The (fixed) index of the object containing the ledger fees. */
|
||||||
Keylet const&
|
TypedKeylet<ltFEE_SETTINGS> const&
|
||||||
fees() noexcept;
|
fees() noexcept;
|
||||||
|
|
||||||
/** The (fixed) index of the object containing the ledger negativeUNL. */
|
/** The (fixed) index of the object containing the ledger negativeUNL. */
|
||||||
Keylet const&
|
TypedKeylet<ltNEGATIVE_UNL> const&
|
||||||
negativeUNL() noexcept;
|
negativeUNL() noexcept;
|
||||||
|
|
||||||
/** The beginning of an order book */
|
/** The beginning of an order book */
|
||||||
@@ -99,7 +99,7 @@ struct book_t
|
|||||||
{
|
{
|
||||||
explicit book_t() = default;
|
explicit book_t() = default;
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltDIR_NODE>
|
||||||
operator()(Book const& b) const;
|
operator()(Book const& b) const;
|
||||||
};
|
};
|
||||||
static book_t const book{};
|
static book_t const book{};
|
||||||
@@ -112,13 +112,13 @@ static book_t const book{};
|
|||||||
between them.
|
between them.
|
||||||
*/
|
*/
|
||||||
/** @{ */
|
/** @{ */
|
||||||
Keylet
|
TypedKeylet<ltRIPPLE_STATE>
|
||||||
line(
|
line(
|
||||||
AccountID const& id0,
|
AccountID const& id0,
|
||||||
AccountID const& id1,
|
AccountID const& id1,
|
||||||
Currency const& currency) noexcept;
|
Currency const& currency) noexcept;
|
||||||
|
|
||||||
inline Keylet
|
inline TypedKeylet<ltRIPPLE_STATE>
|
||||||
line(AccountID const& id, Issue const& issue) noexcept
|
line(AccountID const& id, Issue const& issue) noexcept
|
||||||
{
|
{
|
||||||
return line(id, issue.account, issue.currency);
|
return line(id, issue.account, issue.currency);
|
||||||
@@ -127,27 +127,27 @@ line(AccountID const& id, Issue const& issue) noexcept
|
|||||||
|
|
||||||
/** An offer from an account */
|
/** An offer from an account */
|
||||||
/** @{ */
|
/** @{ */
|
||||||
Keylet
|
TypedKeylet<ltOFFER>
|
||||||
offer(AccountID const& id, std::uint32_t seq) noexcept;
|
offer(AccountID const& id, std::uint32_t seq) noexcept;
|
||||||
|
|
||||||
inline Keylet
|
inline TypedKeylet<ltOFFER>
|
||||||
offer(uint256 const& key) noexcept
|
offer(uint256 const& key) noexcept
|
||||||
{
|
{
|
||||||
return {ltOFFER, key};
|
return {key};
|
||||||
}
|
}
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/** The initial directory page for a specific quality */
|
/** The initial directory page for a specific quality */
|
||||||
Keylet
|
TypedKeylet<ltDIR_NODE>
|
||||||
quality(Keylet const& k, std::uint64_t q) noexcept;
|
quality(TypedKeylet<ltDIR_NODE> const& k, std::uint64_t q) noexcept;
|
||||||
|
|
||||||
/** The directory for the next lower quality */
|
/** The directory for the next lower quality */
|
||||||
struct next_t
|
struct next_t
|
||||||
{
|
{
|
||||||
explicit next_t() = default;
|
explicit next_t() = default;
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltDIR_NODE>
|
||||||
operator()(Keylet const& k) const;
|
operator()(TypedKeylet<ltDIR_NODE> const& k) const;
|
||||||
};
|
};
|
||||||
static next_t const next{};
|
static next_t const next{};
|
||||||
|
|
||||||
@@ -156,50 +156,50 @@ struct ticket_t
|
|||||||
{
|
{
|
||||||
explicit ticket_t() = default;
|
explicit ticket_t() = default;
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltTICKET>
|
||||||
operator()(AccountID const& id, std::uint32_t ticketSeq) const;
|
operator()(AccountID const& id, std::uint32_t ticketSeq) const;
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltTICKET>
|
||||||
operator()(AccountID const& id, SeqProxy ticketSeq) const;
|
operator()(AccountID const& id, SeqProxy ticketSeq) const;
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltTICKET>
|
||||||
operator()(uint256 const& key) const
|
operator()(uint256 const& key) const
|
||||||
{
|
{
|
||||||
return {ltTICKET, key};
|
return {key};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
static ticket_t const ticket{};
|
static ticket_t const ticket{};
|
||||||
|
|
||||||
/** A SignerList */
|
/** A SignerList */
|
||||||
Keylet
|
TypedKeylet<ltSIGNER_LIST>
|
||||||
signers(AccountID const& account) noexcept;
|
signers(AccountID const& account) noexcept;
|
||||||
|
|
||||||
/** A Check */
|
/** A Check */
|
||||||
/** @{ */
|
/** @{ */
|
||||||
Keylet
|
TypedKeylet<ltCHECK>
|
||||||
check(AccountID const& id, std::uint32_t seq) noexcept;
|
check(AccountID const& id, std::uint32_t seq) noexcept;
|
||||||
|
|
||||||
inline Keylet
|
inline TypedKeylet<ltCHECK>
|
||||||
check(uint256 const& key) noexcept
|
check(uint256 const& key) noexcept
|
||||||
{
|
{
|
||||||
return {ltCHECK, key};
|
return {key};
|
||||||
}
|
}
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/** A DepositPreauth */
|
/** A DepositPreauth */
|
||||||
/** @{ */
|
/** @{ */
|
||||||
Keylet
|
TypedKeylet<ltDEPOSIT_PREAUTH>
|
||||||
depositPreauth(AccountID const& owner, AccountID const& preauthorized) noexcept;
|
depositPreauth(AccountID const& owner, AccountID const& preauthorized) noexcept;
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltDEPOSIT_PREAUTH>
|
||||||
depositPreauth(
|
depositPreauth(
|
||||||
AccountID const& owner,
|
AccountID const& owner,
|
||||||
std::set<std::pair<AccountID, Slice>> const& authCreds) noexcept;
|
std::set<std::pair<AccountID, Slice>> const& authCreds) noexcept;
|
||||||
|
|
||||||
inline Keylet
|
inline TypedKeylet<ltDEPOSIT_PREAUTH>
|
||||||
depositPreauth(uint256 const& key) noexcept
|
depositPreauth(uint256 const& key) noexcept
|
||||||
{
|
{
|
||||||
return {ltDEPOSIT_PREAUTH, key};
|
return {key};
|
||||||
}
|
}
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
@@ -210,15 +210,15 @@ Keylet
|
|||||||
unchecked(uint256 const& key) noexcept;
|
unchecked(uint256 const& key) noexcept;
|
||||||
|
|
||||||
/** The root page of an account's directory */
|
/** The root page of an account's directory */
|
||||||
Keylet
|
TypedKeylet<ltDIR_NODE>
|
||||||
ownerDir(AccountID const& id) noexcept;
|
ownerDir(AccountID const& id) noexcept;
|
||||||
|
|
||||||
/** A page in a directory */
|
/** A page in a directory */
|
||||||
/** @{ */
|
/** @{ */
|
||||||
Keylet
|
TypedKeylet<ltDIR_NODE>
|
||||||
page(uint256 const& root, std::uint64_t index = 0) noexcept;
|
page(uint256 const& root, std::uint64_t index = 0) noexcept;
|
||||||
|
|
||||||
inline Keylet
|
inline TypedKeylet<ltDIR_NODE>
|
||||||
page(Keylet const& root, std::uint64_t index = 0) noexcept
|
page(Keylet const& root, std::uint64_t index = 0) noexcept
|
||||||
{
|
{
|
||||||
XRPL_ASSERT(
|
XRPL_ASSERT(
|
||||||
@@ -228,11 +228,11 @@ page(Keylet const& root, std::uint64_t index = 0) noexcept
|
|||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/** An escrow entry */
|
/** An escrow entry */
|
||||||
Keylet
|
TypedKeylet<ltESCROW>
|
||||||
escrow(AccountID const& src, std::uint32_t seq) noexcept;
|
escrow(AccountID const& src, std::uint32_t seq) noexcept;
|
||||||
|
|
||||||
/** A PaymentChannel */
|
/** A PaymentChannel */
|
||||||
Keylet
|
TypedKeylet<ltPAYCHAN>
|
||||||
payChan(AccountID const& src, AccountID const& dst, std::uint32_t seq) noexcept;
|
payChan(AccountID const& src, AccountID const& dst, std::uint32_t seq) noexcept;
|
||||||
|
|
||||||
/** NFT page keylets
|
/** NFT page keylets
|
||||||
@@ -244,112 +244,112 @@ payChan(AccountID const& src, AccountID const& dst, std::uint32_t seq) noexcept;
|
|||||||
*/
|
*/
|
||||||
/** @{ */
|
/** @{ */
|
||||||
/** A keylet for the owner's first possible NFT page. */
|
/** A keylet for the owner's first possible NFT page. */
|
||||||
Keylet
|
TypedKeylet<ltNFTOKEN_PAGE>
|
||||||
nftpage_min(AccountID const& owner);
|
nftpage_min(AccountID const& owner);
|
||||||
|
|
||||||
/** A keylet for the owner's last possible NFT page. */
|
/** A keylet for the owner's last possible NFT page. */
|
||||||
Keylet
|
TypedKeylet<ltNFTOKEN_PAGE>
|
||||||
nftpage_max(AccountID const& owner);
|
nftpage_max(AccountID const& owner);
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltNFTOKEN_PAGE>
|
||||||
nftpage(Keylet const& k, uint256 const& token);
|
nftpage(TypedKeylet<ltNFTOKEN_PAGE> const& k, uint256 const& token);
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/** An offer from an account to buy or sell an NFT */
|
/** An offer from an account to buy or sell an NFT */
|
||||||
Keylet
|
TypedKeylet<ltNFTOKEN_OFFER>
|
||||||
nftoffer(AccountID const& owner, std::uint32_t seq);
|
nftoffer(AccountID const& owner, std::uint32_t seq);
|
||||||
|
|
||||||
inline Keylet
|
inline TypedKeylet<ltNFTOKEN_OFFER>
|
||||||
nftoffer(uint256 const& offer)
|
nftoffer(uint256 const& offer)
|
||||||
{
|
{
|
||||||
return {ltNFTOKEN_OFFER, offer};
|
return {offer};
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The directory of buy offers for the specified NFT */
|
/** The directory of buy offers for the specified NFT */
|
||||||
Keylet
|
TypedKeylet<ltDIR_NODE>
|
||||||
nft_buys(uint256 const& id) noexcept;
|
nft_buys(uint256 const& id) noexcept;
|
||||||
|
|
||||||
/** The directory of sell offers for the specified NFT */
|
/** The directory of sell offers for the specified NFT */
|
||||||
Keylet
|
TypedKeylet<ltDIR_NODE>
|
||||||
nft_sells(uint256 const& id) noexcept;
|
nft_sells(uint256 const& id) noexcept;
|
||||||
|
|
||||||
/** AMM entry */
|
/** AMM entry */
|
||||||
Keylet
|
TypedKeylet<ltAMM>
|
||||||
amm(Asset const& issue1, Asset const& issue2) noexcept;
|
amm(Asset const& issue1, Asset const& issue2) noexcept;
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltAMM>
|
||||||
amm(uint256 const& amm) noexcept;
|
amm(uint256 const& amm) noexcept;
|
||||||
|
|
||||||
/** A keylet for Delegate object */
|
/** A keylet for Delegate object */
|
||||||
Keylet
|
TypedKeylet<ltDELEGATE>
|
||||||
delegate(AccountID const& account, AccountID const& authorizedAccount) noexcept;
|
delegate(AccountID const& account, AccountID const& authorizedAccount) noexcept;
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltBRIDGE>
|
||||||
bridge(STXChainBridge const& bridge, STXChainBridge::ChainType chainType);
|
bridge(STXChainBridge const& bridge, STXChainBridge::ChainType chainType);
|
||||||
|
|
||||||
// `seq` is stored as `sfXChainClaimID` in the object
|
// `seq` is stored as `sfXChainClaimID` in the object
|
||||||
Keylet
|
TypedKeylet<ltXCHAIN_OWNED_CLAIM_ID>
|
||||||
xChainClaimID(STXChainBridge const& bridge, std::uint64_t seq);
|
xChainClaimID(STXChainBridge const& bridge, std::uint64_t seq);
|
||||||
|
|
||||||
// `seq` is stored as `sfXChainAccountCreateCount` in the object
|
// `seq` is stored as `sfXChainAccountCreateCount` in the object
|
||||||
Keylet
|
TypedKeylet<ltXCHAIN_OWNED_CREATE_ACCOUNT_CLAIM_ID>
|
||||||
xChainCreateAccountClaimID(STXChainBridge const& bridge, std::uint64_t seq);
|
xChainCreateAccountClaimID(STXChainBridge const& bridge, std::uint64_t seq);
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltDID>
|
||||||
did(AccountID const& account) noexcept;
|
did(AccountID const& account) noexcept;
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltORACLE>
|
||||||
oracle(AccountID const& account, std::uint32_t const& documentID) noexcept;
|
oracle(AccountID const& account, std::uint32_t const& documentID) noexcept;
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltCREDENTIAL>
|
||||||
credential(
|
credential(
|
||||||
AccountID const& subject,
|
AccountID const& subject,
|
||||||
AccountID const& issuer,
|
AccountID const& issuer,
|
||||||
Slice const& credType) noexcept;
|
Slice const& credType) noexcept;
|
||||||
|
|
||||||
inline Keylet
|
inline TypedKeylet<ltCREDENTIAL>
|
||||||
credential(uint256 const& key) noexcept
|
credential(uint256 const& key) noexcept
|
||||||
{
|
{
|
||||||
return {ltCREDENTIAL, key};
|
return {key};
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltMPTOKEN_ISSUANCE>
|
||||||
mptIssuance(std::uint32_t seq, AccountID const& issuer) noexcept;
|
mptIssuance(std::uint32_t seq, AccountID const& issuer) noexcept;
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltMPTOKEN_ISSUANCE>
|
||||||
mptIssuance(MPTID const& issuanceID) noexcept;
|
mptIssuance(MPTID const& issuanceID) noexcept;
|
||||||
|
|
||||||
inline Keylet
|
inline TypedKeylet<ltMPTOKEN_ISSUANCE>
|
||||||
mptIssuance(uint256 const& issuanceKey)
|
mptIssuance(uint256 const& issuanceKey)
|
||||||
{
|
{
|
||||||
return {ltMPTOKEN_ISSUANCE, issuanceKey};
|
return {issuanceKey};
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltMPTOKEN>
|
||||||
mptoken(MPTID const& issuanceID, AccountID const& holder) noexcept;
|
mptoken(MPTID const& issuanceID, AccountID const& holder) noexcept;
|
||||||
|
|
||||||
inline Keylet
|
inline TypedKeylet<ltMPTOKEN>
|
||||||
mptoken(uint256 const& mptokenKey)
|
mptoken(uint256 const& mptokenKey)
|
||||||
{
|
{
|
||||||
return {ltMPTOKEN, mptokenKey};
|
return {mptokenKey};
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltMPTOKEN>
|
||||||
mptoken(uint256 const& issuanceKey, AccountID const& holder) noexcept;
|
mptoken(uint256 const& issuanceKey, AccountID const& holder) noexcept;
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltVAULT>
|
||||||
vault(AccountID const& owner, std::uint32_t seq) noexcept;
|
vault(AccountID const& owner, std::uint32_t seq) noexcept;
|
||||||
|
|
||||||
inline Keylet
|
inline TypedKeylet<ltVAULT>
|
||||||
vault(uint256 const& vaultKey)
|
vault(uint256 const& vaultKey)
|
||||||
{
|
{
|
||||||
return {ltVAULT, vaultKey};
|
return {vaultKey};
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltPERMISSIONED_DOMAIN>
|
||||||
permissionedDomain(AccountID const& account, std::uint32_t seq) noexcept;
|
permissionedDomain(AccountID const& account, std::uint32_t seq) noexcept;
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltPERMISSIONED_DOMAIN>
|
||||||
permissionedDomain(uint256 const& domainID) noexcept;
|
permissionedDomain(uint256 const& domainID) noexcept;
|
||||||
} // namespace keylet
|
} // namespace keylet
|
||||||
|
|
||||||
|
|||||||
@@ -49,6 +49,21 @@ struct Keylet
|
|||||||
check(STLedgerEntry const&) const;
|
check(STLedgerEntry const&) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <LedgerEntryType Type>
|
||||||
|
struct TypedKeylet : Keylet
|
||||||
|
{
|
||||||
|
static constexpr LedgerEntryType LedgerType = Type;
|
||||||
|
|
||||||
|
TypedKeylet(uint256 const& key_) : Keylet(Type, key_)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
Keylet untyped() const
|
||||||
|
{
|
||||||
|
return Keylet(LedgerType, key);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace ripple
|
} // namespace ripple
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ getBookBase(Book const& book)
|
|||||||
book.out.account);
|
book.out.account);
|
||||||
|
|
||||||
// Return with quality 0.
|
// Return with quality 0.
|
||||||
auto k = keylet::quality({ltDIR_NODE, index}, 0);
|
auto k = keylet::quality({index}, 0);
|
||||||
|
|
||||||
return k.key;
|
return k.key;
|
||||||
}
|
}
|
||||||
@@ -180,10 +180,10 @@ makeMptID(std::uint32_t sequence, AccountID const& account)
|
|||||||
|
|
||||||
namespace keylet {
|
namespace keylet {
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltACCOUNT_ROOT>
|
||||||
account(AccountID const& id) noexcept
|
account(AccountID const& id) noexcept
|
||||||
{
|
{
|
||||||
return Keylet{ltACCOUNT_ROOT, indexHash(LedgerNameSpace::ACCOUNT, id)};
|
return TypedKeylet<ltACCOUNT_ROOT>{indexHash(LedgerNameSpace::ACCOUNT, id)};
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
Keylet
|
||||||
@@ -192,55 +192,54 @@ child(uint256 const& key) noexcept
|
|||||||
return {ltCHILD, key};
|
return {ltCHILD, key};
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet const&
|
TypedKeylet<ltLEDGER_HASHES> const&
|
||||||
skip() noexcept
|
skip() noexcept
|
||||||
{
|
{
|
||||||
static Keylet const ret{
|
static TypedKeylet<ltLEDGER_HASHES> const ret{
|
||||||
ltLEDGER_HASHES, indexHash(LedgerNameSpace::SKIP_LIST)};
|
indexHash(LedgerNameSpace::SKIP_LIST)};
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltLEDGER_HASHES>
|
||||||
skip(LedgerIndex ledger) noexcept
|
skip(LedgerIndex ledger) noexcept
|
||||||
{
|
{
|
||||||
return {
|
return {
|
||||||
ltLEDGER_HASHES,
|
|
||||||
indexHash(
|
indexHash(
|
||||||
LedgerNameSpace::SKIP_LIST,
|
LedgerNameSpace::SKIP_LIST,
|
||||||
std::uint32_t(static_cast<std::uint32_t>(ledger) >> 16))};
|
std::uint32_t(static_cast<std::uint32_t>(ledger) >> 16))};
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet const&
|
TypedKeylet<ltAMENDMENTS> const&
|
||||||
amendments() noexcept
|
amendments() noexcept
|
||||||
{
|
{
|
||||||
static Keylet const ret{
|
static TypedKeylet<ltAMENDMENTS> const ret{
|
||||||
ltAMENDMENTS, indexHash(LedgerNameSpace::AMENDMENTS)};
|
indexHash(LedgerNameSpace::AMENDMENTS)};
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet const&
|
TypedKeylet<ltFEE_SETTINGS> const&
|
||||||
fees() noexcept
|
fees() noexcept
|
||||||
{
|
{
|
||||||
static Keylet const ret{
|
static TypedKeylet<ltFEE_SETTINGS> const ret{
|
||||||
ltFEE_SETTINGS, indexHash(LedgerNameSpace::FEE_SETTINGS)};
|
indexHash(LedgerNameSpace::FEE_SETTINGS)};
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet const&
|
TypedKeylet<ltNEGATIVE_UNL> const&
|
||||||
negativeUNL() noexcept
|
negativeUNL() noexcept
|
||||||
{
|
{
|
||||||
static Keylet const ret{
|
static TypedKeylet<ltNEGATIVE_UNL> const ret{
|
||||||
ltNEGATIVE_UNL, indexHash(LedgerNameSpace::NEGATIVE_UNL)};
|
indexHash(LedgerNameSpace::NEGATIVE_UNL)};
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltDIR_NODE>
|
||||||
book_t::operator()(Book const& b) const
|
book_t::operator()(Book const& b) const
|
||||||
{
|
{
|
||||||
return {ltDIR_NODE, getBookBase(b)};
|
return {getBookBase(b)};
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltRIPPLE_STATE>
|
||||||
line(
|
line(
|
||||||
AccountID const& id0,
|
AccountID const& id0,
|
||||||
AccountID const& id1,
|
AccountID const& id1,
|
||||||
@@ -262,7 +261,6 @@ line(
|
|||||||
auto const accounts = std::minmax(id0, id1);
|
auto const accounts = std::minmax(id0, id1);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
ltRIPPLE_STATE,
|
|
||||||
indexHash(
|
indexHash(
|
||||||
LedgerNameSpace::TRUST_LINE,
|
LedgerNameSpace::TRUST_LINE,
|
||||||
accounts.first,
|
accounts.first,
|
||||||
@@ -270,17 +268,15 @@ line(
|
|||||||
currency)};
|
currency)};
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltOFFER>
|
||||||
offer(AccountID const& id, std::uint32_t seq) noexcept
|
offer(AccountID const& id, std::uint32_t seq) noexcept
|
||||||
{
|
{
|
||||||
return {ltOFFER, indexHash(LedgerNameSpace::OFFER, id, seq)};
|
return {indexHash(LedgerNameSpace::OFFER, id, seq)};
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltDIR_NODE>
|
||||||
quality(Keylet const& k, std::uint64_t q) noexcept
|
quality(TypedKeylet<ltDIR_NODE> const& k, std::uint64_t q) noexcept
|
||||||
{
|
{
|
||||||
XRPL_ASSERT(
|
|
||||||
k.type == ltDIR_NODE, "ripple::keylet::quality : valid input type");
|
|
||||||
|
|
||||||
// Indexes are stored in big endian format: they print as hex as stored.
|
// Indexes are stored in big endian format: they print as hex as stored.
|
||||||
// Most significant bytes are first and the least significant bytes
|
// Most significant bytes are first and the least significant bytes
|
||||||
@@ -292,62 +288,57 @@ quality(Keylet const& k, std::uint64_t q) noexcept
|
|||||||
// FIXME This is ugly and we can and should do better...
|
// FIXME This is ugly and we can and should do better...
|
||||||
((std::uint64_t*)x.end())[-1] = boost::endian::native_to_big(q);
|
((std::uint64_t*)x.end())[-1] = boost::endian::native_to_big(q);
|
||||||
|
|
||||||
return {ltDIR_NODE, x};
|
return {x};
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltDIR_NODE>
|
||||||
next_t::operator()(Keylet const& k) const
|
next_t::operator()(TypedKeylet<ltDIR_NODE> const& k) const
|
||||||
{
|
{
|
||||||
XRPL_ASSERT(
|
return {getQualityNext(k.key)};
|
||||||
k.type == ltDIR_NODE,
|
|
||||||
"ripple::keylet::next_t::operator() : valid input type");
|
|
||||||
return {ltDIR_NODE, getQualityNext(k.key)};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltTICKET>
|
||||||
ticket_t::operator()(AccountID const& id, std::uint32_t ticketSeq) const
|
ticket_t::operator()(AccountID const& id, std::uint32_t ticketSeq) const
|
||||||
{
|
{
|
||||||
return {ltTICKET, getTicketIndex(id, ticketSeq)};
|
return {getTicketIndex(id, ticketSeq)};
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltTICKET>
|
||||||
ticket_t::operator()(AccountID const& id, SeqProxy ticketSeq) const
|
ticket_t::operator()(AccountID const& id, SeqProxy ticketSeq) const
|
||||||
{
|
{
|
||||||
return {ltTICKET, getTicketIndex(id, ticketSeq)};
|
return {getTicketIndex(id, ticketSeq)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// This function is presently static, since it's never accessed from anywhere
|
// This function is presently static, since it's never accessed from anywhere
|
||||||
// else. If we ever support multiple pages of signer lists, this would be the
|
// else. If we ever support multiple pages of signer lists, this would be the
|
||||||
// keylet used to locate them.
|
// keylet used to locate them.
|
||||||
static Keylet
|
static TypedKeylet<ltSIGNER_LIST>
|
||||||
signers(AccountID const& account, std::uint32_t page) noexcept
|
signers(AccountID const& account, std::uint32_t page) noexcept
|
||||||
{
|
{
|
||||||
return {
|
return {indexHash(LedgerNameSpace::SIGNER_LIST, account, page)};
|
||||||
ltSIGNER_LIST, indexHash(LedgerNameSpace::SIGNER_LIST, account, page)};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltSIGNER_LIST>
|
||||||
signers(AccountID const& account) noexcept
|
signers(AccountID const& account) noexcept
|
||||||
{
|
{
|
||||||
return signers(account, 0);
|
return signers(account, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltCHECK>
|
||||||
check(AccountID const& id, std::uint32_t seq) noexcept
|
check(AccountID const& id, std::uint32_t seq) noexcept
|
||||||
{
|
{
|
||||||
return {ltCHECK, indexHash(LedgerNameSpace::CHECK, id, seq)};
|
return TypedKeylet<ltCHECK>{indexHash(LedgerNameSpace::CHECK, id, seq)};
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltDEPOSIT_PREAUTH>
|
||||||
depositPreauth(AccountID const& owner, AccountID const& preauthorized) noexcept
|
depositPreauth(AccountID const& owner, AccountID const& preauthorized) noexcept
|
||||||
{
|
{
|
||||||
return {
|
return TypedKeylet<ltDEPOSIT_PREAUTH>{
|
||||||
ltDEPOSIT_PREAUTH,
|
|
||||||
indexHash(LedgerNameSpace::DEPOSIT_PREAUTH, owner, preauthorized)};
|
indexHash(LedgerNameSpace::DEPOSIT_PREAUTH, owner, preauthorized)};
|
||||||
}
|
}
|
||||||
|
|
||||||
// Credentials should be sorted here, use credentials::makeSorted
|
// Credentials should be sorted here, use credentials::makeSorted
|
||||||
Keylet
|
TypedKeylet<ltDEPOSIT_PREAUTH>
|
||||||
depositPreauth(
|
depositPreauth(
|
||||||
AccountID const& owner,
|
AccountID const& owner,
|
||||||
std::set<std::pair<AccountID, Slice>> const& authCreds) noexcept
|
std::set<std::pair<AccountID, Slice>> const& authCreds) noexcept
|
||||||
@@ -357,8 +348,7 @@ depositPreauth(
|
|||||||
for (auto const& o : authCreds)
|
for (auto const& o : authCreds)
|
||||||
hashes.emplace_back(sha512Half(o.first, o.second));
|
hashes.emplace_back(sha512Half(o.first, o.second));
|
||||||
|
|
||||||
return {
|
return TypedKeylet<ltDEPOSIT_PREAUTH>{
|
||||||
ltDEPOSIT_PREAUTH,
|
|
||||||
indexHash(LedgerNameSpace::DEPOSIT_PREAUTH_CREDENTIALS, owner, hashes)};
|
indexHash(LedgerNameSpace::DEPOSIT_PREAUTH_CREDENTIALS, owner, hashes)};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -367,82 +357,79 @@ depositPreauth(
|
|||||||
Keylet
|
Keylet
|
||||||
unchecked(uint256 const& key) noexcept
|
unchecked(uint256 const& key) noexcept
|
||||||
{
|
{
|
||||||
return {ltANY, key};
|
return Keylet{ltANY, key};
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltDIR_NODE>
|
||||||
ownerDir(AccountID const& id) noexcept
|
ownerDir(AccountID const& id) noexcept
|
||||||
{
|
{
|
||||||
return {ltDIR_NODE, indexHash(LedgerNameSpace::OWNER_DIR, id)};
|
return TypedKeylet<ltDIR_NODE>{indexHash(LedgerNameSpace::OWNER_DIR, id)};
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltDIR_NODE>
|
||||||
page(uint256 const& key, std::uint64_t index) noexcept
|
page(uint256 const& key, std::uint64_t index) noexcept
|
||||||
{
|
{
|
||||||
if (index == 0)
|
if (index == 0)
|
||||||
return {ltDIR_NODE, key};
|
return TypedKeylet<ltDIR_NODE>{key};
|
||||||
|
|
||||||
return {ltDIR_NODE, indexHash(LedgerNameSpace::DIR_NODE, key, index)};
|
return TypedKeylet<ltDIR_NODE>{indexHash(LedgerNameSpace::DIR_NODE, key, index)};
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltESCROW>
|
||||||
escrow(AccountID const& src, std::uint32_t seq) noexcept
|
escrow(AccountID const& src, std::uint32_t seq) noexcept
|
||||||
{
|
{
|
||||||
return {ltESCROW, indexHash(LedgerNameSpace::ESCROW, src, seq)};
|
return TypedKeylet<ltESCROW>{indexHash(LedgerNameSpace::ESCROW, src, seq)};
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltPAYCHAN>
|
||||||
payChan(AccountID const& src, AccountID const& dst, std::uint32_t seq) noexcept
|
payChan(AccountID const& src, AccountID const& dst, std::uint32_t seq) noexcept
|
||||||
{
|
{
|
||||||
return {
|
return TypedKeylet<ltPAYCHAN>{
|
||||||
ltPAYCHAN,
|
|
||||||
indexHash(LedgerNameSpace::XRP_PAYMENT_CHANNEL, src, dst, seq)};
|
indexHash(LedgerNameSpace::XRP_PAYMENT_CHANNEL, src, dst, seq)};
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltNFTOKEN_PAGE>
|
||||||
nftpage_min(AccountID const& owner)
|
nftpage_min(AccountID const& owner)
|
||||||
{
|
{
|
||||||
std::array<std::uint8_t, 32> buf{};
|
std::array<std::uint8_t, 32> buf{};
|
||||||
std::memcpy(buf.data(), owner.data(), owner.size());
|
std::memcpy(buf.data(), owner.data(), owner.size());
|
||||||
return {ltNFTOKEN_PAGE, uint256{buf}};
|
return TypedKeylet<ltNFTOKEN_PAGE>{uint256{buf}};
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltNFTOKEN_PAGE>
|
||||||
nftpage_max(AccountID const& owner)
|
nftpage_max(AccountID const& owner)
|
||||||
{
|
{
|
||||||
uint256 id = nft::pageMask;
|
uint256 id = nft::pageMask;
|
||||||
std::memcpy(id.data(), owner.data(), owner.size());
|
std::memcpy(id.data(), owner.data(), owner.size());
|
||||||
return {ltNFTOKEN_PAGE, id};
|
return TypedKeylet<ltNFTOKEN_PAGE>{id};
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltNFTOKEN_PAGE>
|
||||||
nftpage(Keylet const& k, uint256 const& token)
|
nftpage(TypedKeylet<ltNFTOKEN_PAGE> const& k, uint256 const& token)
|
||||||
{
|
{
|
||||||
XRPL_ASSERT(
|
return {(k.key & ~nft::pageMask) + (token & nft::pageMask)};
|
||||||
k.type == ltNFTOKEN_PAGE, "ripple::keylet::nftpage : valid input type");
|
|
||||||
return {ltNFTOKEN_PAGE, (k.key & ~nft::pageMask) + (token & nft::pageMask)};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltNFTOKEN_OFFER>
|
||||||
nftoffer(AccountID const& owner, std::uint32_t seq)
|
nftoffer(AccountID const& owner, std::uint32_t seq)
|
||||||
{
|
{
|
||||||
return {
|
return TypedKeylet<ltNFTOKEN_OFFER>{
|
||||||
ltNFTOKEN_OFFER, indexHash(LedgerNameSpace::NFTOKEN_OFFER, owner, seq)};
|
indexHash(LedgerNameSpace::NFTOKEN_OFFER, owner, seq)};
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltDIR_NODE>
|
||||||
nft_buys(uint256 const& id) noexcept
|
nft_buys(uint256 const& id) noexcept
|
||||||
{
|
{
|
||||||
return {ltDIR_NODE, indexHash(LedgerNameSpace::NFTOKEN_BUY_OFFERS, id)};
|
return TypedKeylet<ltDIR_NODE>{indexHash(LedgerNameSpace::NFTOKEN_BUY_OFFERS, id)};
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltDIR_NODE>
|
||||||
nft_sells(uint256 const& id) noexcept
|
nft_sells(uint256 const& id) noexcept
|
||||||
{
|
{
|
||||||
return {ltDIR_NODE, indexHash(LedgerNameSpace::NFTOKEN_SELL_OFFERS, id)};
|
return TypedKeylet<ltDIR_NODE>{indexHash(LedgerNameSpace::NFTOKEN_SELL_OFFERS, id)};
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltAMM>
|
||||||
amm(Asset const& issue1, Asset const& issue2) noexcept
|
amm(Asset const& issue1, Asset const& issue2) noexcept
|
||||||
{
|
{
|
||||||
auto const& [minI, maxI] =
|
auto const& [minI, maxI] =
|
||||||
@@ -455,38 +442,35 @@ amm(Asset const& issue1, Asset const& issue2) noexcept
|
|||||||
maxI.currency));
|
maxI.currency));
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltAMM>
|
||||||
amm(uint256 const& id) noexcept
|
amm(uint256 const& id) noexcept
|
||||||
{
|
{
|
||||||
return {ltAMM, id};
|
return TypedKeylet<ltAMM>{id};
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltDELEGATE>
|
||||||
delegate(AccountID const& account, AccountID const& authorizedAccount) noexcept
|
delegate(AccountID const& account, AccountID const& authorizedAccount) noexcept
|
||||||
{
|
{
|
||||||
return {
|
return TypedKeylet<ltDELEGATE>{
|
||||||
ltDELEGATE,
|
|
||||||
indexHash(LedgerNameSpace::DELEGATE, account, authorizedAccount)};
|
indexHash(LedgerNameSpace::DELEGATE, account, authorizedAccount)};
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltBRIDGE>
|
||||||
bridge(STXChainBridge const& bridge, STXChainBridge::ChainType chainType)
|
bridge(STXChainBridge const& bridge, STXChainBridge::ChainType chainType)
|
||||||
{
|
{
|
||||||
// A door account can support multiple bridges. On the locking chain
|
// A door account can support multiple bridges. On the locking chain
|
||||||
// there can only be one bridge per lockingChainCurrency. On the issuing
|
// there can only be one bridge per lockingChainCurrency. On the issuing
|
||||||
// chain there can only be one bridge per issuingChainCurrency.
|
// chain there can only be one bridge per issuingChainCurrency.
|
||||||
auto const& issue = bridge.issue(chainType);
|
auto const& issue = bridge.issue(chainType);
|
||||||
return {
|
return TypedKeylet<ltBRIDGE>{
|
||||||
ltBRIDGE,
|
|
||||||
indexHash(
|
indexHash(
|
||||||
LedgerNameSpace::BRIDGE, bridge.door(chainType), issue.currency)};
|
LedgerNameSpace::BRIDGE, bridge.door(chainType), issue.currency)};
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltXCHAIN_OWNED_CLAIM_ID>
|
||||||
xChainClaimID(STXChainBridge const& bridge, std::uint64_t seq)
|
xChainClaimID(STXChainBridge const& bridge, std::uint64_t seq)
|
||||||
{
|
{
|
||||||
return {
|
return TypedKeylet<ltXCHAIN_OWNED_CLAIM_ID>{
|
||||||
ltXCHAIN_OWNED_CLAIM_ID,
|
|
||||||
indexHash(
|
indexHash(
|
||||||
LedgerNameSpace::XCHAIN_CLAIM_ID,
|
LedgerNameSpace::XCHAIN_CLAIM_ID,
|
||||||
bridge.lockingChainDoor(),
|
bridge.lockingChainDoor(),
|
||||||
@@ -496,11 +480,10 @@ xChainClaimID(STXChainBridge const& bridge, std::uint64_t seq)
|
|||||||
seq)};
|
seq)};
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltXCHAIN_OWNED_CREATE_ACCOUNT_CLAIM_ID>
|
||||||
xChainCreateAccountClaimID(STXChainBridge const& bridge, std::uint64_t seq)
|
xChainCreateAccountClaimID(STXChainBridge const& bridge, std::uint64_t seq)
|
||||||
{
|
{
|
||||||
return {
|
return TypedKeylet<ltXCHAIN_OWNED_CREATE_ACCOUNT_CLAIM_ID>{
|
||||||
ltXCHAIN_OWNED_CREATE_ACCOUNT_CLAIM_ID,
|
|
||||||
indexHash(
|
indexHash(
|
||||||
LedgerNameSpace::XCHAIN_CREATE_ACCOUNT_CLAIM_ID,
|
LedgerNameSpace::XCHAIN_CREATE_ACCOUNT_CLAIM_ID,
|
||||||
bridge.lockingChainDoor(),
|
bridge.lockingChainDoor(),
|
||||||
@@ -510,74 +493,71 @@ xChainCreateAccountClaimID(STXChainBridge const& bridge, std::uint64_t seq)
|
|||||||
seq)};
|
seq)};
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltDID>
|
||||||
did(AccountID const& account) noexcept
|
did(AccountID const& account) noexcept
|
||||||
{
|
{
|
||||||
return {ltDID, indexHash(LedgerNameSpace::DID, account)};
|
return TypedKeylet<ltDID>{indexHash(LedgerNameSpace::DID, account)};
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltORACLE>
|
||||||
oracle(AccountID const& account, std::uint32_t const& documentID) noexcept
|
oracle(AccountID const& account, std::uint32_t const& documentID) noexcept
|
||||||
{
|
{
|
||||||
return {ltORACLE, indexHash(LedgerNameSpace::ORACLE, account, documentID)};
|
return TypedKeylet<ltORACLE>{indexHash(LedgerNameSpace::ORACLE, account, documentID)};
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltMPTOKEN_ISSUANCE>
|
||||||
mptIssuance(std::uint32_t seq, AccountID const& issuer) noexcept
|
mptIssuance(std::uint32_t seq, AccountID const& issuer) noexcept
|
||||||
{
|
{
|
||||||
return mptIssuance(makeMptID(seq, issuer));
|
return mptIssuance(makeMptID(seq, issuer));
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltMPTOKEN_ISSUANCE>
|
||||||
mptIssuance(MPTID const& issuanceID) noexcept
|
mptIssuance(MPTID const& issuanceID) noexcept
|
||||||
{
|
{
|
||||||
return {
|
return TypedKeylet<ltMPTOKEN_ISSUANCE>{
|
||||||
ltMPTOKEN_ISSUANCE,
|
|
||||||
indexHash(LedgerNameSpace::MPTOKEN_ISSUANCE, issuanceID)};
|
indexHash(LedgerNameSpace::MPTOKEN_ISSUANCE, issuanceID)};
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltMPTOKEN>
|
||||||
mptoken(MPTID const& issuanceID, AccountID const& holder) noexcept
|
mptoken(MPTID const& issuanceID, AccountID const& holder) noexcept
|
||||||
{
|
{
|
||||||
return mptoken(mptIssuance(issuanceID).key, holder);
|
return mptoken(mptIssuance(issuanceID).key, holder);
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltMPTOKEN>
|
||||||
mptoken(uint256 const& issuanceKey, AccountID const& holder) noexcept
|
mptoken(uint256 const& issuanceKey, AccountID const& holder) noexcept
|
||||||
{
|
{
|
||||||
return {
|
return TypedKeylet<ltMPTOKEN>{
|
||||||
ltMPTOKEN, indexHash(LedgerNameSpace::MPTOKEN, issuanceKey, holder)};
|
indexHash(LedgerNameSpace::MPTOKEN, issuanceKey, holder)};
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltCREDENTIAL>
|
||||||
credential(
|
credential(
|
||||||
AccountID const& subject,
|
AccountID const& subject,
|
||||||
AccountID const& issuer,
|
AccountID const& issuer,
|
||||||
Slice const& credType) noexcept
|
Slice const& credType) noexcept
|
||||||
{
|
{
|
||||||
return {
|
return TypedKeylet<ltCREDENTIAL>{
|
||||||
ltCREDENTIAL,
|
|
||||||
indexHash(LedgerNameSpace::CREDENTIAL, subject, issuer, credType)};
|
indexHash(LedgerNameSpace::CREDENTIAL, subject, issuer, credType)};
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltVAULT>
|
||||||
vault(AccountID const& owner, std::uint32_t seq) noexcept
|
vault(AccountID const& owner, std::uint32_t seq) noexcept
|
||||||
{
|
{
|
||||||
return vault(indexHash(LedgerNameSpace::VAULT, owner, seq));
|
return vault(indexHash(LedgerNameSpace::VAULT, owner, seq));
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltPERMISSIONED_DOMAIN>
|
||||||
permissionedDomain(AccountID const& account, std::uint32_t seq) noexcept
|
permissionedDomain(AccountID const& account, std::uint32_t seq) noexcept
|
||||||
{
|
{
|
||||||
return {
|
return TypedKeylet<ltPERMISSIONED_DOMAIN>{
|
||||||
ltPERMISSIONED_DOMAIN,
|
|
||||||
indexHash(LedgerNameSpace::PERMISSIONED_DOMAIN, account, seq)};
|
indexHash(LedgerNameSpace::PERMISSIONED_DOMAIN, account, seq)};
|
||||||
}
|
}
|
||||||
|
|
||||||
Keylet
|
TypedKeylet<ltPERMISSIONED_DOMAIN>
|
||||||
permissionedDomain(uint256 const& domainID) noexcept
|
permissionedDomain(uint256 const& domainID) noexcept
|
||||||
{
|
{
|
||||||
return {ltPERMISSIONED_DOMAIN, domainID};
|
return TypedKeylet<ltPERMISSIONED_DOMAIN>{domainID};
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace keylet
|
} // namespace keylet
|
||||||
|
|||||||
@@ -312,8 +312,8 @@ MPTTester::forObject(
|
|||||||
{
|
{
|
||||||
if (!id_)
|
if (!id_)
|
||||||
Throw<std::runtime_error>("MPT has not been created");
|
Throw<std::runtime_error>("MPT has not been created");
|
||||||
auto const key = holder_ ? keylet::mptoken(*id_, holder_->id())
|
auto const key = holder_ ? keylet::mptoken(*id_, holder_->id()).untyped()
|
||||||
: keylet::mptIssuance(*id_);
|
: keylet::mptIssuance(*id_).untyped();
|
||||||
if (auto const sle = env_.le(key))
|
if (auto const sle = env_.le(key))
|
||||||
return cb(sle);
|
return cb(sle);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ doVaultInfo(RPC::JsonContext& context)
|
|||||||
auto const sleVault = lpLedger->read(keylet::vault(uNodeIndex));
|
auto const sleVault = lpLedger->read(keylet::vault(uNodeIndex));
|
||||||
auto const sleIssuance = sleVault == nullptr //
|
auto const sleIssuance = sleVault == nullptr //
|
||||||
? nullptr
|
? nullptr
|
||||||
: lpLedger->read(keylet::mptIssuance(sleVault->at(sfShareMPTID)));
|
: lpLedger->read(keylet::mptIssuance(sleVault->at(sfShareMPTID)).untyped());
|
||||||
if (!sleVault || !sleIssuance)
|
if (!sleVault || !sleIssuance)
|
||||||
{
|
{
|
||||||
jvResult[jss::error] = "entryNotFound";
|
jvResult[jss::error] = "entryNotFound";
|
||||||
|
|||||||
Reference in New Issue
Block a user