rippled
Loading...
Searching...
No Matches
permissioned_domains.h
1//------------------------------------------------------------------------------
2/*
3 This file is part of rippled: https://github.com/ripple/rippled
4 Copyright (c) 2024 Ripple Labs Inc.
5
6 Permission to use, copy, modify, and/or distribute this software for any
7 purpose with or without fee is hereby granted, provided that the above
8 copyright notice and this permission notice appear in all copies.
9
10 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17*/
18//==============================================================================
19
20#ifndef RIPPLE_TEST_JTX_PERMISSIONED_DOMAINS_H_INCLUDED
21#define RIPPLE_TEST_JTX_PERMISSIONED_DOMAINS_H_INCLUDED
22
23#include <test/jtx/Account.h>
24#include <test/jtx/Env.h>
25#include <test/jtx/deposit.h>
26
27namespace ripple {
28namespace test {
29namespace jtx {
30namespace pdomain {
31
32// Helpers for PermissionedDomains testing
35
36// helpers
37// Make json for PermissionedDomainSet transaction
39setTx(
40 AccountID const& account,
41 Credentials const& credentials,
43
44// Make json for PermissionedDomainDelete transaction
46deleteTx(AccountID const& account, uint256 const& domain);
47
48// Get PermissionedDomain objects from account_objects rpc call
50getObjects(Account const& account, Env& env, bool withType = true);
51
52// Check if ledger object is there
53bool
54objectExists(uint256 const& objID, Env& env);
55
56// Extract credentials from account_object object
59 Json::Value const& object,
61
62// Sort credentials the same way as PermissionedDomainSet
64sortCredentials(Credentials const& input);
65
66// Get newly created domain from transaction metadata.
69
70} // namespace pdomain
71} // namespace jtx
72} // namespace test
73} // namespace ripple
74
75#endif
Represents a JSON value.
Definition json_value.h:149
Immutable cryptographic account descriptor.
Definition Account.h:39
A transaction testing environment.
Definition Env.h:121
Set the domain on a JTx.
Definition domain.h:30
T is_same_v
Credentials sortCredentials(Credentials const &input)
Credentials credentialsFromJson(Json::Value const &object, std::unordered_map< std::string, Account > const &human2Acc)
bool objectExists(uint256 const &objID, Env &env)
Json::Value deleteTx(AccountID const &account, uint256 const &domain)
Json::Value setTx(AccountID const &account, Credentials const &credentials, std::optional< uint256 > domain)
std::map< uint256, Json::Value > getObjects(Account const &account, Env &env, bool withType)
uint256 getNewDomain(std::shared_ptr< STObject const > const &meta)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:25