diff --git a/lib/rpc.ex b/lib/rpc.ex index 62c7145..4d819f9 100644 --- a/lib/rpc.ex +++ b/lib/rpc.ex @@ -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, @@ -275,6 +275,9 @@ defmodule Tezex.Rpc do {:error, errors} end + {:ok, [%{"contents" => nil}]} -> + {:error, :nil_preapply} + {:ok, result} -> {:error, result}