HG-384: Update fistful proto (#32)

This commit is contained in:
Артем 2018-11-06 14:47:44 +03:00 committed by GitHub
parent 7acf0bbc76
commit 853659ca8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 19 deletions

View File

@ -66,11 +66,11 @@ publish_event(#{
} }
}) -> }) ->
#'idnt_SinkEvent'{ #'idnt_SinkEvent'{
'sequence' = marshal(event_id, ID), 'id' = marshal(event_id, ID),
'created_at' = marshal(timestamp, Dt), 'created_at' = marshal(timestamp, Dt),
'source' = marshal(id, SourceID), 'source' = marshal(id, SourceID),
'payload' = #'idnt_Event'{ 'payload' = #'idnt_Event'{
'id' = marshal(event_id, EventID), 'sequence' = marshal(event_id, EventID),
'occured_at' = marshal(timestamp, EventDt), 'occured_at' = marshal(timestamp, EventDt),
'changes' = [marshal(event, Payload)] 'changes' = [marshal(event, Payload)]
} }

View File

@ -66,11 +66,11 @@ publish_event(#{
} }
}) -> }) ->
#'wlt_SinkEvent'{ #'wlt_SinkEvent'{
'sequence' = marshal(event_id, ID), 'id' = marshal(event_id, ID),
'created_at' = marshal(timestamp, Dt), 'created_at' = marshal(timestamp, Dt),
'source' = marshal(id, SourceID), 'source' = marshal(id, SourceID),
'payload' = #'wlt_Event'{ 'payload' = #'wlt_Event'{
'id' = marshal(event_id, EventID), 'sequence' = marshal(event_id, EventID),
'occured_at' = marshal(timestamp, EventDt), 'occured_at' = marshal(timestamp, EventDt),
'changes' = [marshal(event, Payload)] 'changes' = [marshal(event, Payload)]
} }

View File

@ -81,11 +81,11 @@ publish_event(#{
} }
}) -> }) ->
#'wthd_SinkEvent'{ #'wthd_SinkEvent'{
'sequence' = marshal(event_id, ID), 'id' = marshal(event_id, ID),
'created_at' = marshal(timestamp, Dt), 'created_at' = marshal(timestamp, Dt),
'source' = marshal(id, SourceID), 'source' = marshal(id, SourceID),
'payload' = #'wthd_Event'{ 'payload' = #'wthd_Event'{
'id' = marshal(event_id, EventID), 'sequence' = marshal(event_id, EventID),
'occured_at' = marshal(timestamp, EventDt), 'occured_at' = marshal(timestamp, EventDt),
'changes' = [marshal(event, ff_transfer:maybe_migrate(Payload))] 'changes' = [marshal(event, ff_transfer:maybe_migrate(Payload))]
} }

View File

@ -127,8 +127,8 @@ get_identity_events_ok(C) ->
{ok, RawEvents} = ff_identity_machine:events(ID, {undefined, 1000, forward}), {ok, RawEvents} = ff_identity_machine:events(ID, {undefined, 1000, forward}),
{ok, Events} = call_eventsink_handler('GetEvents', {ok, Events} = call_eventsink_handler('GetEvents',
Service, [#'evsink_EventRange'{'after' = LastEvent, limit = 1000}]), Service, [#'evsink_EventRange'{'after' = LastEvent, limit = 1000}]),
MaxID = get_max_sinkevent_sequence(Events), MaxID = get_max_sinkevent_id(Events),
MaxID = LastEvent + length(RawEvents). MaxID = LastEvent + length(RawEvents).
-spec get_create_wallet_events_ok(config()) -> test_return(). -spec get_create_wallet_events_ok(config()) -> test_return().
@ -153,8 +153,8 @@ get_create_wallet_events_ok(C) ->
{ok, RawEvents} = ff_wallet_machine:events(ID, {undefined, 1000, forward}), {ok, RawEvents} = ff_wallet_machine:events(ID, {undefined, 1000, forward}),
{ok, Events} = call_eventsink_handler('GetEvents', {ok, Events} = call_eventsink_handler('GetEvents',
Service, [#'evsink_EventRange'{'after' = LastEvent, limit = 1000}]), Service, [#'evsink_EventRange'{'after' = LastEvent, limit = 1000}]),
MaxID = get_max_sinkevent_sequence(Events), MaxID = get_max_sinkevent_id(Events),
MaxID = LastEvent + length(RawEvents). MaxID = LastEvent + length(RawEvents).
-spec get_withdrawal_events_ok(config()) -> test_return(). -spec get_withdrawal_events_ok(config()) -> test_return().
@ -174,8 +174,8 @@ get_withdrawal_events_ok(C) ->
{ok, RawEvents} = ff_withdrawal:events(WdrID, {undefined, 1000, forward}), {ok, RawEvents} = ff_withdrawal:events(WdrID, {undefined, 1000, forward}),
{ok, Events} = call_eventsink_handler('GetEvents', {ok, Events} = call_eventsink_handler('GetEvents',
Service, [#'evsink_EventRange'{'after' = LastEvent, limit = 1000}]), Service, [#'evsink_EventRange'{'after' = LastEvent, limit = 1000}]),
MaxID = get_max_sinkevent_sequence(Events), MaxID = get_max_sinkevent_id(Events),
MaxID = LastEvent + length(RawEvents). MaxID = LastEvent + length(RawEvents).
create_identity(Party, C) -> create_identity(Party, C) ->
create_identity(Party, <<"good-one">>, <<"person">>, C). create_identity(Party, <<"good-one">>, <<"person">>, C).
@ -293,14 +293,14 @@ process_withdrawal(WalID, DestID) ->
WdrID. WdrID.
-spec get_max_sinkevent_sequence(list(evsink_event())) -> evsink_id(). -spec get_max_sinkevent_id(list(evsink_event())) -> evsink_id().
get_max_sinkevent_sequence(Events) when is_list(Events) -> get_max_sinkevent_id(Events) when is_list(Events) ->
lists:foldl(fun (Ev, Max) -> erlang:max(get_sinkevent_sequence(Ev), Max) end, 0, Events). lists:foldl(fun (Ev, Max) -> erlang:max(get_sinkevent_id(Ev), Max) end, 0, Events).
get_sinkevent_sequence(#'wlt_SinkEvent'{sequence = Sequence}) -> Sequence; get_sinkevent_id(#'wlt_SinkEvent'{id = ID}) -> ID;
get_sinkevent_sequence(#'wthd_SinkEvent'{sequence = Sequence}) -> Sequence; get_sinkevent_id(#'wthd_SinkEvent'{id = ID}) -> ID;
get_sinkevent_sequence(#'idnt_SinkEvent'{sequence = Sequence}) -> Sequence. get_sinkevent_id(#'idnt_SinkEvent'{id = ID}) -> ID.
-spec unwrap_last_sinkevent_id({ok | error, evsink_id()}) -> evsink_id(). -spec unwrap_last_sinkevent_id({ok | error, evsink_id()}) -> evsink_id().

View File

@ -38,7 +38,7 @@
0}, 0},
{<<"fistful_proto">>, {<<"fistful_proto">>,
{git,"git@github.com:rbkmoney/fistful-proto.git", {git,"git@github.com:rbkmoney/fistful-proto.git",
{ref,"325e57d3da4c3a935bd2a99e913d97718fc9fd52"}}, {ref,"08df5e92ad077d4434da133859d7b7852dd79f65"}},
0}, 0},
{<<"genlib">>, {<<"genlib">>,
{git,"https://github.com/rbkmoney/genlib.git", {git,"https://github.com/rbkmoney/genlib.git",