diff --git a/include/xrpl/protocol/detail/features.macro b/include/xrpl/protocol/detail/features.macro index e2d1fb4ed68..292cb1dc1c6 100644 --- a/include/xrpl/protocol/detail/features.macro +++ b/include/xrpl/protocol/detail/features.macro @@ -29,6 +29,7 @@ // If you add an amendment here, then do not forget to increment `numFeatures` // in include/xrpl/protocol/Feature.h. +XRPL_FEATURE(PermissionedDomains, Supported::no, VoteBehavior::DefaultNo) XRPL_FEATURE(Credentials, Supported::yes, VoteBehavior::DefaultNo) XRPL_FEATURE(AMMClawback, Supported::yes, VoteBehavior::DefaultNo) XRPL_FIX (AMMv1_2, Supported::yes, VoteBehavior::DefaultNo) @@ -98,8 +99,6 @@ XRPL_FIX (1513, Supported::yes, VoteBehavior::DefaultYe XRPL_FEATURE(FlowCross, Supported::yes, VoteBehavior::DefaultYes) XRPL_FEATURE(Flow, Supported::yes, VoteBehavior::DefaultYes) XRPL_FEATURE(OwnerPaysFee, Supported::no, VoteBehavior::DefaultNo) -XRPL_FEATURE(PermissionedDomains, Supported::no, VoteBehavior::DefaultNo) - // The following amendments are obsolete, but must remain supported // because they could potentially get enabled. diff --git a/src/test/rpc/LedgerRPC_test.cpp b/src/test/rpc/LedgerRPC_test.cpp index 99b0f0a23fc..0dd7436d502 100644 --- a/src/test/rpc/LedgerRPC_test.cpp +++ b/src/test/rpc/LedgerRPC_test.cpp @@ -494,6 +494,18 @@ class LedgerRPC_test : public beast::unit_test::suite "json", "ledger", "{ \"ledger_index\" : 1000000000000000 }"); checkErrorValue(ret, "invalidParams", "Invalid parameters."); } + + { + // ask for an zero index + Json::Value jvParams; + jvParams[jss::ledger_index] = "validated"; + jvParams[jss::index] = + "00000000000000000000000000000000000000000000000000000000000000" + "0000"; + auto const jrr = env.rpc( + "json", "ledger_entry", to_string(jvParams))[jss::result]; + checkErrorValue(jrr, "malformedRequest", ""); + } } void @@ -3074,10 +3086,8 @@ class LedgerRPC_test : public beast::unit_test::suite env(pd::setTx(alice, {{alice, "first credential"}})); env.close(); auto const objects = pd::getObjects(alice, env); - BEAST_EXPECT(objects.size() == 1); - if (objects.empty()) + if (!BEAST_EXPECT(objects.size() == 1)) return; - // env(pd::deleteTx(alice, domain)); { // Succeed diff --git a/src/xrpld/rpc/handlers/LedgerEntry.cpp b/src/xrpld/rpc/handlers/LedgerEntry.cpp index 8cb99acb231..6f12d5079b6 100644 --- a/src/xrpld/rpc/handlers/LedgerEntry.cpp +++ b/src/xrpld/rpc/handlers/LedgerEntry.cpp @@ -809,6 +809,7 @@ doLedgerEntry(RPC::JsonContext& context) } else if (context.params.isMember(jss::permissioned_domain)) { + expectedType = ltPERMISSIONED_DOMAIN; uNodeIndex = beast::zero; auto const& pd = context.params[jss::permissioned_domain]; if (pd.isString()) @@ -822,6 +823,7 @@ doLedgerEntry(RPC::JsonContext& context) else if ( !pd.isObject() || !pd.isMember(jss::account) || !pd[jss::account].isString() || !pd.isMember(jss::seq) || + (pd[jss::seq].isInt() && pd[jss::seq].asInt() < 0) || (!pd[jss::seq].isInt() && !pd[jss::seq].isUInt())) { jvResult[jss::error] = "malformedRequest"; @@ -905,6 +907,10 @@ doLedgerEntry(RPC::JsonContext& context) jvResult[jss::index] = to_string(uNodeIndex); } } + else if (!jvResult.isMember(jss::error)) + { + jvResult[jss::error] = "malformedRequest"; + } return jvResult; }