Skip to content

Commit

Permalink
Merge pull request #16 from objkt-com/fix/preapply
Browse files Browse the repository at this point in the history
fix(rpc): handle nil value in preapply result
  • Loading branch information
Awea authored Oct 21, 2024
2 parents f84e791 + 0648dc3 commit a5ad4e2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/rpc.ex
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ defmodule Tezex.Rpc do

defp do_preapply_operation(%Rpc{} = rpc, payload) do
case post(rpc, "/blocks/head/helpers/preapply/operations", payload) do
{:ok, [%{"contents" => preapplied_operations}]} ->
{:ok, [%{"contents" => preapplied_operations}]} when is_list(preapplied_operations) ->
applied? =
Enum.all?(
preapplied_operations,
Expand Down Expand Up @@ -275,8 +275,8 @@ defmodule Tezex.Rpc do
{:error, errors}
end

{:ok, result} ->
{:error, result}
{:ok, _result} ->
{:error, :preapply_failed}

err ->
err
Expand Down

0 comments on commit a5ad4e2

Please sign in to comment.