mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-02 08:17:13 +00:00
test: Env unit test RPC errors return a unique result: (#4877)
* telENV_RPC_FAILED is a new code, reserved exclusively for unit tests when RPC fails. This will make those types of errors distinct and easier to test for when expected and/or diagnose when not. * Output RPC command result when result is not expected.
This commit is contained in:
@@ -247,7 +247,10 @@ public:
|
||||
|
||||
// Duplicate signers should fail.
|
||||
aliceSeq = env.seq(alice);
|
||||
env(noop(alice), msig(demon, demon), fee(3 * baseFee), ter(temINVALID));
|
||||
env(noop(alice),
|
||||
msig(demon, demon),
|
||||
fee(3 * baseFee),
|
||||
ter(telENV_RPC_FAILED));
|
||||
env.close();
|
||||
BEAST_EXPECT(env.seq(alice) == aliceSeq);
|
||||
|
||||
@@ -358,7 +361,7 @@ public:
|
||||
msig phantoms{bogie, demon};
|
||||
std::reverse(phantoms.signers.begin(), phantoms.signers.end());
|
||||
std::uint32_t const aliceSeq = env.seq(alice);
|
||||
env(noop(alice), phantoms, ter(temINVALID));
|
||||
env(noop(alice), phantoms, ter(telENV_RPC_FAILED));
|
||||
env.close();
|
||||
BEAST_EXPECT(env.seq(alice) == aliceSeq);
|
||||
}
|
||||
@@ -1634,7 +1637,10 @@ public:
|
||||
|
||||
// Duplicate signers should fail.
|
||||
aliceSeq = env.seq(alice);
|
||||
env(noop(alice), msig(demon, demon), fee(3 * baseFee), ter(temINVALID));
|
||||
env(noop(alice),
|
||||
msig(demon, demon),
|
||||
fee(3 * baseFee),
|
||||
ter(telENV_RPC_FAILED));
|
||||
env.close();
|
||||
BEAST_EXPECT(env.seq(alice) == aliceSeq);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user