General polish #28

Merged
dimitar.p.ivanov merged 4 commits from improve_specs into master 2026-05-22 16:54:18 +09:00
+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 ->
2
@@ -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