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.h>
24#include <test/jtx/deposit.h>
25
26namespace ripple {
27namespace test {
28namespace jtx {
29namespace pdomain {
30
31// Helpers for PermissionedDomains testing
34
35// helpers
36// Make json for PermissionedDomainSet transaction
38setTx(
39 AccountID const& account,
40 Credentials const& credentials,
41 std::optional<uint256> domain = std::nullopt);
42
43// Make json for PermissionedDomainDelete transaction
45deleteTx(AccountID const& account, uint256 const& domain);
46
47// Get PermissionedDomain objects from account_objects rpc call
49getObjects(Account const& account, Env& env, bool withType = true);
50
51// Check if ledger object is there
52bool
53objectExists(uint256 const& objID, Env& env);
54
55// Extract credentials from account_object object
58 Json::Value const& object,
60
61// Sort credentials the same way as PermissionedDomainSet
63sortCredentials(Credentials const& input);
64
65// Get newly created domain from transaction metadata.
68
69} // namespace pdomain
70} // namespace jtx
71} // namespace test
72} // namespace ripple
73
74#endif
Represents a JSON value.
Definition: json_value.h:150
Immutable cryptographic account descriptor.
Definition: Account.h:39
A transaction testing environment.
Definition: Env.h:121
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:26