Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add special case for empty response #59

Merged
merged 3 commits into from
Feb 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 0.5.3
* Add special case for empty response (https://github.com/mana-ethereum/ethereumex/pull/59)

# 0.5.2
* Fix `eth_estimateGas` (https://github.com/mana-ethereum/ethereumex/pull/55)
* Add `eth_getProof` (https://github.com/mana-ethereum/ethereumex/pull/57)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Add Ethereumex to your `mix.exs` dependencies:
1. Add `ethereumex` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[{:ethereumex, "~> 0.5.2"}]
[{:ethereumex, "~> 0.5.3"}]
end
```

Expand Down
1 change: 1 addition & 0 deletions lib/ethereumex/http_client.ex
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ defmodule Ethereumex.HttpClient do
_ -> {:error, decoded_body}
end
else
{:error, %Jason.DecodeError{data: ""}} -> {:error, :empty_response}
{:error, error} -> {:error, {:invalid_json, error}}
end
end
Expand Down
1 change: 1 addition & 0 deletions lib/ethereumex/ipc_client.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ defmodule Ethereumex.IpcClient do
result -> {:ok, Map.get(result, "result")}
end
else
{:error, %Jason.DecodeError{data: ""}} -> {:error, :empty_response}
{:error, error} -> {:error, {:invalid_json, error}}
end
else
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Ethereumex.Mixfile do
def project do
[
app: :ethereumex,
version: "0.5.2",
version: "0.5.3",
elixir: "~> 1.7",
description: "Elixir JSON-RPC client for the Ethereum blockchain",
package: [
Expand Down