diff --git a/src/hz.erl b/src/hz.erl index 2827f79..88893c6 100644 --- a/src/hz.erl +++ b/src/hz.erl @@ -783,9 +783,13 @@ contract_code(ID) -> end. --spec contract_source(ID) -> {ok, Bytecode} | {error, Reason} - when ID :: contract_id(), - Bytecode :: contract_byte_array(), +-spec contract_source(ID) -> Result + when ID :: contract_id(), + Result :: {ok, Source} + | {project, Bundle} + | {error, Reason}, + Source :: string(), + Bundle :: [{FilePath :: string(), Contents :: binary()}], Reason :: chain_error() | string(). %% @doc %% Retrieve the code of a contract as represented on chain. @@ -805,8 +809,9 @@ extract(Blobby) -> extract2(TarBaby) -> case erl_tar:extract({binary, TarBaby}, [memory, compressed]) of - {ok, Project} -> {ok, Project}; - Error -> + {ok, Bundle} -> + {project, Bundle}; + Error -> io:format("Dis chit happen: ~tp~n", [Error]), {ok, TarBaby} end.