Make Hakuzaru Great Again #22
+8
-3
@@ -783,9 +783,13 @@ contract_code(ID) ->
|
|||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
||||||
-spec contract_source(ID) -> {ok, Bytecode} | {error, Reason}
|
-spec contract_source(ID) -> Result
|
||||||
when ID :: contract_id(),
|
when ID :: contract_id(),
|
||||||
Bytecode :: contract_byte_array(),
|
Result :: {ok, Source}
|
||||||
|
| {project, Bundle}
|
||||||
|
| {error, Reason},
|
||||||
|
Source :: string(),
|
||||||
|
Bundle :: [{FilePath :: string(), Contents :: binary()}],
|
||||||
Reason :: chain_error() | string().
|
Reason :: chain_error() | string().
|
||||||
%% @doc
|
%% @doc
|
||||||
%% Retrieve the code of a contract as represented on chain.
|
%% Retrieve the code of a contract as represented on chain.
|
||||||
@@ -805,7 +809,8 @@ extract(Blobby) ->
|
|||||||
|
|
||||||
extract2(TarBaby) ->
|
extract2(TarBaby) ->
|
||||||
case erl_tar:extract({binary, TarBaby}, [memory, compressed]) of
|
case erl_tar:extract({binary, TarBaby}, [memory, compressed]) of
|
||||||
{ok, Project} -> {ok, Project};
|
{ok, Bundle} ->
|
||||||
|
{project, Bundle};
|
||||||
Error ->
|
Error ->
|
||||||
io:format("Dis chit happen: ~tp~n", [Error]),
|
io:format("Dis chit happen: ~tp~n", [Error]),
|
||||||
{ok, TarBaby}
|
{ok, TarBaby}
|
||||||
|
|||||||
Reference in New Issue
Block a user