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:
+9
-2
@@ -788,7 +788,7 @@ contract_code(ID) ->
|
||||
Result :: {ok, Source}
|
||||
| {project, Bundle}
|
||||
| {error, Reason},
|
||||
Source :: string(),
|
||||
Source :: binary(),
|
||||
Bundle :: [{FilePath :: string(), Contents :: binary()}],
|
||||
Reason :: chain_error() | string().
|
||||
%% @doc
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user