Skip to content

Commit ef29f82

Browse files
committed
fix parity_api_test
1 parent 6017463 commit ef29f82

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

silkworm/rpc/commands/parity_api_test.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,23 @@
1414
limitations under the License.
1515
*/
1616

17-
#include "parity_api.hpp"
17+
#include <catch2/catch_test_macros.hpp>
18+
#include <nlohmann/json.hpp>
1819

19-
#include <catch2/catch.hpp>
20-
#include <grpcpp/grpcpp.h>
20+
#include <silkworm/rpc/test_util/api_test_database.hpp>
2121

2222
namespace silkworm::rpc::commands {
2323

2424
#ifndef SILKWORM_SANITIZE
25-
TEST_CASE("ParityRpcApi::ParityRpcApi", "[rpc][erigon_api]") {
26-
boost::asio::io_context ioc;
27-
CHECK_THROWS_AS(ParityRpcApi(ioc), std::logic_error);
25+
TEST_CASE_METHOD(test::RpcApiE2ETest, "parity_getBlockReceipts: misnamed 'params' field", "[rpc][api]") {
26+
const auto request = R"({"jsonrpc":"2.0","id":1,"method":"parity_getBlockReceipts","pirams":["0x0"]})";
27+
std::string reply;
28+
run<&test::RequestHandler_ForTest::handle_request>(request, reply);
29+
CHECK(nlohmann::json::parse(reply) == R"({
30+
"jsonrpc":"2.0",
31+
"id":1,
32+
"error":{"code":-32600,"message":"Invalid field: pirams"}
33+
})"_json);
2834
}
2935
#endif // SILKWORM_SANITIZE
3036

0 commit comments

Comments
 (0)