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}
|
Result :: {ok, Source}
|
||||||
| {project, Bundle}
|
| {project, Bundle}
|
||||||
| {error, Reason},
|
| {error, Reason},
|
||||||
Source :: string(),
|
Source :: binary(),
|
||||||
Bundle :: [{FilePath :: string(), Contents :: binary()}],
|
Bundle :: [{FilePath :: string(), Contents :: binary()}],
|
||||||
Reason :: chain_error() | string().
|
Reason :: chain_error() | string().
|
||||||
%% @doc
|
%% @doc
|
||||||
@@ -809,6 +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, [{_File, Source}]} ->
|
||||||
|
{ok, Source};
|
||||||
{ok, Bundle} ->
|
{ok, Bundle} ->
|
||||||
{project, Bundle};
|
{project, Bundle};
|
||||||
Error ->
|
Error ->
|
||||||
@@ -895,6 +897,11 @@ request(Path) ->
|
|||||||
hz_man:request(unicode:characters_to_list(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) ->
|
request(Path, Payload) ->
|
||||||
hz_man:request(unicode:characters_to_list(Path), Payload).
|
hz_man:request(unicode:characters_to_list(Path), Payload).
|
||||||
|
|
||||||
@@ -930,7 +937,7 @@ contract_create(CreatorID, Path, InitArgs) ->
|
|||||||
Gas = 500000,
|
Gas = 500000,
|
||||||
GasPrice = min_gas_price(),
|
GasPrice = min_gas_price(),
|
||||||
contract_create(CreatorID, Nonce,
|
contract_create(CreatorID, Nonce,
|
||||||
Amount, TTL, Gas, GasPrice,
|
Gas, GasPrice, Amount, TTL,
|
||||||
Path, InitArgs);
|
Path, InitArgs);
|
||||||
Error ->
|
Error ->
|
||||||
Error
|
Error
|
||||||
|
|||||||
Reference in New Issue
Block a user