4#include <test/jtx/Env.h>
6#include <xrpl/protocol/jss.h>
25 cfg->NETWORK_ID = networkID;
34 "Require txn NetworkID to be specified (or not) depending on the "
35 "network ID of the node");
38 auto const alice =
Account{
"alice"};
42 TER expectedOutcome) {
50 jv[jss::Destination] = alice.human();
51 jv[jss::TransactionType] =
"Payment";
52 jv[jss::Amount] =
"10000000000";
56 env(jv,
fee(1000),
ter(expectedOutcome));
67 jv[jss::Account] = alice.human();
68 jv[jss::TransactionType] = jss::AccountSet;
73 jv[jss::NetworkID] = 0;
78 jv[jss::NetworkID] = 10000;
90 jv[jss::Account] = alice.human();
91 jv[jss::TransactionType] = jss::AccountSet;
95 jv[jss::NetworkID] = 1024;
98 jv[jss::NetworkID] = 1000;
111 jvn[jss::Account] = alice.human();
112 jvn[jss::TransactionType] = jss::AccountSet;
114 jvn[jss::Sequence] = env.
seq(alice);
115 jvn[jss::LastLedgerSequence] = env.
current()->info().seq + 2;
122 strHex(s.
slice()))[jss::result][jss::engine_result] ==
123 "telREQUIRES_NETWORK_ID");
128 jv[jss::Account] = alice.human();
129 jv[jss::TransactionType] = jss::AccountSet;
132 jv[jss::NetworkID] = 0;
135 jv[jss::NetworkID] = 1024;
139 jv[jss::NetworkID] = 1025;
145BEAST_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)