Skip to content

Commit

Permalink
Merge pull request #134 from aeternity/aex9-ct-fix
Browse files Browse the repository at this point in the history
fixed check if contract implements AEX9 extension
  • Loading branch information
skkw committed Jan 22, 2021
2 parents ff20650 + 671b3e9 commit bc05b84
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/ae_mdw/contract.ex
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,12 @@ defmodule AeMdw.Contract do
}
end

def is_aex9?(pubkey) when is_binary(pubkey),
do: is_aex9?(get_info(pubkey))
def is_aex9?(pubkey) when is_binary(pubkey) do
case get_info(pubkey) do
{:ok, info} -> is_aex9?(info)
{:error, _} -> false
end
end

def is_aex9?({:fcode, functions, _hash_names, _}) do
Enum.all?(
Expand Down

0 comments on commit bc05b84

Please sign in to comment.