21#include <test/jtx/Env.h>
22#include <xrpld/core/ConfigSections.h>
23#include <xrpl/basics/BasicConfig.h>
24#include <xrpl/protocol/jss.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;
163BEAST_DEFINE_TESTSUITE(NetworkID, app,
ripple);
testcase_t testcase
Memberspace for declaring test cases.
virtual Config & config()=0
Slice slice() const noexcept
void run() override
Runs the suite.
std::unique_ptr< Config > makeNetworkConfig(uint32_t networkID)
Immutable cryptographic account descriptor.
std::string const & human() const
Returns the human readable public key.
A transaction testing environment.
std::uint32_t seq(Account const &account) const
Returns the next sequence number on account.
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
Json::Value rpc(unsigned apiVersion, std::unordered_map< std::string, std::string > const &headers, std::string const &cmd, Args &&... args)
Execute an RPC command.
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
JTx jtnofill(JsonValue &&jv, FN const &... fN)
Create a JTx from parameters.
void memoize(Account const &account)
Associate AccountID with account.
Set the regular signature on a JTx.
Set the expected result code for a JTx The test will fail if the code doesn't match.
std::unique_ptr< Config > envconfig()
creates and initializes a default configuration for jtx::Env
XRP_t const XRP
Converts to XRP Issue or STAmount.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
@ telNETWORK_ID_MAKES_TX_NON_CANONICAL
std::string strHex(FwdIt begin, FwdIt end)
std::string to_string(base_uint< Bits, Tag > const &a)