xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
test
jtx
impl
ledgerStateFixes.cpp
1
#include <test/jtx/Account.h>
2
#include <test/jtx/ledgerStateFix.h>
3
4
#include <xrpl/basics/base_uint.h>
5
#include <xrpl/json/json_value.h>
6
#include <xrpl/protocol/SField.h>
7
#include <xrpl/protocol/jss.h>
8
#include <xrpl/tx/transactors/system/LedgerStateFix.h>
9
10
#include <
cstdint
>
11
12
namespace
xrpl::test::jtx::ledger_state_fix
{
13
14
// Fix NFTokenPage links on owner's account. acct pays fee.
15
json::Value
16
nftPageLinks
(
jtx::Account
const
& acct,
jtx::Account
const
& owner)
17
{
18
json::Value
jv;
19
jv[sfAccount.jsonName] = acct.
human
();
20
jv[sfLedgerFixType.jsonName] =
static_cast<
uint16_t
>
(
LedgerStateFix::FixType::NfTokenPageLink
);
21
jv[sfOwner.jsonName] = owner.
human
();
22
jv[sfTransactionType.jsonName] = jss::LedgerStateFix;
23
return
jv;
24
}
25
26
// Fix sfExchangeRate on a book directory. acct pays fee.
27
json::Value
28
bookExchangeRate
(
jtx::Account
const
& acct,
UInt256
const
& bookDir)
29
{
30
json::Value
jv;
31
jv[sfAccount.jsonName] = acct.
human
();
32
jv[sfLedgerFixType.jsonName] =
static_cast<
uint16_t
>
(
LedgerStateFix::FixType::BookExchangeRate
);
33
jv[sfBookDirectory.jsonName] =
to_string
(bookDir);
34
jv[sfTransactionType.jsonName] = jss::LedgerStateFix;
35
return
jv;
36
}
37
38
}
// namespace xrpl::test::jtx::ledger_state_fix
json::Value
Represents a JSON value.
Definition
json_value.h:117
xrpl::LedgerStateFix::FixType::NfTokenPageLink
@ NfTokenPageLink
Definition
tx/transactors/system/LedgerStateFix.h:20
xrpl::LedgerStateFix::FixType::BookExchangeRate
@ BookExchangeRate
Definition
tx/transactors/system/LedgerStateFix.h:21
xrpl::test::jtx::Account
Immutable cryptographic account descriptor.
Definition
jtx/Account.h:21
xrpl::test::jtx::Account::human
std::string const & human() const
Returns the human readable public key.
Definition
jtx/Account.h:113
cstdint
xrpl::test::jtx::ledger_state_fix
LedgerStateFix operations.
Definition
ledgerStateFixes.cpp:12
xrpl::test::jtx::ledger_state_fix::nftPageLinks
json::Value nftPageLinks(jtx::Account const &acct, jtx::Account const &owner)
Repair the links in an NFToken directory.
Definition
ledgerStateFixes.cpp:16
xrpl::test::jtx::ledger_state_fix::bookExchangeRate
json::Value bookExchangeRate(jtx::Account const &acct, UInt256 const &bookDir)
Repair sfExchangeRate on a book directory's first page.
Definition
ledgerStateFixes.cpp:28
xrpl::to_string
std::string to_string(BaseUInt< Bits, Tag > const &a)
Definition
base_uint.h:657
xrpl::UInt256
BaseUInt< 256 > UInt256
Definition
base_uint.h:580
Generated by
1.17.0