Applicationize Vanillae and fix 'ok' assertion
This commit is contained in:
@@ -1033,14 +1033,18 @@ read_aci(Path) ->
|
|||||||
%% for contract_call/10.
|
%% for contract_call/10.
|
||||||
|
|
||||||
contract_call(CallerID, AACI, ConID, Fun, Args) ->
|
contract_call(CallerID, AACI, ConID, Fun, Args) ->
|
||||||
{ok, Nonce} = next_nonce(CallerID),
|
case next_nonce(CallerID) of
|
||||||
|
{ok, Nonce} ->
|
||||||
Gas = min_gas(),
|
Gas = min_gas(),
|
||||||
GasPrice = min_gas_price(),
|
GasPrice = min_gas_price(),
|
||||||
Fee = min_fee(),
|
Fee = min_fee(),
|
||||||
Amount = 0,
|
Amount = 0,
|
||||||
contract_call(CallerID, Nonce,
|
contract_call(CallerID, Nonce,
|
||||||
Gas, GasPrice, Fee, Amount,
|
Gas, GasPrice, Fee, Amount,
|
||||||
AACI, ConID, Fun, Args).
|
AACI, ConID, Fun, Args);
|
||||||
|
Error ->
|
||||||
|
Error
|
||||||
|
end.
|
||||||
|
|
||||||
|
|
||||||
-spec contract_call(CallerID, Gas, AACI, ConID, Fun, Args) -> Result
|
-spec contract_call(CallerID, Gas, AACI, ConID, Fun, Args) -> Result
|
||||||
@@ -1061,13 +1065,17 @@ contract_call(CallerID, AACI, ConID, Fun, Args) ->
|
|||||||
%% for contract_call/10.
|
%% for contract_call/10.
|
||||||
|
|
||||||
contract_call(CallerID, Gas, AACI, ConID, Fun, Args) ->
|
contract_call(CallerID, Gas, AACI, ConID, Fun, Args) ->
|
||||||
{ok, Nonce} = next_nonce(CallerID),
|
case next_nonce(CallerID) of
|
||||||
|
{ok, Nonce} ->
|
||||||
GasPrice = min_gas_price(),
|
GasPrice = min_gas_price(),
|
||||||
Fee = min_fee(),
|
Fee = min_fee(),
|
||||||
Amount = 0,
|
Amount = 0,
|
||||||
contract_call(CallerID, Nonce,
|
contract_call(CallerID, Nonce,
|
||||||
Gas, GasPrice, Fee, Amount,
|
Gas, GasPrice, Fee, Amount,
|
||||||
AACI, ConID, Fun, Args).
|
AACI, ConID, Fun, Args);
|
||||||
|
Error ->
|
||||||
|
Error
|
||||||
|
end.
|
||||||
|
|
||||||
|
|
||||||
-spec contract_call(CallerID, Nonce,
|
-spec contract_call(CallerID, Nonce,
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
%%% @doc
|
||||||
|
%%% Vanillae Erlang Aeternity application supervisor
|
||||||
|
%%%
|
||||||
|
%%% The very top level supervisor in the system. It only has one service branch: the
|
||||||
|
%%% "vanillae_man" (Vanillae Manager).
|
||||||
|
%%%
|
||||||
|
%%% See: http://erlang.org/doc/design_principles/applications.html
|
||||||
|
%%% See: http://zxq9.com/archives/1311
|
||||||
|
%%% @end
|
||||||
|
|
||||||
|
-module(vanillae_sup).
|
||||||
|
-vsn("0.1.0").
|
||||||
|
-behaviour(supervisor).
|
||||||
|
-author("Craig Everett <zxq9@zxq9.com>").
|
||||||
|
-copyright("Craig Everett <zxq9@zxq9.com>").
|
||||||
|
-license("GPL-3.0-or-later").
|
||||||
|
|
||||||
|
-export([start_link/0]).
|
||||||
|
-export([init/1]).
|
||||||
|
|
||||||
|
|
||||||
|
-spec start_link() -> {ok, pid()}.
|
||||||
|
%% @private
|
||||||
|
%% This supervisor's own start function.
|
||||||
|
|
||||||
|
start_link() ->
|
||||||
|
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
|
||||||
|
|
||||||
|
|
||||||
|
-spec init([]) -> {ok, {supervisor:sup_flags(), [supervisor:child_spec()]}}.
|
||||||
|
%% @private
|
||||||
|
%% The OTP init/1 function.
|
||||||
|
|
||||||
|
init([]) ->
|
||||||
|
RestartStrategy = {one_for_one, 0, 60},
|
||||||
|
Manager = {vanillae_man,
|
||||||
|
{vanillae_man, start_link, []},
|
||||||
|
permanent,
|
||||||
|
5000,
|
||||||
|
worker,
|
||||||
|
[vanillae_man]},
|
||||||
|
Children = [Manager],
|
||||||
|
{ok, {RestartStrategy, Children}}.
|
||||||
@@ -2,12 +2,12 @@
|
|||||||
{author,"Craig Everett"}.
|
{author,"Craig Everett"}.
|
||||||
{c_email,"ceverett@tsuriai.jp"}.
|
{c_email,"ceverett@tsuriai.jp"}.
|
||||||
{copyright,"Craig Everett"}.
|
{copyright,"Craig Everett"}.
|
||||||
{deps,[{"otpr","aeserialization",{0,1,0}},
|
{deps,[{"otpr","aebytecode",{3,2,1}},
|
||||||
{"otpr","aesophia",{7,1,0}},
|
{"otpr","aesophia",{7,1,2}},
|
||||||
|
{"otpr","aeserialization",{0,1,0}},
|
||||||
{"otpr","zj",{1,1,0}},
|
{"otpr","zj",{1,1,0}},
|
||||||
{"otpr","eblake2",{1,0,0}},
|
{"otpr","eblake2",{1,0,0}},
|
||||||
{"otpr","getopt",{1,0,2}},
|
{"otpr","getopt",{1,0,2}}]}.
|
||||||
{"otpr","aebytecode",{3,2,0}}]}.
|
|
||||||
{desc,"Erlang library for ecommerce use of the Aeternity blockchain"}.
|
{desc,"Erlang library for ecommerce use of the Aeternity blockchain"}.
|
||||||
{file_exts,[]}.
|
{file_exts,[]}.
|
||||||
{key_name,none}.
|
{key_name,none}.
|
||||||
|
|||||||
Reference in New Issue
Block a user