mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-03 08:46:46 +00:00
Fix LoanBrokerDelete with empty or zero broker ID (RIPD-3858) (#5967)
This commit is contained in:
committed by
GitHub
parent
7a758a42f9
commit
e8dddcbb7f
@@ -1015,6 +1015,24 @@ class LoanBroker_test : public beast::unit_test::suite
|
||||
sig(sfCounterpartySignature, alice),
|
||||
fee(env.current()->fees().base * 2));
|
||||
|
||||
// preflight: temINVALID (empty broker id)
|
||||
{
|
||||
auto jv = del(alice, brokerKeylet.key);
|
||||
jv[sfLoanBrokerID] = "";
|
||||
env(jv, ter(temINVALID));
|
||||
}
|
||||
// preflight: temINVALID (zero broker id)
|
||||
{
|
||||
// needs a flag to distinguish the parsed STTx from the prior
|
||||
// test
|
||||
auto jv = del(alice, uint256{}, tfFullyCanonicalSig);
|
||||
BEAST_EXPECT(
|
||||
jv[sfLoanBrokerID] ==
|
||||
"0000000000000000000000000000000000000000000000000000000000"
|
||||
"000000");
|
||||
env(jv, ter(temINVALID));
|
||||
}
|
||||
|
||||
// preclaim: tecHAS_OBLIGATIONS
|
||||
env(del(alice, brokerKeylet.key), ter(tecHAS_OBLIGATIONS));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user