diff --git a/src/test/app/PermissionedDEX_test.cpp b/src/test/app/PermissionedDEX_test.cpp index c6e94d7994..8904ef0b12 100644 --- a/src/test/app/PermissionedDEX_test.cpp +++ b/src/test/app/PermissionedDEX_test.cpp @@ -278,6 +278,17 @@ class PermissionedDEX_test : public beast::unit_test::Suite env.close(); } + // preflight - a present but zero DomainID is malformed. + // Regression test for "Ledger::read : zero key" assertion. + { + Env env(*this, features); + auto const& [gw_, domainOwner, alice_, bob_, carol_, USD, domainID, credType] = + PermissionedDEX(env); + + env(offer(bob_, XRP(10), USD(10)), Domain(uint256{}), Ter(temMALFORMED)); + env.close(); + } + // apply - offer can be created even if takergets issuer is not in // domain { @@ -413,6 +424,21 @@ class PermissionedDEX_test : public beast::unit_test::Suite env.close(); } + // preflight - a present but zero DomainID is malformed. + // Regression test for "Ledger::read : zero key" assertion. + { + Env env(*this, features); + auto const& [gw_, domainOwner, alice_, bob_, carol_, USD, domainID, credType] = + PermissionedDEX(env); + + env(pay(bob_, alice_, USD(10)), + Path(~USD), + Sendmax(XRP(10)), + Domain(uint256{}), + Ter(temMALFORMED)); + env.close(); + } + // preclaim - payment with non-domain destination fails { Env env(*this, features);