General polish (#28)

Co-authored-by: Craig Everett <zxq9@zxq9.com>
Co-authored-by: Dimitar Ivanov <dimitar.p.ivanov@gmail.com>
Reviewed-on: #28
This commit was merged in pull request #28.
This commit is contained in:
2026-05-22 16:54:16 +09:00
parent ed252b4c06
commit 9a7a2a98c4
+10 -3
View File
@@ -788,9 +788,9 @@ contract_code(ID) ->
Result :: {ok, Source}
| {project, Bundle}
| {error, Reason},
Source :: string(),
Source :: binary(),
Bundle :: [{FilePath :: string(), Contents :: binary()}],
Reason :: chain_error() | string().
Reason :: chain_error() | string().
%% @doc
%% Retrieve the code of a contract as represented on chain.
@@ -809,6 +809,8 @@ extract(Blobby) ->
extract2(TarBaby) ->
case erl_tar:extract({binary, TarBaby}, [memory, compressed]) of
{ok, [{_File, Source}]} ->
{ok, Source};
{ok, Bundle} ->
{project, Bundle};
Error ->
@@ -895,6 +897,11 @@ request(Path) ->
hz_man:request(unicode:characters_to_list(Path)).
-spec request(Path, Payload) -> {ok, Value} | {error, Reason}
when Path :: unicode:charlist(),
Payload :: unicode:charlist(),
Value :: map(),
Reason :: hz:chain_error().
request(Path, Payload) ->
hz_man:request(unicode:characters_to_list(Path), Payload).
@@ -930,7 +937,7 @@ contract_create(CreatorID, Path, InitArgs) ->
Gas = 500000,
GasPrice = min_gas_price(),
contract_create(CreatorID, Nonce,
Amount, TTL, Gas, GasPrice,
Gas, GasPrice, Amount, TTL,
Path, InitArgs);
Error ->
Error