mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Env::postconditions function for alternate validation.
This commit is contained in:
@@ -346,6 +346,12 @@ public:
|
||||
void
|
||||
submit (JTx const& jt);
|
||||
|
||||
/** Check expected postconditions
|
||||
of JTx submission.
|
||||
*/
|
||||
void
|
||||
postconditions(JTx const& jt, TER ter, bool didApply);
|
||||
|
||||
/** Apply funclets and submit. */
|
||||
/** @{ */
|
||||
template <class JsonValue, class... FN>
|
||||
|
||||
@@ -290,9 +290,15 @@ Env::submit (JTx const& jt)
|
||||
ter_ = temMALFORMED;
|
||||
didApply = false;
|
||||
}
|
||||
if (jt.ter && ! test.expect(ter_ == *jt.ter,
|
||||
"apply: " + transToken(ter_) +
|
||||
" (" + transHuman(ter_) + ")"))
|
||||
return postconditions(jt, ter_, didApply);
|
||||
}
|
||||
|
||||
void
|
||||
Env::postconditions(JTx const& jt, TER ter, bool didApply)
|
||||
{
|
||||
if (jt.ter && ! test.expect(ter == *jt.ter,
|
||||
"apply: " + transToken(ter) +
|
||||
" (" + transHuman(ter) + ")"))
|
||||
{
|
||||
test.log << pretty(jt.jv);
|
||||
// Don't check postconditions if
|
||||
|
||||
Reference in New Issue
Block a user