mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-21 12:15:54 +00:00
@@ -491,43 +491,3 @@ TEST_F(RPCBaseTest, SubscribeAccountsValidator)
|
||||
err = spec.validate(failingInput);
|
||||
ASSERT_FALSE(err);
|
||||
}
|
||||
|
||||
TEST_F(RPCBaseTest, SubscribeBooksValidator)
|
||||
{
|
||||
auto const spec = RpcSpec{{"books", SubscribeBooksValidator}};
|
||||
auto passingInput = json::parse(
|
||||
R"({
|
||||
"books": [{
|
||||
"taker_pays":
|
||||
{
|
||||
"currency": "XRP"
|
||||
},
|
||||
"taker_gets":
|
||||
{
|
||||
"currency": "USD",
|
||||
"issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq"
|
||||
}
|
||||
}]
|
||||
})");
|
||||
ASSERT_TRUE(spec.validate(passingInput));
|
||||
|
||||
auto failingInput = json::parse(R"({ "books": 256})");
|
||||
auto err = spec.validate(failingInput);
|
||||
ASSERT_FALSE(err);
|
||||
|
||||
failingInput = json::parse(R"({ "books": ["test"]})");
|
||||
err = spec.validate(failingInput);
|
||||
ASSERT_FALSE(err);
|
||||
|
||||
failingInput = json::parse(
|
||||
R"({
|
||||
"books": [{
|
||||
"taker_pays":
|
||||
{
|
||||
"currency": "XRP"
|
||||
}
|
||||
}]
|
||||
})");
|
||||
err = spec.validate(failingInput);
|
||||
ASSERT_FALSE(err);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user