From ae0f3dcee7ca37a5c763b1eb2d82ecb17faf401a Mon Sep 17 00:00:00 2001 From: Afri <58883403+q9f@users.noreply.github.com> Date: Thu, 5 Jan 2023 11:30:53 +0100 Subject: [PATCH] eth/client: rewrite send to send_request (#201) --- lib/eth/client.rb | 2 +- lib/eth/client/http.rb | 2 +- lib/eth/client/http_auth.rb | 2 +- lib/eth/client/ipc.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/eth/client.rb b/lib/eth/client.rb index 9dbbb66c..ec1bcca5 100644 --- a/lib/eth/client.rb +++ b/lib/eth/client.rb @@ -541,7 +541,7 @@ def send_command(command, args) params: marshal(args), id: next_id, } - output = JSON.parse(send(payload.to_json)) + output = JSON.parse(send_request(payload.to_json)) raise IOError, output["error"]["message"] unless output["error"].nil? return output end diff --git a/lib/eth/client/http.rb b/lib/eth/client/http.rb index 872475fa..fd5774c2 100644 --- a/lib/eth/client/http.rb +++ b/lib/eth/client/http.rb @@ -50,7 +50,7 @@ def initialize(host) # # @param payload [Hash] the RPC request parameters. # @return [String] a JSON-encoded response. - def send(payload) + def send_request(payload) http = Net::HTTP.new(@host, @port) http.use_ssl = @ssl header = { "Content-Type" => "application/json" } diff --git a/lib/eth/client/http_auth.rb b/lib/eth/client/http_auth.rb index 93c6510e..67ba6ce7 100644 --- a/lib/eth/client/http_auth.rb +++ b/lib/eth/client/http_auth.rb @@ -55,7 +55,7 @@ def initialize(host) # # @param payload [Hash] the RPC request parameters. # @return [String] a JSON-encoded response. - def send(payload) + def send_request(payload) http = Net::HTTP.new(@host, @port) http.use_ssl = @ssl header = { "Content-Type" => "application/json" } diff --git a/lib/eth/client/ipc.rb b/lib/eth/client/ipc.rb index af5d929f..f5273133 100644 --- a/lib/eth/client/ipc.rb +++ b/lib/eth/client/ipc.rb @@ -36,7 +36,7 @@ def initialize(path) # # @param payload [Hash] the RPC request parameters. # @return [String] a JSON-encoded response. - def send(payload) + def send_request(payload) socket = UNIXSocket.new(@path) socket.puts(payload) read = socket.recvmsg(nil)[0]