mirror of
https://github.com/valitydev/wapi-lib.git
synced 2024-11-07 02:35:18 +00:00
HG-384: Update fistful proto (#32)
This commit is contained in:
parent
7acf0bbc76
commit
853659ca8f
@ -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)]
|
||||||
}
|
}
|
||||||
|
@ -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)]
|
||||||
}
|
}
|
||||||
|
@ -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))]
|
||||||
}
|
}
|
||||||
|
@ -127,7 +127,7 @@ 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,7 +153,7 @@ 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,7 +174,7 @@ 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) ->
|
||||||
@ -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().
|
||||||
|
|
||||||
|
@ -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",
|
||||||
|
Loading…
Reference in New Issue
Block a user