Skip to content

Commit

Permalink
Fix CI errors caused by cancun EVM (#103)
Browse files Browse the repository at this point in the history
* Handle execution errors with empty data

* Switch tests to use shanghai as a temporary fix

Since ganache-cli is deprecated and will not support newer evm versions,
as a temporary fix we can switch back to shanghai.

This won't affect any runtime features.
  • Loading branch information
alisinabh authored Apr 1, 2024
1 parent e5aa4b0 commit c23200a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/ethers.ex
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,9 @@ defmodule Ethers do
defp post_process({:ok, result}, _tx_data, _action),
do: {:ok, result}

defp post_process({:error, %{"data" => "0x"} = full_error}, _tx_data, _action),
do: {:error, full_error}

defp post_process(
{:error, %{"data" => "0x" <> error_data} = full_error},
%{base_module: module},
Expand Down
2 changes: 1 addition & 1 deletion test/test_prepare.exs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ for file <- File.ls!(test_contracts_path) do
"/bin/bash",
[
"-c",
"solc #{Path.join(test_contracts_path, name)}.sol --combined-json abi,bin | jq \".contracts | to_entries | .[0].value\" > tmp/#{name}_abi.json"
"solc #{Path.join(test_contracts_path, name)}.sol --evm-version=shanghai --combined-json abi,bin | jq \".contracts | to_entries | .[0].value\" > tmp/#{name}_abi.json"
]
)
end

0 comments on commit c23200a

Please sign in to comment.