@@ -2922,11 +2922,30 @@ generateTestValuesForNormalPathTest()
29222922 .testName = " PermissionedDomainViaString" ,
29232923 .testJson = fmt::format (
29242924 R"json( {{
2925- "permissioned_domain": "{}"
2926- }})json" ,
2925+ "binary": true,
2926+ "permissioned_domain": "{}"
2927+ }})json" ,
29272928 kINDEX1
29282929 ),
29292930 .expectedIndex = ripple::uint256 (kINDEX1 ),
2931+ .mockedEntity = createPermissionedDomainObject (kACCOUNT , kRANGE_MAX , 0 , 0 , ripple::uint256{0 }, 0 )
2932+ },
2933+ NormalPathTestBundle{
2934+ .testName = " PermissionedDomainViaObject" ,
2935+ .testJson = fmt::format (
2936+ R"json( {{
2937+ "binary": true,
2938+ "permissioned_domain": {{
2939+ "account": "{}",
2940+ "seq": {}
2941+ }}
2942+ }})json" ,
2943+ kACCOUNT ,
2944+ kRANGE_MAX
2945+ ),
2946+ .expectedIndex =
2947+ ripple::keylet::permissionedDomain (ripple::parseBase58<ripple::AccountID>(kACCOUNT ).value (), kRANGE_MAX )
2948+ .key ,
29302949 .mockedEntity = createPermissionedDomainObject (kACCOUNT , kRANGE_MAX , kRANGE_MAX , 0 , ripple::uint256{0 }, 0 )
29312950 }
29322951 };
@@ -2957,15 +2976,14 @@ TEST_P(RPCLedgerEntryNormalPathTest, NormalPath)
29572976 auto const req = json::parse (testBundle.testJson );
29582977 auto const output = handler.process (req, Context{yield});
29592978 ASSERT_TRUE (output);
2960- EXPECT_EQ (output.result .value ().at (" ledger_hash" ).as_string (), kLEDGER_HASH );
2961- EXPECT_EQ (output.result .value ().at (" ledger_index" ).as_uint64 (), kRANGE_MAX );
2979+ auto const & outputJson = output.result .value ();
2980+ EXPECT_EQ (outputJson.at (" ledger_hash" ).as_string (), kLEDGER_HASH );
2981+ EXPECT_EQ (outputJson.at (" ledger_index" ).as_uint64 (), kRANGE_MAX );
29622982 EXPECT_EQ (
2963- output.result .value ().at (" node_binary" ).as_string (),
2964- ripple::strHex (testBundle.mockedEntity .getSerializer ().peekData ())
2983+ outputJson.at (" node_binary" ).as_string (), ripple::strHex (testBundle.mockedEntity .getSerializer ().peekData ())
29652984 );
29662985 EXPECT_EQ (
2967- ripple::uint256 (boost::json::value_to<std::string>(output.result .value ().at (" index" )).data ()),
2968- testBundle.expectedIndex
2986+ ripple::uint256 (boost::json::value_to<std::string>(outputJson.at (" index" )).data ()), testBundle.expectedIndex
29692987 );
29702988 });
29712989}
0 commit comments