diff --git a/src/gd_n_recvr.erl b/src/gd_n_recvr.erl index 57f1701..5232172 100644 --- a/src/gd_n_recvr.erl +++ b/src/gd_n_recvr.erl @@ -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}} -> diff --git a/src/gd_v_express.erl b/src/gd_v_express.erl index 478ea60..d925fe6 100644 --- a/src/gd_v_express.erl +++ b/src/gd_v_express.erl @@ -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.