xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
test
jtx
permissioned_domains.h
1
#pragma once
2
3
#include <test/jtx/Account.h>
4
#include <test/jtx/Env.h>
5
#include <test/jtx/deposit.h>
6
7
#include <xrpl/basics/base_uint.h>
8
#include <xrpl/json/json_value.h>
9
#include <xrpl/protocol/AccountID.h>
10
#include <xrpl/protocol/STObject.h>
11
12
#include <
map
>
13
#include <
memory
>
14
#include <
optional
>
15
#include <
string
>
16
#include <
unordered_map
>
17
#include <
vector
>
18
19
namespace
xrpl::test::jtx::pdomain
{
20
21
// Helpers for PermissionedDomains testing
22
using
Credential
=
xrpl::test::jtx::deposit::AuthorizeCredentials
;
23
using
Credentials
=
std::vector<Credential>
;
24
25
// helpers
26
// Make json for PermissionedDomainSet transaction
27
json::Value
28
setTx
(
29
AccountID
const
& account,
30
Credentials
const
&
credentials
,
31
std::optional<UInt256>
domain = std::nullopt);
32
33
// Make json for PermissionedDomainDelete transaction
34
json::Value
35
deleteTx
(
AccountID
const
& account,
UInt256
const
& domain);
36
37
// Get PermissionedDomain objects from account_objects rpc call
38
std::map<UInt256, json::Value>
39
getObjects
(
Account
const
& account,
Env
& env,
bool
withType =
true
);
40
41
// Check if ledger object is there
42
bool
43
objectExists
(
UInt256
const
& objID,
Env
& env);
44
45
// Extract credentials from account_object object
46
Credentials
47
credentialsFromJson
(
48
json::Value
const
&
object
,
49
std::unordered_map<std::string, Account>
const
& human2Acc);
50
51
// Sort credentials the same way as PermissionedDomainSet
52
Credentials
53
sortCredentials
(
Credentials
const
& input);
54
55
// Get newly created domain from transaction metadata.
56
UInt256
57
getNewDomain
(
std::shared_ptr<STObject const>
const
& meta);
58
59
}
// namespace xrpl::test::jtx::pdomain
json::Value
Represents a JSON value.
Definition
json_value.h:117
xrpl::test::jtx::Account
Immutable cryptographic account descriptor.
Definition
jtx/Account.h:21
xrpl::test::jtx::Env
A transaction testing environment.
Definition
Env.h:161
map
memory
xrpl::test::jtx::credentials
Definition
credentials.h:18
xrpl::test::jtx::pdomain
Definition
permissioned_domains.cpp:25
xrpl::test::jtx::pdomain::Credential
xrpl::test::jtx::deposit::AuthorizeCredentials Credential
Definition
permissioned_domains.h:22
xrpl::test::jtx::pdomain::getObjects
std::map< UInt256, json::Value > getObjects(Account const &account, Env &env, bool withType)
Definition
permissioned_domains.cpp:63
xrpl::test::jtx::pdomain::Credentials
std::vector< Credential > Credentials
Definition
permissioned_domains.h:23
xrpl::test::jtx::pdomain::credentialsFromJson
Credentials credentialsFromJson(json::Value const &object, std::unordered_map< std::string, Account > const &human2Acc)
Definition
permissioned_domains.cpp:118
xrpl::test::jtx::pdomain::deleteTx
json::Value deleteTx(AccountID const &account, UInt256 const &domain)
Definition
permissioned_domains.cpp:52
xrpl::test::jtx::pdomain::getNewDomain
UInt256 getNewDomain(std::shared_ptr< STObject const > const &meta)
Definition
permissioned_domains.cpp:152
xrpl::test::jtx::pdomain::setTx
json::Value setTx(AccountID const &account, Credentials const &credentials, std::optional< UInt256 > domain)
Definition
permissioned_domains.cpp:30
xrpl::test::jtx::pdomain::objectExists
bool objectExists(UInt256 const &objID, Env &env)
Definition
permissioned_domains.cpp:97
xrpl::test::jtx::pdomain::sortCredentials
Credentials sortCredentials(Credentials const &input)
Definition
permissioned_domains.cpp:143
xrpl::UInt256
BaseUInt< 256 > UInt256
Definition
base_uint.h:580
xrpl::AccountID
BaseUInt< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
Definition
AccountID.h:34
optional
std::shared_ptr
string
xrpl::test::jtx::deposit::AuthorizeCredentials
Definition
deposit.h:31
unordered_map
vector
Generated by
1.17.0