20 #include <ripple/basics/BasicConfig.h>
21 #include <ripple/core/ConfigSections.h>
22 #include <ripple/protocol/jss.h>
24 #include <test/jtx/Env.h>
43 cfg->NETWORK_ID = networkID;
52 "Require txn NetworkID to be specified (or not) depending on the "
53 "network ID of the node");
56 auto const alice =
Account{
"alice"};
60 TER expectedOutcome) {
68 jv[jss::Destination] = alice.human();
69 jv[jss::TransactionType] =
"Payment";
70 jv[jss::Amount] =
"10000000000";
74 env(jv,
fee(1000),
ter(expectedOutcome));
85 jv[jss::Account] = alice.human();
86 jv[jss::TransactionType] = jss::AccountSet;
91 jv[jss::NetworkID] = 0;
96 jv[jss::NetworkID] = 10000;
108 jv[jss::Account] = alice.human();
109 jv[jss::TransactionType] = jss::AccountSet;
113 jv[jss::NetworkID] = 1024;
116 jv[jss::NetworkID] = 1000;
129 jvn[jss::Account] = alice.human();
130 jvn[jss::TransactionType] = jss::AccountSet;
132 jvn[jss::Sequence] = env.
seq(alice);
133 jvn[jss::LastLedgerSequence] = env.
current()->info().seq + 2;
140 strHex(s.
slice()))[jss::result][jss::engine_result] ==
141 "telREQUIRES_NETWORK_ID");
146 jv[jss::Account] = alice.human();
147 jv[jss::TransactionType] = jss::AccountSet;
150 jv[jss::NetworkID] = 0;
153 jv[jss::NetworkID] = 1024;
157 jv[jss::NetworkID] = 1025;
const XRP_t XRP
Converts to XRP Issue or STAmount.
Json::Value rpc(unsigned apiVersion, std::unordered_map< std::string, std::string > const &headers, std::string const &cmd, Args &&... args)
Execute an RPC command.
Set the expected result code for a JTx The test will fail if the code doesn't match.
std::string const & human() const
Returns the human readable public key.
@ telNETWORK_ID_MAKES_TX_NON_CANONICAL
std::unique_ptr< Config > envconfig()
creates and initializes a default configuration for jtx::Env
virtual Config & config()=0
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Slice slice() const noexcept
Set the regular signature on a JTx.
std::uint32_t seq(Account const &account) const
Returns the next sequence number on account.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
std::string to_string(Manifest const &m)
Format the specified manifest to a string for debugging purposes.
Immutable cryptographic account descriptor.
std::string strHex(FwdIt begin, FwdIt end)
void memoize(Account const &account)
Associate AccountID with account.
std::unique_ptr< Config > makeNetworkConfig(uint32_t networkID)
JTx jtnofill(JsonValue &&jv, FN const &... fN)
Create a JTx from parameters.
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
A transaction testing environment.
BEAST_DEFINE_TESTSUITE(DeliverMin, app, ripple)