WIP
This commit is contained in:
+1
-1
@@ -168,7 +168,7 @@ authenticate(State = #s{socket = Socket}) ->
|
||||
await_auth(State = #s{socket = Socket}, Ref, From) ->
|
||||
ok = active_once(State),
|
||||
receive
|
||||
{tcp, Socket, <<"ok:", Binary/binary>>} ->
|
||||
{tcp, Socket, <<"OK:", Binary/binary>>} ->
|
||||
From ! {Ref, ok},
|
||||
case zx_lib:b_to_ts(Binary) of
|
||||
{ok, {manifest, Manifest}} ->
|
||||
|
||||
+14
-5
@@ -79,6 +79,16 @@
|
||||
% sig = none :: none | {Key :: binary(), Sig :: binary()}}).
|
||||
|
||||
|
||||
-type meta() :: {Name :: binary(), % UTF8 binary string
|
||||
Size :: pos_integer(), % Size in bytes
|
||||
TS :: pos_integer(), % Timestamp is the height at creation
|
||||
TTL :: pos_integer(), % Expiry height is TS + TTL
|
||||
Sig :: none | sig()}.
|
||||
-type sig() :: {ID :: id(),
|
||||
Sig :: binary()}.
|
||||
-type id() :: binary(). % ID is binary string of the pubkey, serialized <<"ak_...">>
|
||||
|
||||
|
||||
%%% Interface
|
||||
|
||||
-spec to_front() -> ok.
|
||||
@@ -102,8 +112,7 @@ trouble(Info) ->
|
||||
|
||||
|
||||
-spec pending(Manifest) -> ok
|
||||
when Manifest :: [Transfer],
|
||||
Transfer :: {Name :: string(), Size :: pos_integer()}.
|
||||
when Manifest :: [meta()].
|
||||
|
||||
pending(Manifest) ->
|
||||
wx_object:cast(?MODULE, {pending, Manifest}).
|
||||
@@ -313,13 +322,13 @@ terminate(Reason, State) ->
|
||||
|
||||
%%% doers
|
||||
|
||||
do_pending(State, Manifest) ->
|
||||
do_pending(Manifest, State) ->
|
||||
ok = tell(info, "Would do_pending: ~p", [Manifest]),
|
||||
State.
|
||||
|
||||
|
||||
do_accounts(State, Manifest) ->
|
||||
ok = tell(info, "Would do_pending: ~p", [Manifest]),
|
||||
do_accounts(Manifest, State) ->
|
||||
ok = tell(info, "Would do_accounts: ~p", [Manifest]),
|
||||
State.
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user