fix: Wire format regression in rpc-spec (#3242)

This commit is contained in:
Alex Kremer
2026-10-05 16:04:36 +01:00
committed by GitHub
parent 5e5fd06ade
commit 04d5f79c72
5 changed files with 94 additions and 4 deletions

View File

@@ -3,7 +3,7 @@
"requires": [
"zlib/1.3.2#1cb806da49011867778ffb6ac7190fcb%1782392402.122708",
"xxhash/0.8.3#681d36a0a6111fc56e5e45ea182c19cc%1782392402.420688",
"xrpl-rpc-spec/0.1.21#d536f87a2ae7d313452746cfa3ac4404%1790869005.122975",
"xrpl-rpc-spec/0.1.23#56e8946f5b3fb949a3732e1a51135ca2%1790977482.197086",
"xrpl/3.4.0#e06b127b3ba92806a43fc7a53fc05fd3%1789577552.219154",
"sqlite3/3.53.0#324ada52333108388a9a6108bfa96734%1782392403.185447",
"spdlog/1.17.0#bcbaaf7147bda6ad24ffbd1ac3d7142c%1782736610.443882",

View File

@@ -17,7 +17,7 @@ class ClioConan(ConanFile):
"fmt/12.1.0",
"libbacktrace/cci.20210118",
"spdlog/1.17.0",
"xrpl-rpc-spec/0.1.21",
"xrpl-rpc-spec/0.1.23",
"xrpl/3.4.0",
]

View File

@@ -42,7 +42,7 @@ AccountCurrenciesHandler::process(
return Error{expectedLgrInfo.error()};
auto const& lgrInfo = *expectedLgrInfo;
auto const& accountID = input.account;
auto const& accountID = *input.account;
auto const accountLedgerObject = sharedPtrBackend_->fetchLedgerObject(
xrpl::keylet::account(accountID).key, lgrInfo.seq, ctx.yield

View File

@@ -60,7 +60,7 @@ AccountOffersHandler::process(AccountOffersHandler::Input const& input, Context
return Error{expectedLgrInfo.error()};
auto const& lgrInfo = *expectedLgrInfo;
auto const& accountID = input.account;
auto const& accountID = *input.account;
auto const accountLedgerObject = sharedPtrBackend_->fetchLedgerObject(
xrpl::keylet::account(accountID).key, lgrInfo.seq, ctx.yield
);

View File

@@ -350,6 +350,96 @@ generateTestValuesForParametersTest()
.expectedError = "invalidParams",
.expectedErrorMessage = "Invalid parameters."
},
GetAggregatePriceParamTestCaseBundle{
.testName = "oracleDocumentIdNegative",
.testJson = R"JSON({
"base_asset": "USD",
"quote_asset": "XRP",
"oracles": [
{
"account": "rGh1VZCRBJY6rJiaFpD4LZtyHiuCkC8aeD",
"oracle_document_id": -1
}
]
})JSON",
.expectedError = "invalidParams",
.expectedErrorMessage = "Invalid parameters."
},
GetAggregatePriceParamTestCaseBundle{
.testName = "oracleDocumentIdNull",
.testJson = R"JSON({
"base_asset": "USD",
"quote_asset": "XRP",
"oracles": [
{
"account": "rGh1VZCRBJY6rJiaFpD4LZtyHiuCkC8aeD",
"oracle_document_id": null
}
]
})JSON",
.expectedError = "invalidParams",
.expectedErrorMessage = "Invalid parameters."
},
GetAggregatePriceParamTestCaseBundle{
.testName = "oracleDocumentIdFloat",
.testJson = R"JSON({
"base_asset": "USD",
"quote_asset": "XRP",
"oracles": [
{
"account": "rGh1VZCRBJY6rJiaFpD4LZtyHiuCkC8aeD",
"oracle_document_id": 2.3
}
]
})JSON",
.expectedError = "invalidParams",
.expectedErrorMessage = "Invalid parameters."
},
GetAggregatePriceParamTestCaseBundle{
.testName = "oracleDocumentIdBool",
.testJson = R"JSON({
"base_asset": "USD",
"quote_asset": "XRP",
"oracles": [
{
"account": "rGh1VZCRBJY6rJiaFpD4LZtyHiuCkC8aeD",
"oracle_document_id": true
}
]
})JSON",
.expectedError = "invalidParams",
.expectedErrorMessage = "Invalid parameters."
},
GetAggregatePriceParamTestCaseBundle{
.testName = "oracleDocumentIdObject",
.testJson = R"JSON({
"base_asset": "USD",
"quote_asset": "XRP",
"oracles": [
{
"account": "rGh1VZCRBJY6rJiaFpD4LZtyHiuCkC8aeD",
"oracle_document_id": {}
}
]
})JSON",
.expectedError = "invalidParams",
.expectedErrorMessage = "Invalid parameters."
},
GetAggregatePriceParamTestCaseBundle{
.testName = "oracleDocumentIdTooLarge",
.testJson = R"JSON({
"base_asset": "USD",
"quote_asset": "XRP",
"oracles": [
{
"account": "rGh1VZCRBJY6rJiaFpD4LZtyHiuCkC8aeD",
"oracle_document_id": 4294967296
}
]
})JSON",
.expectedError = "invalidParams",
.expectedErrorMessage = "Invalid parameters."
},
GetAggregatePriceParamTestCaseBundle{
.testName = "oracleMissingAccount",
.testJson = R"JSON({