1#include <test/jtx/delegate.h>
3#include <xrpl/protocol/jss.h>
17 jv[jss::TransactionType] = jss::DelegateSet;
18 jv[jss::Account] = account.human();
19 jv[sfAuthorize.jsonName] = authorize.
human();
21 for (
auto const& permission : permissions)
24 permissionValue[sfPermissionValue.jsonName] = permission;
26 permissionObj[sfPermission.jsonName] = permissionValue;
27 permissionsJson.
append(permissionObj);
30 jv[sfPermissions.jsonName] = permissionsJson;
39 jvParams[jss::ledger_index] = jss::validated;
40 jvParams[jss::delegate][jss::account] = account.human();
41 jvParams[jss::delegate][jss::authorize] = authorize.
human();
42 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)