test(entropy): harden API scenario and formatting

This commit is contained in:
Nicholas Dudfield
2026-07-27 11:49:49 +07:00
parent d5a3b466d4
commit 2badcb15da
3 changed files with 8 additions and 5 deletions

View File

@@ -112,8 +112,11 @@ async def scenario(ctx, log):
if execution.get("HookResult") != 3:
raise AssertionError(f"Hook did not ACCEPT: {execution}")
return_code = execution.get("HookReturnCode", "")
if return_code and str(return_code) != "0":
if "HookReturnCode" not in execution:
raise AssertionError(f"HookReturnCode missing from execution: {execution}")
return_code = execution["HookReturnCode"]
if str(return_code) != "0":
raise AssertionError(f"entropy_cr_* Hook check failed: {execution}")
log("entropy_cr_status, entropy_cr_dice, and entropy_cr_random passed")

View File

@@ -978,8 +978,7 @@ class ConsensusEntropy_test : public beast::unit_test::suite
}
)[test.hook]"];
env(ripple::test::jtx::hook(
alice, {{hso(diceHook, overrideFlag)}}, 0),
env(ripple::test::jtx::hook(alice, {{hso(diceHook, overrideFlag)}}, 0),
M("reject retired dice import"),
HSFEE,
ter(temMALFORMED));

View File

@@ -1481,7 +1481,8 @@ ConsensusExtensions::selectEntropy(
};
//@@end entropy-selector-fallback
// Standalone: synthetic deterministic entropy so the entropy_cr_* draws work.
// Standalone: synthetic deterministic entropy so the entropy_cr_* draws
// work.
//@@start entropy-selector-standalone
if (app_.config().standalone())
{