xrpld
Loading...
Searching...
No Matches
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
13
14// Fix NFTokenPage links on owner's account. acct pays fee.
16nftPageLinks(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.
28bookExchangeRate(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::ledgerStateFix
Represents a JSON value.
Definition json_value.h:130
Immutable cryptographic account descriptor.
Definition jtx/Account.h:17
std::string const & human() const
Returns the human readable public key.
Definition jtx/Account.h:92
LedgerStateFix operations.
json::Value bookExchangeRate(jtx::Account const &acct, uint256 const &bookDir)
Repair sfExchangeRate on a book directory's first page.
json::Value nftPageLinks(jtx::Account const &acct, jtx::Account const &owner)
Repair the links in an NFToken directory.
std::string to_string(BaseUInt< Bits, Tag > const &a)
Definition base_uint.h:633
BaseUInt< 256 > uint256
Definition base_uint.h:562