20#include <test/jtx/delegate.h>
22#include <xrpl/protocol/jss.h>
36 jv[jss::TransactionType] = jss::DelegateSet;
37 jv[jss::Account] = account.human();
38 jv[sfAuthorize.jsonName] = authorize.
human();
40 for (
auto const& permission : permissions)
43 permissionValue[sfPermissionValue.jsonName] = permission;
45 permissionObj[sfPermission.jsonName] = permissionValue;
46 permissionsJson.
append(permissionObj);
49 jv[sfPermissions.jsonName] = permissionsJson;
58 jvParams[jss::ledger_index] = jss::validated;
59 jvParams[jss::delegate][jss::account] = account.human();
60 jvParams[jss::delegate][jss::authorize] = authorize.
human();
61 return env.
rpc(
"json",
"ledger_entry",
to_string(jvParams));
Value & append(Value const &value)
Append value to array at the end.
Immutable cryptographic account descriptor.
std::string const & human() const
Returns the human readable public key.
A transaction testing environment.
Json::Value rpc(unsigned apiVersion, std::unordered_map< std::string, std::string > const &headers, std::string const &cmd, Args &&... args)
Execute an RPC command.
@ arrayValue
array value (ordered list)
Keylet delegate(AccountID const &account, AccountID const &authorizedAccount) noexcept
A keylet for Delegate object.
Json::Value entry(jtx::Env &env, jtx::Account const &account, jtx::Account const &authorize)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
bool set(T &target, std::string const &name, Section const §ion)
Set a value from a configuration Section If the named value is not found or doesn't parse as a T,...
std::string to_string(base_uint< Bits, Tag > const &a)