21#include <test/jtx/Env.h>
23#include <xrpl/protocol/jss.h>
42 cfg->NETWORK_ID = networkID;
51 "Require txn NetworkID to be specified (or not) depending on the "
52 "network ID of the node");
55 auto const alice =
Account{
"alice"};
59 TER expectedOutcome) {
67 jv[jss::Destination] = alice.human();
68 jv[jss::TransactionType] =
"Payment";
69 jv[jss::Amount] =
"10000000000";
73 env(jv,
fee(1000),
ter(expectedOutcome));
84 jv[jss::Account] = alice.human();
85 jv[jss::TransactionType] = jss::AccountSet;
90 jv[jss::NetworkID] = 0;
95 jv[jss::NetworkID] = 10000;
107 jv[jss::Account] = alice.human();
108 jv[jss::TransactionType] = jss::AccountSet;
112 jv[jss::NetworkID] = 1024;
115 jv[jss::NetworkID] = 1000;
128 jvn[jss::Account] = alice.human();
129 jvn[jss::TransactionType] = jss::AccountSet;
131 jvn[jss::Sequence] = env.
seq(alice);
132 jvn[jss::LastLedgerSequence] = env.
current()->info().seq + 2;
139 strHex(s.
slice()))[jss::result][jss::engine_result] ==
140 "telREQUIRES_NETWORK_ID");
145 jv[jss::Account] = alice.human();
146 jv[jss::TransactionType] = jss::AccountSet;
149 jv[jss::NetworkID] = 0;
152 jv[jss::NetworkID] = 1024;
156 jv[jss::NetworkID] = 1025;
162BEAST_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)