Add 'oracle' to ledger object filter (#1264)

Fix #1265
This commit is contained in:
cyan317
2024-03-14 11:35:01 +00:00
committed by GitHub
parent c17cc37c1c
commit 010538d6fe
2 changed files with 26 additions and 24 deletions

View File

@@ -45,8 +45,8 @@ struct LedgerTypeAttributes {
// Ledger entry type filter list, add new types here to support filtering for ledger_data and
// account_objects
static std::unordered_map<std::string, LedgerTypeAttributes> const LEDGER_TYPES_MAP{
{{JS(account), LedgerTypeAttributes(ripple::ltACCOUNT_ROOT)},
static std::unordered_map<std::string, LedgerTypeAttributes> const LEDGER_TYPES_MAP{{
{JS(account), LedgerTypeAttributes(ripple::ltACCOUNT_ROOT)},
{JS(amendments), LedgerTypeAttributes(ripple::ltAMENDMENTS)},
{JS(check), LedgerTypeAttributes(ripple::ltCHECK, true)},
{JS(deposit_preauth), LedgerTypeAttributes(ripple::ltDEPOSIT_PREAUTH)},
@@ -66,8 +66,9 @@ static std::unordered_map<std::string, LedgerTypeAttributes> const LEDGER_TYPES_
{JS(xchain_owned_claim_id), LedgerTypeAttributes(ripple::ltXCHAIN_OWNED_CLAIM_ID, true)},
{JS(xchain_owned_create_account_claim_id),
LedgerTypeAttributes(ripple::ltXCHAIN_OWNED_CREATE_ACCOUNT_CLAIM_ID, true)},
{JS(did), LedgerTypeAttributes(ripple::ltDID)}}
};
{JS(did), LedgerTypeAttributes(ripple::ltDID)},
{JS(oracle), LedgerTypeAttributes(ripple::ltORACLE)},
}};
} // namespace impl
std::unordered_set<std::string> const&

View File

@@ -50,7 +50,8 @@ TEST(LedgerUtilsTests, LedgerObjectTypeList)
JS(bridge),
JS(xchain_owned_claim_id),
JS(xchain_owned_create_account_claim_id),
JS(did)
JS(did),
JS(oracle)
};
ASSERT_TRUE(std::size(typesList) == types.size());
EXPECT_TRUE(std::all_of(std::cbegin(typesList), std::cend(typesList), [&types](auto const& type) {