mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-21 04:05:51 +00:00
@@ -72,9 +72,7 @@ public:
|
|||||||
static auto const rpcSpec = RpcSpec{
|
static auto const rpcSpec = RpcSpec{
|
||||||
{JS(account), validation::Required{}, validation::AccountValidator},
|
{JS(account), validation::Required{}, validation::AccountValidator},
|
||||||
{JS(ledger_hash), validation::Uint256HexStringValidator},
|
{JS(ledger_hash), validation::Uint256HexStringValidator},
|
||||||
{JS(ledger_index), validation::LedgerIndexValidator},
|
{JS(ledger_index), validation::LedgerIndexValidator}};
|
||||||
{JS(strict), meta::IfType<bool>{validation::NotSupported{false}}},
|
|
||||||
};
|
|
||||||
|
|
||||||
return rpcSpec;
|
return rpcSpec;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,9 +90,7 @@ public:
|
|||||||
{JS(ident), validation::AccountValidator},
|
{JS(ident), validation::AccountValidator},
|
||||||
{JS(ledger_hash), validation::Uint256HexStringValidator},
|
{JS(ledger_hash), validation::Uint256HexStringValidator},
|
||||||
{JS(ledger_index), validation::LedgerIndexValidator},
|
{JS(ledger_index), validation::LedgerIndexValidator},
|
||||||
{JS(signer_lists), validation::Type<bool>{}},
|
{JS(signer_lists), validation::Type<bool>{}}};
|
||||||
{JS(strict), meta::IfType<bool>{validation::NotSupported{false}}},
|
|
||||||
};
|
|
||||||
|
|
||||||
return rpcSpec;
|
return rpcSpec;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,9 +84,7 @@ public:
|
|||||||
{JS(ledger_hash), validation::Uint256HexStringValidator},
|
{JS(ledger_hash), validation::Uint256HexStringValidator},
|
||||||
{JS(ledger_index), validation::LedgerIndexValidator},
|
{JS(ledger_index), validation::LedgerIndexValidator},
|
||||||
{JS(marker), validation::AccountMarkerValidator},
|
{JS(marker), validation::AccountMarkerValidator},
|
||||||
{JS(limit), validation::Type<uint32_t>{}, modifiers::Clamp<int32_t>{10, 400}},
|
{JS(limit), validation::Type<uint32_t>{}, modifiers::Clamp<int32_t>{10, 400}}};
|
||||||
{JS(strict), meta::IfType<bool>{validation::NotSupported{false}}},
|
|
||||||
};
|
|
||||||
|
|
||||||
return rpcSpec;
|
return rpcSpec;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,9 +106,7 @@ public:
|
|||||||
{JS(account), validation::Required{}, validation::AccountValidator},
|
{JS(account), validation::Required{}, validation::AccountValidator},
|
||||||
{JS(ledger_hash), validation::Uint256HexStringValidator},
|
{JS(ledger_hash), validation::Uint256HexStringValidator},
|
||||||
{JS(ledger_index), validation::LedgerIndexValidator},
|
{JS(ledger_index), validation::LedgerIndexValidator},
|
||||||
{JS(hotwallet), hotWalletValidator},
|
{JS(hotwallet), hotWalletValidator}};
|
||||||
{JS(strict), meta::IfType<bool>{validation::NotSupported{false}}},
|
|
||||||
};
|
|
||||||
|
|
||||||
return rpcSpec;
|
return rpcSpec;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,30 +40,6 @@ class RPCAccountCurrenciesHandlerTest : public HandlerBaseTest
|
|||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST_F(RPCAccountCurrenciesHandlerTest, StrictSetToFalseUnsupported)
|
|
||||||
{
|
|
||||||
mockBackendPtr->updateRange(10); // min
|
|
||||||
mockBackendPtr->updateRange(30); // max
|
|
||||||
|
|
||||||
auto const static input = boost::json::parse(fmt::format(
|
|
||||||
R"({{
|
|
||||||
"account": "{}",
|
|
||||||
"strict": false
|
|
||||||
}})",
|
|
||||||
ACCOUNT));
|
|
||||||
|
|
||||||
auto const handler = AnyHandler{AccountCurrenciesHandler{mockBackendPtr}};
|
|
||||||
|
|
||||||
runSpawn([&](auto& yield) {
|
|
||||||
auto const output = handler.process(input, Context{std::ref(yield)});
|
|
||||||
ASSERT_FALSE(output);
|
|
||||||
|
|
||||||
auto const err = RPC::makeError(output.error());
|
|
||||||
EXPECT_EQ(err.at("error").as_string(), "notSupported");
|
|
||||||
EXPECT_EQ(err.at("error_message").as_string(), "Not supported field 'strict's value 'false'");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_F(RPCAccountCurrenciesHandlerTest, AccountNotExist)
|
TEST_F(RPCAccountCurrenciesHandlerTest, AccountNotExist)
|
||||||
{
|
{
|
||||||
auto const rawBackendPtr = static_cast<MockBackend*>(mockBackendPtr.get());
|
auto const rawBackendPtr = static_cast<MockBackend*>(mockBackendPtr.get());
|
||||||
|
|||||||
@@ -91,11 +91,6 @@ generateTestValuesForParametersTest()
|
|||||||
R"({"ident":"rLEsXccBGNR3UPuPu2hUXPjziKC3qKSBun", "ledger_index":"a"})",
|
R"({"ident":"rLEsXccBGNR3UPuPu2hUXPjziKC3qKSBun", "ledger_index":"a"})",
|
||||||
"invalidParams",
|
"invalidParams",
|
||||||
"ledgerIndexMalformed"},
|
"ledgerIndexMalformed"},
|
||||||
AccountInfoParamTestCaseBundle{
|
|
||||||
"StrictFieldUnsupportedValue",
|
|
||||||
R"({"ident": "rLEsXccBGNR3UPuPu2hUXPjziKC3qKSBun", "strict": false})",
|
|
||||||
"notSupported",
|
|
||||||
"Not supported field 'strict's value 'false'"},
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -119,12 +119,6 @@ generateTestValuesForParametersTest()
|
|||||||
"invalidParams",
|
"invalidParams",
|
||||||
"Malformed cursor.",
|
"Malformed cursor.",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"StrictFieldUnsupportedValue",
|
|
||||||
R"({"account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", "strict": false})",
|
|
||||||
"notSupported",
|
|
||||||
"Not supported field 'strict's value 'false'",
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -170,18 +170,6 @@ generateParameterTestBundles()
|
|||||||
ACCOUNT),
|
ACCOUNT),
|
||||||
"invalidParams",
|
"invalidParams",
|
||||||
"hotwalletMalformed"},
|
"hotwalletMalformed"},
|
||||||
ParameterTestBundle{
|
|
||||||
"StrictFieldUnsupportedValue",
|
|
||||||
fmt::format(
|
|
||||||
R"({{
|
|
||||||
"account": "{}",
|
|
||||||
"hotwallet": "{}",
|
|
||||||
"strict": false
|
|
||||||
}})",
|
|
||||||
ACCOUNT,
|
|
||||||
ACCOUNT2),
|
|
||||||
"notSupported",
|
|
||||||
"Not supported field 'strict's value 'false'"},
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user