Move sign, spend, account decode, etc to lib
This commit is contained in:
+2
-21
@@ -16,8 +16,7 @@
|
||||
-license("MIT").
|
||||
|
||||
%% Admin functions
|
||||
-export([network_id/0, network_id/1,
|
||||
tls/0, tls/1,
|
||||
-export([tls/0, tls/1,
|
||||
chain_nodes/0, chain_nodes/1,
|
||||
timeout/0, timeout/1]).
|
||||
|
||||
@@ -44,8 +43,7 @@
|
||||
req = none :: none | binary()}).
|
||||
|
||||
-record(s,
|
||||
{network_id = "gm_mainnet" :: string(),
|
||||
tls = false :: boolean(),
|
||||
{tls = false :: boolean(),
|
||||
chain_nodes = {[], []} :: {[hz:chain_node()], [hz:chain_node()]},
|
||||
sticky = none :: none | hz:chain_node(),
|
||||
fetchers = [] :: [#fetcher{}],
|
||||
@@ -58,19 +56,6 @@
|
||||
|
||||
%%% Service Interface
|
||||
|
||||
-spec network_id() -> Name
|
||||
when Name :: hz:network_id().
|
||||
|
||||
network_id() ->
|
||||
gen_server:call(?MODULE, network_id).
|
||||
|
||||
|
||||
-spec network_id(Name) -> ok
|
||||
when Name :: hz:network_id().
|
||||
|
||||
network_id(Name) ->
|
||||
gen_server:cast(?MODULE, {network_id, Name}).
|
||||
|
||||
|
||||
-spec tls() -> boolean().
|
||||
|
||||
@@ -163,8 +148,6 @@ init(none) ->
|
||||
handle_call({request, Request}, From, State) ->
|
||||
NewState = do_request(Request, From, State),
|
||||
{noreply, NewState};
|
||||
handle_call(network_id, _, State = #s{network_id = Name}) ->
|
||||
{reply, Name, State};
|
||||
handle_call(tls, _, State = #s{tls = TLS}) ->
|
||||
{reply, TLS, State};
|
||||
handle_call(chain_nodes, _, State = #s{chain_nodes = {Wait, Used}}) ->
|
||||
@@ -177,8 +160,6 @@ handle_call(Unexpected, From, State) ->
|
||||
{noreply, State}.
|
||||
|
||||
|
||||
handle_cast({network_id, Name}, State) ->
|
||||
{noreply, State#s{network_id = Name}};
|
||||
handle_cast({tls, Boolean}, State) ->
|
||||
NewState = do_tls(Boolean, State),
|
||||
{noreply, NewState};
|
||||
|
||||
Reference in New Issue
Block a user