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"};
48 jv[jss::Destination] = alice.human();
49 jv[jss::TransactionType] =
"Payment";
50 jv[jss::Amount] =
"10000000000";
54 env(jv,
fee(1000),
ter(expectedOutcome));
65 jv[jss::Account] = alice.human();
66 jv[jss::TransactionType] = jss::AccountSet;
71 jv[jss::NetworkID] = 0;
76 jv[jss::NetworkID] = 10000;
88 jv[jss::Account] = alice.human();
89 jv[jss::TransactionType] = jss::AccountSet;
93 jv[jss::NetworkID] = 1024;
96 jv[jss::NetworkID] = 1000;
109 jvn[jss::Account] = alice.human();
110 jvn[jss::TransactionType] = jss::AccountSet;
112 jvn[jss::Sequence] = env.
seq(alice);
113 jvn[jss::LastLedgerSequence] = env.
current()->header().seq + 2;
118 env.
rpc(
"submit",
strHex(s.
slice()))[jss::result][jss::engine_result] ==
"telREQUIRES_NETWORK_ID");
123 jv[jss::Account] = alice.human();
124 jv[jss::TransactionType] = jss::AccountSet;
127 jv[jss::NetworkID] = 0;
130 jv[jss::NetworkID] = 1024;
134 jv[jss::NetworkID] = 1025;
140BEAST_DEFINE_TESTSUITE(NetworkID, app,
xrpl);
testcase_t testcase
Memberspace for declaring test cases.
virtual Config & config()=0
Slice slice() const noexcept
std::unique_ptr< Config > makeNetworkConfig(uint32_t networkID)
void run() override
Runs the suite.
Immutable cryptographic account descriptor.
std::string const & human() const
Returns the human readable public key.
A transaction testing environment.
bool close(NetClock::time_point closeTime, std::optional< std::chrono::milliseconds > consensusDelay=std::nullopt)
Close and advance the ledger.
void fund(bool setDefaultRipple, STAmount const &amount, Account const &account)
std::uint32_t seq(Account const &account) const
Returns the next sequence number on account.
Json::Value rpc(unsigned apiVersion, std::unordered_map< std::string, std::string > const &headers, std::string const &cmd, Args &&... args)
Execute an RPC command.
JTx jtnofill(JsonValue &&jv, FN const &... fN)
Create a JTx from parameters.
void memoize(Account const &account)
Associate AccountID with account.
std::shared_ptr< OpenView const > current() const
Returns the current ledger.
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.
XRP_t const XRP
Converts to XRP Issue or STAmount.
std::unique_ptr< Config > envconfig()
creates and initializes a default configuration for jtx::Env
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
@ telNETWORK_ID_MAKES_TX_NON_CANONICAL
std::string to_string(base_uint< Bits, Tag > const &a)
std::string strHex(FwdIt begin, FwdIt end)