mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-21 20:25:52 +00:00
@@ -45,7 +45,8 @@ TEST_F(RPCTransactionEntryHandlerTest, TxHashNotProvide)
|
||||
runSpawn([this](auto& yield) {
|
||||
auto const handler =
|
||||
AnyHandler{TransactionEntryHandler{mockBackendPtr}};
|
||||
auto const output = handler.process(json::parse("{}"), yield);
|
||||
auto const output =
|
||||
handler.process(json::parse("{}"), Context{std::ref(yield)});
|
||||
ASSERT_FALSE(output);
|
||||
auto const err = RPC::makeError(output.error());
|
||||
EXPECT_EQ(err.at("error").as_string(), "invalidParams");
|
||||
@@ -60,8 +61,8 @@ TEST_F(RPCTransactionEntryHandlerTest, TxHashWrongFormat)
|
||||
runSpawn([this](auto& yield) {
|
||||
auto const handler =
|
||||
AnyHandler{TransactionEntryHandler{mockBackendPtr}};
|
||||
auto const output =
|
||||
handler.process(json::parse(R"({"tx_hash":"123"})"), yield);
|
||||
auto const output = handler.process(
|
||||
json::parse(R"({"tx_hash":"123"})"), Context{std::ref(yield)});
|
||||
ASSERT_FALSE(output);
|
||||
auto const err = RPC::makeError(output.error());
|
||||
EXPECT_EQ(err.at("error").as_string(), "invalidParams");
|
||||
@@ -88,7 +89,7 @@ TEST_F(RPCTransactionEntryHandlerTest, NonExistLedgerViaLedgerHash)
|
||||
runSpawn([&, this](auto& yield) {
|
||||
auto const handler =
|
||||
AnyHandler{TransactionEntryHandler{mockBackendPtr}};
|
||||
auto const output = handler.process(input, 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(), "lgrNotFound");
|
||||
@@ -116,7 +117,7 @@ TEST_F(RPCTransactionEntryHandlerTest, NonExistLedgerViaLedgerIndex)
|
||||
runSpawn([&, this](auto& yield) {
|
||||
auto const handler =
|
||||
AnyHandler{TransactionEntryHandler{mockBackendPtr}};
|
||||
auto const output = handler.process(input, 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(), "lgrNotFound");
|
||||
@@ -143,7 +144,7 @@ TEST_F(RPCTransactionEntryHandlerTest, TXNotFound)
|
||||
"tx_hash": "{}"
|
||||
}})",
|
||||
TXNID));
|
||||
auto const output = handler.process(req, yield);
|
||||
auto const output = handler.process(req, Context{std::ref(yield)});
|
||||
ASSERT_FALSE(output);
|
||||
auto const err = RPC::makeError(output.error());
|
||||
EXPECT_EQ(err.at("error").as_string(), "transactionNotFound");
|
||||
@@ -184,7 +185,7 @@ TEST_F(RPCTransactionEntryHandlerTest, LedgerSeqNotMatch)
|
||||
"ledger_index": "30"
|
||||
}})",
|
||||
TXNID));
|
||||
auto const output = handler.process(req, yield);
|
||||
auto const output = handler.process(req, Context{std::ref(yield)});
|
||||
ASSERT_FALSE(output);
|
||||
auto const err = RPC::makeError(output.error());
|
||||
EXPECT_EQ(err.at("error").as_string(), "transactionNotFound");
|
||||
@@ -269,7 +270,7 @@ TEST_F(RPCTransactionEntryHandlerTest, NormalPath)
|
||||
}})",
|
||||
TXNID,
|
||||
tx.ledgerSequence));
|
||||
auto const output = handler.process(req, yield);
|
||||
auto const output = handler.process(req, Context{std::ref(yield)});
|
||||
ASSERT_TRUE(output);
|
||||
EXPECT_EQ(json::parse(OUTPUT), *output);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user