ED-116: sync with fusful-server (#9)

This commit is contained in:
dinama 2021-04-06 17:13:35 +03:00 committed by GitHub
parent feeb9e8023
commit 72fb0032f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
31 changed files with 603 additions and 418 deletions

View File

@ -17,10 +17,11 @@ SERVICE_IMAGE_PUSH_TAG ?= $(SERVICE_IMAGE_TAG)
# Base image for the service
BASE_IMAGE_NAME := service-erlang
BASE_IMAGE_TAG := da0ab769f01b650b389d18fc85e7418e727cbe96
BASE_IMAGE_TAG := d2b5ac42305aadae44d6f8b1d859fd1065749997
# Build image tag to be used
BUILD_IMAGE_TAG := 442c2c274c1d8e484e5213089906a4271641d95e
BUILD_IMAGE_NAME := build-erlang
BUILD_IMAGE_TAG := cc2d319150ec0b9cd23ad9347692a8066616b0f4
REGISTRY := dr2.rbkmoney.com
@ -49,7 +50,7 @@ xref: submodules
$(REBAR) xref
lint:
elvis rock
elvis rock -V
check_format:
$(REBAR) fmt -c

View File

@ -115,6 +115,10 @@ get_operation_access('GetCurrency', _) ->
[{[party], read}];
get_operation_access('ListDeposits', _) ->
[{[party], read}];
get_operation_access('ListDepositReverts', _) ->
[{[party], read}];
get_operation_access('ListDepositAdjustments', _) ->
[{[party], read}];
get_operation_access('ListDestinations', _) ->
[{[party, destinations], read}];
get_operation_access('CreateDestination', _) ->

View File

@ -909,9 +909,19 @@ events_collect_test_() ->
#p2p_transfer_Event{
event = EventID,
occured_at = <<"2020-05-25T12:34:56.123456Z">>,
change = {route, #p2p_transfer_RouteChange{}}
change =
{route, #p2p_transfer_RouteChange{
route = #p2p_transfer_Route{
provider_id = 0
}
}}
}
end,
% Consturct
ConstructEvent = fun
(N) when (N rem 2) == 0 -> Reject(N);
(N) -> Event(N)
end,
meck:new([wapi_handler_utils], [passthrough]),
%
% mock Request: {Service, 'GetEvents', [EntityID, EventRange]},
@ -927,13 +937,7 @@ events_collect_test_() ->
{ok, [Event(N) || N <- lists:seq(After + 1, After + Limit), N rem 2 =:= 0]};
({produce_reject, 'GetEvents', {_, EventRange}}, _Context) ->
#'EventRange'{'after' = After, limit = Limit} = EventRange,
{ok, [
case N rem 2 of
0 -> Reject(N);
_ -> Event(N)
end
|| N <- lists:seq(After + 1, After + Limit)
]};
{ok, [ConstructEvent(N) || N <- lists:seq(After + 1, After + Limit)]};
({produce_range, 'GetEvents', {_, EventRange}}, _Context) ->
#'EventRange'{'after' = After, limit = Limit} = EventRange,
{ok, [Event(N) || N <- lists:seq(After + 1, After + Limit)]};

View File

@ -7,55 +7,64 @@
-export([list_deposits/2]).
-export([list_destinations/2]).
-export([list_identities/2]).
-export([list_deposit_reverts/2]).
-export([list_deposit_adjustments/2]).
-type req_data() :: wapi_handler:req_data().
-type handler_context() :: wapi_handler:context().
-type response_data() :: wapi_handler:response_data().
-spec list_wallets(req_data(), handler_context()) -> {ok, response_data()} | {error, StatError} when
StatError ::
{invalid | bad_token, binary()}.
StatError :: {invalid | bad_token, binary()}.
list_wallets(Params, Context) ->
Dsl = create_dsl(wallets, Params, Context),
Req = create_request(Dsl, maps:get(continuationToken, Params, undefined)),
Result = wapi_handler_utils:service_call({fistful_stat, 'GetWallets', {Req}}, Context),
process_result(Result).
service_call(wallets, Params, Context).
-spec list_withdrawals(req_data(), handler_context()) -> {ok, response_data()} | {error, StatError} when
StatError ::
{invalid | bad_token, binary()}.
StatError :: {invalid | bad_token, binary()}.
list_withdrawals(Params, Context) ->
Dsl = create_dsl(withdrawals, Params, Context),
Req = create_request(Dsl, maps:get(continuationToken, Params, undefined)),
Result = wapi_handler_utils:service_call({fistful_stat, 'GetWithdrawals', {Req}}, Context),
process_result(Result).
service_call(withdrawals, Params, Context).
-spec list_deposits(req_data(), handler_context()) -> {ok, response_data()} | {error, StatError} when
StatError ::
{invalid | bad_token, binary()}.
StatError :: {invalid | bad_token, binary()}.
list_deposits(Params, Context) ->
Dsl = create_dsl(deposits, Params, Context),
Req = create_request(Dsl, maps:get(continuationToken, Params, undefined)),
Result = wapi_handler_utils:service_call({fistful_stat, 'GetDeposits', {Req}}, Context),
process_result(Result).
service_call(deposits, Params, Context).
-spec list_destinations(req_data(), handler_context()) -> {ok, response_data()} | {error, StatError} when
StatError ::
{invalid | bad_token, binary()}.
StatError :: {invalid | bad_token, binary()}.
list_destinations(Params, Context) ->
Dsl = create_dsl(destinations, Params, Context),
Req = create_request(Dsl, maps:get(continuationToken, Params, undefined)),
Result = wapi_handler_utils:service_call({fistful_stat, 'GetDestinations', {Req}}, Context),
process_result(Result).
service_call(destinations, Params, Context).
-spec list_identities(req_data(), handler_context()) -> {ok, response_data()} | {error, StatError} when
StatError ::
{invalid | bad_token, binary()}.
StatError :: {invalid | bad_token, binary()}.
list_identities(Params, Context) ->
Dsl = create_dsl(identities, Params, Context),
Req = create_request(Dsl, maps:get(continuationToken, Params, undefined)),
Result = wapi_handler_utils:service_call({fistful_stat, 'GetIdentities', {Req}}, Context),
process_result(Result).
service_call(identities, Params, Context).
-spec list_deposit_reverts(req_data(), handler_context()) -> {ok, response_data()} | {error, StatError} when
StatError :: {invalid | bad_token, binary()}.
list_deposit_reverts(Params, Context) ->
service_call(deposit_reverts, Params, Context).
-spec list_deposit_adjustments(req_data(), handler_context()) -> {ok, response_data()} | {error, StatError} when
StatError :: {invalid | bad_token, binary()}.
list_deposit_adjustments(Params, Context) ->
service_call(deposit_adjustments, Params, Context).
service_call(StatTag, Params, Context) ->
Req = create_request(
create_dsl(StatTag, Params, Context),
maps:get(continuationToken, Params, undefined)
),
process_result(
wapi_handler_utils:service_call({fistful_stat, method(StatTag), {Req}}, Context)
).
method(wallets) -> 'GetWallets';
method(withdrawals) -> 'GetWithdrawals';
method(deposits) -> 'GetDeposits';
method(destinations) -> 'GetDestinations';
method(identities) -> 'GetIdentities';
method(deposit_reverts) -> 'GetDepositReverts';
method(deposit_adjustments) -> 'GetDepositAdjustments'.
create_dsl(StatTag, Req, Context) ->
Query = create_query(StatTag, Req, Context),
@ -113,6 +122,38 @@ create_query(identities, Req, Context) ->
<<"provider_id">> => genlib_map:get(providerID, Req),
<<"class">> => genlib_map:get(class, Req),
<<"level">> => genlib_map:get(level, Req)
};
create_query(deposit_reverts, Req, Context) ->
#{
<<"party_id">> => wapi_handler_utils:get_owner(Context),
<<"identity_id">> => genlib_map:get(identityID, Req),
<<"source_id">> => genlib_map:get(sourceID, Req),
<<"wallet_id">> => genlib_map:get(walletID, Req),
<<"deposit_id">> => genlib_map:get(depositID, Req),
<<"revert_id">> => genlib_map:get(revertID, Req),
<<"amount_from">> => genlib_map:get(amountFrom, Req),
<<"amount_to">> => genlib_map:get(amountTo, Req),
<<"currency_code">> => genlib_map:get(currencyID, Req),
<<"status">> => genlib_map:get(status, Req),
<<"deposit_status">> => genlib_map:get(depositStatus, Req),
<<"from_time">> => get_time(createdAtFrom, Req),
<<"to_time">> => get_time(createdAtTo, Req)
};
create_query(deposit_adjustments, Req, Context) ->
#{
<<"party_id">> => wapi_handler_utils:get_owner(Context),
<<"identity_id">> => genlib_map:get(identityID, Req),
<<"source_id">> => genlib_map:get(sourceID, Req),
<<"wallet_id">> => genlib_map:get(walletID, Req),
<<"deposit_id">> => genlib_map:get(depositID, Req),
<<"adjustment_id">> => genlib_map:get(adjustmentID, Req),
<<"amount_from">> => genlib_map:get(amountFrom, Req),
<<"amount_to">> => genlib_map:get(amountTo, Req),
<<"currency_code">> => genlib_map:get(currencyID, Req),
<<"status">> => genlib_map:get(status, Req),
<<"deposit_status">> => genlib_map:get(depositStatus, Req),
<<"from_time">> => get_time(createdAtFrom, Req),
<<"to_time">> => get_time(createdAtTo, Req)
}.
create_request(Dsl, Token) ->
@ -158,7 +199,9 @@ format_request_errors(Errors) -> genlib_string:join(<<"\n">>, Errors).
(deposits, ff_proto_fistful_stat_thrift:'StatDeposit'()) -> map();
(wallets, ff_proto_fistful_stat_thrift:'StatWallet'()) -> map();
(destinations, ff_proto_fistful_stat_thrift:'StatDestination'()) -> map();
(identities, ff_proto_fistful_stat_thrift:'StatIdentity'()) -> map().
(identities, ff_proto_fistful_stat_thrift:'StatIdentity'()) -> map();
(deposit_reverts, ff_proto_fistful_stat_thrift:'StatDepositRevert'()) -> map();
(deposit_adjustments, ff_proto_fistful_stat_thrift:'StatDepositAdjustment'()) -> map().
unmarshal_response(withdrawals, Response) ->
merge_and_compact(
#{
@ -227,7 +270,63 @@ unmarshal_response(identities, Response) ->
<<"effectiveChallenge">> => Response#fistfulstat_StatIdentity.effective_challenge,
<<"isBlocked">> => Response#fistfulstat_StatIdentity.is_blocked,
<<"externalID">> => Response#fistfulstat_StatIdentity.external_id
}).
});
unmarshal_response(deposit_reverts, Response) ->
merge_and_compact(
#{
<<"id">> => Response#fistfulstat_StatDepositRevert.id,
<<"depositId">> => Response#fistfulstat_StatDepositRevert.deposit_id,
<<"wallet">> => Response#fistfulstat_StatDepositRevert.wallet_id,
<<"source">> => Response#fistfulstat_StatDepositRevert.source_id,
<<"body">> => unmarshal_cash(Response#fistfulstat_StatDepositRevert.body),
<<"createdAt">> => Response#fistfulstat_StatDepositRevert.created_at,
<<"reason">> => Response#fistfulstat_StatDepositRevert.reason,
<<"externalId">> => Response#fistfulstat_StatDepositRevert.external_id
},
unmarshal_status(Response#fistfulstat_StatDepositRevert.status)
);
unmarshal_response(deposit_adjustments, Response) ->
merge_and_compact(
#{
<<"id">> => Response#fistfulstat_StatDepositAdjustment.id,
<<"depositId">> => Response#fistfulstat_StatDepositAdjustment.deposit_id,
<<"changesPlan">> => unmarshal_changes_plan(Response#fistfulstat_StatDepositAdjustment.changes_plan),
<<"createdAt">> => Response#fistfulstat_StatDepositAdjustment.created_at,
<<"externalId">> => Response#fistfulstat_StatDepositAdjustment.external_id
},
unmarshal_status(Response#fistfulstat_StatDepositAdjustment.status)
).
unmarshal_status({pending, _}) ->
#{<<"status">> => <<"Pending">>};
unmarshal_status({succeeded, _}) ->
#{<<"status">> => <<"Succeeded">>};
unmarshal_status({failed, _}) ->
#{
<<"status">> => <<"Failed">>,
<<"failure">> => #{<<"code">> => <<"failed">>}
}.
unmarshal_changes_plan(#fistfulstat_DepositAdjustmentChangesPlan{new_cash = Cash, new_status = Status}) ->
maps:merge(#{<<"cash">> => unmarshal_cash_change_plan(Cash)}, unmarshal_status_change_plan(Status)).
unmarshal_cash_change_plan(undefined) ->
#{};
unmarshal_cash_change_plan(#fistfulstat_DepositAdjustmentCashChangePlan{
amount = Amount,
fee = Fee,
provider_fee = ProviderFee
}) ->
#{
<<"amount">> => unmarshal_cash(Amount),
<<"fee">> => unmarshal_cash(Fee),
<<"providerFee">> => unmarshal_cash(ProviderFee)
}.
unmarshal_status_change_plan(undefined) ->
#{};
unmarshal_status_change_plan(#fistfulstat_DepositAdjustmentStatusChangePlan{new_status = Status}) ->
unmarshal_status(Status).
unmarshal_destination_stat_status(undefined) ->
undefined;
@ -236,9 +335,12 @@ unmarshal_destination_stat_status({unauthorized, _}) ->
unmarshal_destination_stat_status({authorized, _}) ->
<<"Authorized">>.
unmarshal_cash(Amount, Currency) ->
unmarshal_cash(Amount, Currency) when is_bitstring(Currency) ->
#{<<"amount">> => Amount, <<"currency">> => Currency}.
unmarshal_cash(#'Cash'{amount = Amount, currency = Currency}) ->
unmarshal_cash(Amount, Currency#'CurrencyRef'.symbolic_code).
unmarshal_withdrawal_stat_status({pending, #fistfulstat_WithdrawalPending{}}) ->
#{<<"status">> => <<"Pending">>};
unmarshal_withdrawal_stat_status({succeeded, #fistfulstat_WithdrawalSucceeded{}}) ->

View File

@ -62,7 +62,9 @@ deadline_from_timeout(Timeout) ->
deadline_is_reached(Deadline) ->
woody_deadline:is_reached(Deadline).
-spec parse_lifetime(binary()) -> {ok, timeout()} | {error, bad_lifetime}.
-spec parse_lifetime
(undefined) -> {error, bad_lifetime};
(binary()) -> {ok, timeout()} | {error, bad_lifetime}.
parse_lifetime(undefined) ->
{error, bad_lifetime};
parse_lifetime(Bin) ->
@ -86,7 +88,8 @@ parse_lifetime(Bin) ->
-spec base64url_to_map(binary()) -> map() | no_return().
base64url_to_map(Base64) when is_binary(Base64) ->
try
jsx:decode(base64url:decode(Base64), [return_maps])
{ok, Json} = jose_base64url:decode(Base64),
jsx:decode(Json, [return_maps])
catch
Class:Reason ->
_ = logger:debug("decoding base64 ~p to map failed with ~p:~p", [Base64, Class, Reason]),
@ -96,7 +99,7 @@ base64url_to_map(Base64) when is_binary(Base64) ->
-spec map_to_base64url(map()) -> binary() | no_return().
map_to_base64url(Map) when is_map(Map) ->
try
base64url:encode(jsx:encode(Map))
jose_base64url:encode(jsx:encode(Map))
catch
Class:Reason ->
_ = logger:debug("encoding map ~p to base64 failed with ~p:~p", [Map, Class, Reason]),

View File

@ -5,7 +5,7 @@
%% swag_server_wallet_logic_handler callbacks
-export([map_error/2]).
-export([authorize_api_key/3]).
-export([authorize_api_key/4]).
-export([handle_request/4]).
%% wapi_handler callbacks
@ -52,15 +52,16 @@ map_error_type(schema_violated) -> <<"SchemaViolated">>;
map_error_type(wrong_type) -> <<"WrongType">>;
map_error_type(wrong_array) -> <<"WrongArray">>.
-spec authorize_api_key(operation_id(), api_key(), handler_opts()) -> false | {true, wapi_auth:context()}.
authorize_api_key(OperationID, ApiKey, _Opts) ->
ok = scoper:add_meta(#{api => wallet, operation_id => OperationID}),
-spec authorize_api_key(operation_id(), api_key(), request_context(), handler_opts()) ->
false | {true, wapi_auth:context()}.
authorize_api_key(OperationID, ApiKey, _SwagContext, _Opts) ->
ok = scoper:add_scope('swag.server', #{api => wallet, operation_id => OperationID}),
case uac:authorize_api_key(ApiKey, wapi_auth:get_verification_options()) of
{ok, Context0} ->
Context = wapi_auth:create_wapi_context(Context0),
{true, Context};
{error, Error} ->
_ = logger:info("API Key authorization failed: ~p", [Error]),
_ = logger:info("API Key authorization failed for ~p due to ~p", [OperationID, Error]),
false
end.
@ -594,6 +595,36 @@ process_request('ListDeposits', Params, Context, _Opts) ->
<<"description">> => Reason
})
end;
process_request('ListDepositReverts', Params, Context, _Opts) ->
case wapi_stat_backend:list_deposit_reverts(Params, Context) of
{ok, List} ->
wapi_handler_utils:reply_ok(200, List);
{error, {invalid, Errors}} ->
wapi_handler_utils:reply_error(400, #{
<<"errorType">> => <<"NoMatch">>,
<<"description">> => Errors
});
{error, {bad_token, Reason}} ->
wapi_handler_utils:reply_error(400, #{
<<"errorType">> => <<"InvalidToken">>,
<<"description">> => Reason
})
end;
process_request('ListDepositAdjustments', Params, Context, _Opts) ->
case wapi_stat_backend:list_deposit_adjustments(Params, Context) of
{ok, List} ->
wapi_handler_utils:reply_ok(200, List);
{error, {invalid, Errors}} ->
wapi_handler_utils:reply_error(400, #{
<<"errorType">> => <<"NoMatch">>,
<<"description">> => Errors
});
{error, {bad_token, Reason}} ->
wapi_handler_utils:reply_error(400, #{
<<"errorType">> => <<"InvalidToken">>,
<<"description">> => Reason
})
end;
%% W2W
process_request('CreateW2WTransfer', #{'W2WTransferParameters' := Params}, Context, _Opts) ->

View File

@ -64,8 +64,8 @@ prepare_param(Param) ->
case Param of
{limit, P} -> #{<<"limit">> => genlib:to_binary(P)};
{offset, P} -> #{<<"offset">> => genlib:to_binary(P)};
{from_time, P} -> #{<<"fromTime">> => genlib_format:format_datetime_iso8601(P)};
{to_time, P} -> #{<<"toTime">> => genlib_format:format_datetime_iso8601(P)};
{from_time, P} -> #{<<"fromTime">> => genlib_rfc3339:format(genlib_time:daytime_to_unixtime(P), second)};
{to_time, P} -> #{<<"toTime">> => genlib_rfc3339:format(genlib_time:daytime_to_unixtime(P), second)};
{status, P} -> #{<<"status">> => genlib:to_binary(P)};
{split_unit, P} -> #{<<"splitUnit">> => genlib:to_binary(P)};
{split_size, P} -> #{<<"splitSize">> => genlib:to_binary(P)};

View File

@ -54,7 +54,7 @@
init([]) ->
{ok, {#{strategy => one_for_all, intensity => 1, period => 1}, []}}.
-spec all() -> [test_case_name()].
-spec all() -> [{group, test_case_name()}].
all() ->
[
{group, base}

View File

@ -4,6 +4,12 @@
-export([handle_function/4]).
-spec handle_function(woody:func(), woody:args(), woody_context:ctx(), #{}) -> {ok, term()}.
-spec handle_function(woody:func(), woody:args(), woody_context:ctx(), woody:options()) ->
{ok, woody:result()} | no_return().
handle_function(FunName, Args, _, #{function := Fun}) ->
Fun(FunName, Args).
case Fun(FunName, Args) of
{throwing, Exception} ->
erlang:throw(Exception);
Result ->
Result
end.

View File

@ -63,7 +63,7 @@
init([]) ->
{ok, {#{strategy => one_for_all, intensity => 1, period => 1}, []}}.
-spec all() -> [test_case_name()].
-spec all() -> [{group, test_case_name()}].
all() ->
[
{group, base}
@ -145,7 +145,7 @@ end_per_testcase(_Name, C) ->
-spec create_identity(config()) -> _.
create_identity(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{bender_thrift, fun('GenerateID', _) -> {ok, ?GENERATE_ID_RESULT} end},
{fistful_identity, fun('Create', _) -> {ok, ?IDENTITY(PartyID)} end}
@ -156,7 +156,7 @@ create_identity(C) ->
-spec create_identity_provider_notfound(config()) -> _.
create_identity_provider_notfound(C) ->
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{bender_thrift, fun('GenerateID', _) -> {ok, ?GENERATE_ID_RESULT} end},
{fistful_identity, fun('Create', _) -> throw(#fistful_ProviderNotFound{}) end}
@ -170,7 +170,7 @@ create_identity_provider_notfound(C) ->
-spec create_identity_party_notfound(config()) -> _.
create_identity_party_notfound(C) ->
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{bender_thrift, fun('GenerateID', _) -> {ok, ?GENERATE_ID_RESULT} end},
{fistful_identity, fun('Create', _) -> throw(#fistful_PartyNotFound{}) end}
@ -184,7 +184,7 @@ create_identity_party_notfound(C) ->
-spec create_identity_class_notfound(config()) -> _.
create_identity_class_notfound(C) ->
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{bender_thrift, fun('GenerateID', _) -> {ok, ?GENERATE_ID_RESULT} end},
{fistful_identity, fun('Create', _) -> throw(#fistful_IdentityClassNotFound{}) end}
@ -198,7 +198,7 @@ create_identity_class_notfound(C) ->
-spec create_identity_party_inaccessible(config()) -> _.
create_identity_party_inaccessible(C) ->
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{bender_thrift, fun('GenerateID', _) -> {ok, ?GENERATE_ID_RESULT} end},
{fistful_identity, fun('Create', _) -> throw(#fistful_PartyInaccessible{}) end}
@ -213,7 +213,7 @@ create_identity_party_inaccessible(C) ->
-spec create_identity_thrift_name(config()) -> _.
create_identity_thrift_name(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{bender_thrift, fun('GenerateID', _) -> {ok, ?GENERATE_ID_RESULT} end},
{fistful_identity, fun('Create', _) -> {ok, ?IDENTITY(PartyID, ?DEFAULT_CONTEXT_NO_NAME(PartyID))} end}
@ -225,7 +225,7 @@ create_identity_thrift_name(C) ->
-spec get_identity(config()) -> _.
get_identity(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_identity, fun('Get', _) -> {ok, ?IDENTITY(PartyID)} end}
],
@ -235,9 +235,9 @@ get_identity(C) ->
-spec get_identity_notfound(config()) -> _.
get_identity_notfound(C) ->
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_identity, fun('Get', _) -> throw(#fistful_IdentityNotFound{}) end}
{fistful_identity, fun('Get', _) -> {throwing, #fistful_IdentityNotFound{}} end}
],
C
),
@ -248,7 +248,7 @@ get_identity_notfound(C) ->
-spec create_identity_challenge(config()) -> _.
create_identity_challenge(C) ->
create_identity_challenge_start_mocks(
_ = create_identity_challenge_start_mocks(
C,
fun() -> {ok, ?IDENTITY_CHALLENGE(?IDENTITY_CHALLENGE_STATUS_COMPLETED)} end
),
@ -256,7 +256,7 @@ create_identity_challenge(C) ->
-spec create_identity_challenge_identity_notfound(config()) -> _.
create_identity_challenge_identity_notfound(C) ->
create_identity_challenge_start_mocks(C, fun() -> throw(#fistful_IdentityNotFound{}) end),
_ = create_identity_challenge_start_mocks(C, fun() -> {throwing, #fistful_IdentityNotFound{}} end),
?assertEqual(
{error, {404, #{}}},
create_identity_challenge_call_api(C)
@ -264,7 +264,7 @@ create_identity_challenge_identity_notfound(C) ->
-spec create_identity_challenge_challenge_pending(config()) -> _.
create_identity_challenge_challenge_pending(C) ->
create_identity_challenge_start_mocks(C, fun() -> throw(#fistful_ChallengePending{}) end),
_ = create_identity_challenge_start_mocks(C, fun() -> {throwing, #fistful_ChallengePending{}} end),
?assertEqual(
{error, {409, #{}}},
create_identity_challenge_call_api(C)
@ -272,7 +272,7 @@ create_identity_challenge_challenge_pending(C) ->
-spec create_identity_challenge_class_notfound(config()) -> _.
create_identity_challenge_class_notfound(C) ->
create_identity_challenge_start_mocks(C, fun() -> throw(#fistful_ChallengeClassNotFound{}) end),
_ = create_identity_challenge_start_mocks(C, fun() -> {throwing, #fistful_ChallengeClassNotFound{}} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"No such challenge type">>}}},
create_identity_challenge_call_api(C)
@ -280,7 +280,7 @@ create_identity_challenge_class_notfound(C) ->
-spec create_identity_challenge_level_incorrect(config()) -> _.
create_identity_challenge_level_incorrect(C) ->
create_identity_challenge_start_mocks(C, fun() -> throw(#fistful_ChallengeLevelIncorrect{}) end),
_ = create_identity_challenge_start_mocks(C, fun() -> {throwing, #fistful_ChallengeLevelIncorrect{}} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"Illegal identification type for current identity level">>}}},
create_identity_challenge_call_api(C)
@ -288,7 +288,7 @@ create_identity_challenge_level_incorrect(C) ->
-spec create_identity_challenge_conflict(config()) -> _.
create_identity_challenge_conflict(C) ->
create_identity_challenge_start_mocks(C, fun() -> throw(#fistful_ChallengeConflict{}) end),
_ = create_identity_challenge_start_mocks(C, fun() -> {throwing, #fistful_ChallengeConflict{}} end),
?assertEqual(
{error, {409, #{}}},
create_identity_challenge_call_api(C)
@ -296,7 +296,7 @@ create_identity_challenge_conflict(C) ->
-spec create_identity_challenge_proof_notfound(config()) -> _.
create_identity_challenge_proof_notfound(C) ->
create_identity_challenge_start_mocks(C, fun() -> throw(#fistful_ProofNotFound{}) end),
_ = create_identity_challenge_start_mocks(C, fun() -> {throwing, #fistful_ProofNotFound{}} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"Proof not found">>}}},
create_identity_challenge_call_api(C)
@ -304,7 +304,7 @@ create_identity_challenge_proof_notfound(C) ->
-spec create_identity_challenge_proof_insufficient(config()) -> _.
create_identity_challenge_proof_insufficient(C) ->
create_identity_challenge_start_mocks(C, fun() -> throw(#fistful_ProofInsufficient{}) end),
_ = create_identity_challenge_start_mocks(C, fun() -> {throwing, #fistful_ProofInsufficient{}} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"Insufficient proof">>}}},
create_identity_challenge_call_api(C)
@ -313,7 +313,7 @@ create_identity_challenge_proof_insufficient(C) ->
-spec get_identity_challenge(config()) -> _.
get_identity_challenge(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_identity, fun
('GetContext', _) -> {ok, ?DEFAULT_CONTEXT(PartyID)};
@ -337,7 +337,7 @@ get_identity_challenge(C) ->
-spec list_identity_challenges(config()) -> _.
list_identity_challenges(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_identity, fun
('GetContext', _) -> {ok, ?DEFAULT_CONTEXT(PartyID)};
@ -363,11 +363,11 @@ list_identity_challenges(C) ->
-spec list_identity_challenges_identity_notfound(config()) -> _.
list_identity_challenges_identity_notfound(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_identity, fun
('GetContext', _) -> {ok, ?DEFAULT_CONTEXT(PartyID)};
('GetChallenges', _) -> throw(#fistful_IdentityNotFound{})
('GetChallenges', _) -> {throwing, #fistful_IdentityNotFound{}}
end},
{identdoc_storage, fun('Get', _) -> {ok, ?IDENT_DOC} end}
],
@ -392,7 +392,7 @@ list_identity_challenges_identity_notfound(C) ->
-spec get_identity_challenge_event(config()) -> _.
get_identity_challenge_event(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_identity, fun
('GetContext', _) -> {ok, ?DEFAULT_CONTEXT(PartyID)};
@ -416,7 +416,7 @@ get_identity_challenge_event(C) ->
-spec poll_identity_challenge_events(config()) -> _.
poll_identity_challenge_events(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_identity, fun
('GetContext', _) -> {ok, ?DEFAULT_CONTEXT(PartyID)};
@ -430,11 +430,11 @@ poll_identity_challenge_events(C) ->
-spec poll_identity_challenge_events_identity_notfound(config()) -> _.
poll_identity_challenge_events_identity_notfound(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_identity, fun
('GetContext', _) -> {ok, ?DEFAULT_CONTEXT(PartyID)};
('GetEvents', _) -> throw(#fistful_IdentityNotFound{})
('GetEvents', _) -> {throwing, #fistful_IdentityNotFound{}}
end}
],
C
@ -448,7 +448,7 @@ poll_identity_challenge_events_identity_notfound(C) ->
create_identity_challenge_start_mocks(C, StartChallengeResultFun) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{bender_thrift, fun('GenerateID', _) -> {ok, ?GENERATE_ID_RESULT} end},
{fistful_identity, fun

View File

@ -50,7 +50,7 @@ init([]) ->
%% Configure tests
-spec all() -> [test_case_name()].
-spec all() -> [{group, test_case_name()}].
all() ->
[
{group, base}
@ -114,10 +114,10 @@ init_per_testcase(Name, C) ->
ok = wapi_context:save(C1),
[{test_sup, wapi_ct_helper:start_mocked_service_sup(?MODULE)} | C1].
-spec end_per_testcase(test_case_name(), config()) -> config().
-spec end_per_testcase(test_case_name(), config()) -> _.
end_per_testcase(_Name, C) ->
ok = wapi_context:cleanup(),
wapi_ct_helper:stop_mocked_service_sup(?config(test_sup, C)),
_ = wapi_ct_helper:stop_mocked_service_sup(?config(test_sup, C)),
ok.
%% Tests
@ -125,7 +125,7 @@ end_per_testcase(_Name, C) ->
-spec create_ok_test(config()) -> _.
create_ok_test(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{bender_thrift, fun('GenerateID', _) -> {ok, ?GENERATE_ID_RESULT} end},
{fistful_identity, fun('GetContext', _) -> {ok, ?DEFAULT_CONTEXT(PartyID)} end},
@ -159,7 +159,7 @@ create_ok_test(C) ->
-spec get_ok_test(config()) -> _.
get_ok_test(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_p2p_template, fun('Get', _) -> {ok, ?P2P_TEMPLATE(PartyID)} end}
],
@ -178,7 +178,7 @@ get_ok_test(C) ->
-spec block_ok_test(config()) -> _.
block_ok_test(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_p2p_template, fun('Get', _) -> {ok, ?P2P_TEMPLATE(PartyID)} end}
],
@ -197,7 +197,7 @@ block_ok_test(C) ->
-spec issue_access_token_ok_test(config()) -> _.
issue_access_token_ok_test(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_p2p_template, fun
('GetContext', _) -> {ok, ?DEFAULT_CONTEXT(PartyID)};
@ -223,7 +223,7 @@ issue_access_token_ok_test(C) ->
-spec issue_transfer_ticket_ok_test(config()) -> _.
issue_transfer_ticket_ok_test(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{bender_thrift, fun('GenerateID', _) -> {ok, ?GENERATE_ID_RESULT} end},
{fistful_p2p_template, fun
@ -251,7 +251,7 @@ issue_transfer_ticket_ok_test(C) ->
-spec issue_transfer_ticket_with_access_expiration_ok_test(config()) -> _.
issue_transfer_ticket_with_access_expiration_ok_test(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{bender_thrift, fun('GenerateID', _) -> {ok, ?GENERATE_ID_RESULT} end},
{fistful_p2p_template, fun
@ -280,7 +280,7 @@ issue_transfer_ticket_with_access_expiration_ok_test(C) ->
-spec quote_transfer_ok_test(config()) -> _.
quote_transfer_ok_test(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_identity, fun('Get', _) -> {ok, ?IDENTITY(PartyID)} end},
{fistful_p2p_template, fun
@ -290,35 +290,12 @@ quote_transfer_ok_test(C) ->
],
C
),
Token = create_card_token(),
{ok, #{<<"token">> := _QuoteToken}} = call_api(
fun swag_client_wallet_p2_p_templates_api:quote_p2_p_transfer_with_template/3,
#{
binding => #{
<<"p2pTransferTemplateID">> => ?STRING
},
body => #{
<<"body">> => #{
<<"amount">> => ?INTEGER,
<<"currency">> => ?RUB
},
<<"sender">> => #{
<<"type">> => <<"BankCardSenderResource">>,
<<"token">> => Token
},
<<"receiver">> => #{
<<"type">> => <<"BankCardReceiverResource">>,
<<"token">> => Token
}
}
},
?config(context, C)
).
?assertMatch({ok, #{<<"token">> := _QuoteToken}}, quote_p2p_transfer_with_template_call_api(C)).
-spec quote_transfer_fail_resource_token_invalid_test(config()) -> _.
quote_transfer_fail_resource_token_invalid_test(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_p2p_template, fun('GetContext', _) -> {ok, ?DEFAULT_CONTEXT(PartyID)} end}
],
@ -346,7 +323,7 @@ quote_transfer_fail_resource_token_invalid_test(C) ->
-spec quote_transfer_fail_resource_token_expire_test(config()) -> _.
quote_transfer_fail_resource_token_expire_test(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_p2p_template, fun('GetContext', _) -> {ok, ?DEFAULT_CONTEXT(PartyID)} end}
],
@ -374,7 +351,7 @@ quote_transfer_fail_resource_token_expire_test(C) ->
-spec create_transfer_ok_test(config()) -> _.
create_transfer_ok_test(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{bender_thrift, fun('GenerateID', _) -> {ok, ?GENERATE_ID_RESULT} end},
{fistful_p2p_template, fun
@ -393,7 +370,7 @@ create_transfer_ok_test(C) ->
-spec create_transfer_fail_resource_token_invalid_test(config()) -> _.
create_transfer_fail_resource_token_invalid_test(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{bender_thrift, fun('GenerateID', _) -> {ok, ?GENERATE_ID_RESULT} end},
{fistful_p2p_template, fun
@ -428,7 +405,7 @@ create_transfer_fail_resource_token_invalid_test(C) ->
-spec create_transfer_fail_resource_token_expire_test(config()) -> _.
create_transfer_fail_resource_token_expire_test(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{bender_thrift, fun('GenerateID', _) -> {ok, ?GENERATE_ID_RESULT} end},
{fistful_p2p_template, fun
@ -461,6 +438,8 @@ create_transfer_fail_resource_token_expire_test(C) ->
).
%% Utility
quote_p2p_transfer_with_template_call_api(C) ->
quote_p2p_transfer_with_template_call_api(C, create_card_token(), create_card_token()).
quote_p2p_transfer_with_template_call_api(C, SenderToken, ReceiverToken) ->
call_api(
@ -488,8 +467,8 @@ quote_p2p_transfer_with_template_call_api(C, SenderToken, ReceiverToken) ->
).
create_p2p_transfer_with_template_call_api(C, Ticket) ->
ValidResourceToken = create_card_token(),
create_p2p_transfer_with_template_call_api(C, Ticket, ValidResourceToken, ValidResourceToken).
ResourceToken = create_card_token(),
create_p2p_transfer_with_template_call_api(C, Ticket, ResourceToken, ResourceToken).
create_p2p_transfer_with_template_call_api(C, Ticket, SenderToken, ReceiverToken) ->
Context = maps:merge(wapi_ct_helper:cfg(context, C), #{token => Ticket}),

View File

@ -65,7 +65,7 @@
init([]) ->
{ok, {#{strategy => one_for_all, intensity => 1, period => 1}, []}}.
-spec all() -> [test_case_name()].
-spec all() -> [{group, test_case_name()}].
all() ->
[
{group, base}
@ -207,7 +207,7 @@ create_fail_resource_token_expire_test(C) ->
-spec create_fail_unauthorized_test(config()) -> _.
create_fail_unauthorized_test(C) ->
WrongPartyID = <<"SomeWrongPartyID">>,
create_ok_start_mocks(C, WrongPartyID),
_ = create_ok_start_mocks(C, WrongPartyID),
?assertEqual(
{error, {422, #{<<"message">> => <<"No such identity">>}}},
create_p2p_transfer_call_api(C)
@ -215,7 +215,7 @@ create_fail_unauthorized_test(C) ->
-spec create_fail_identity_notfound_test(config()) -> _.
create_fail_identity_notfound_test(C) ->
create_fail_start_mocks(C, fun() -> throw(#fistful_IdentityNotFound{}) end),
_ = create_fail_start_mocks(C, fun() -> {throwing, #fistful_IdentityNotFound{}} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"No such identity">>}}},
create_p2p_transfer_call_api(C)
@ -229,7 +229,7 @@ create_fail_forbidden_operation_currency_test(C) ->
#'CurrencyRef'{symbolic_code = ?RUB}
]
},
create_fail_start_mocks(C, fun() -> throw(ForbiddenOperationCurrencyException) end),
_ = create_fail_start_mocks(C, fun() -> {throwing, ForbiddenOperationCurrencyException} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"Currency not allowed">>}}},
create_p2p_transfer_call_api(C)
@ -244,7 +244,7 @@ create_fail_forbidden_operation_amount_test(C) ->
lower = {inclusive, ?CASH}
}
},
create_fail_start_mocks(C, fun() -> throw(ForbiddenOperationAmountException) end),
_ = create_fail_start_mocks(C, fun() -> {throwing, ForbiddenOperationAmountException} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"Transfer amount is out of allowed range">>}}},
create_p2p_transfer_call_api(C)
@ -252,7 +252,7 @@ create_fail_forbidden_operation_amount_test(C) ->
-spec create_fail_operation_not_permitted_test(config()) -> _.
create_fail_operation_not_permitted_test(C) ->
create_fail_start_mocks(C, fun() -> throw(#fistful_OperationNotPermitted{}) end),
_ = create_fail_start_mocks(C, fun() -> {throwing, #fistful_OperationNotPermitted{}} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"Operation not permitted">>}}},
create_p2p_transfer_call_api(C)
@ -263,7 +263,7 @@ create_fail_no_resource_info_test(C) ->
NoResourceInfoException = #p2p_transfer_NoResourceInfo{
type = sender
},
create_fail_start_mocks(C, fun() -> throw(NoResourceInfoException) end),
_ = create_fail_start_mocks(C, fun() -> {throwing, NoResourceInfoException} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"Invalid sender resource">>}}},
create_p2p_transfer_call_api(C)
@ -272,7 +272,7 @@ create_fail_no_resource_info_test(C) ->
-spec create_quote_ok_test(config()) -> _.
create_quote_ok_test(C) ->
IdentityID = <<"id">>,
get_quote_start_mocks(C, fun() -> {ok, ?P2P_TRANSFER_QUOTE(IdentityID)} end),
_ = get_quote_start_mocks(C, fun() -> {ok, ?P2P_TRANSFER_QUOTE(IdentityID)} end),
SenderToken = store_bank_card(),
ReceiverToken = store_bank_card(),
{ok, #{<<"token">> := Token}} = call_api(
@ -302,7 +302,7 @@ create_quote_ok_test(C) ->
-spec create_quote_fail_resource_token_invalid_test(config()) -> _.
create_quote_fail_resource_token_invalid_test(C) ->
IdentityID = <<"id">>,
get_quote_start_mocks(C, fun() -> {ok, ?P2P_TRANSFER_QUOTE(IdentityID)} end),
_ = get_quote_start_mocks(C, fun() -> {ok, ?P2P_TRANSFER_QUOTE(IdentityID)} end),
InvalidToken = <<"v1.InvalidToken">>,
ValidToken = store_bank_card(wapi_utils:deadline_from_timeout(100000)),
?assertMatch(
@ -325,7 +325,7 @@ create_quote_fail_resource_token_invalid_test(C) ->
-spec create_quote_fail_resource_token_expire_test(config()) -> _.
create_quote_fail_resource_token_expire_test(C) ->
IdentityID = <<"id">>,
get_quote_start_mocks(C, fun() -> {ok, ?P2P_TRANSFER_QUOTE(IdentityID)} end),
_ = get_quote_start_mocks(C, fun() -> {ok, ?P2P_TRANSFER_QUOTE(IdentityID)} end),
InvalidToken = store_bank_card(wapi_utils:deadline_from_timeout(0)),
ValidToken = store_bank_card(wapi_utils:deadline_from_timeout(100000)),
?assertMatch(
@ -349,7 +349,7 @@ create_quote_fail_resource_token_expire_test(C) ->
create_with_quote_token_ok_test(C) ->
IdentityID = <<"id">>,
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{bender_thrift, fun('GenerateID', _) -> {ok, ?GENERATE_ID_RESULT} end},
{fistful_identity, fun
@ -365,27 +365,7 @@ create_with_quote_token_ok_test(C) ->
),
SenderToken = store_bank_card(),
ReceiverToken = store_bank_card(),
{ok, #{<<"token">> := QuoteToken}} = call_api(
fun swag_client_wallet_p2_p_api:quote_p2_p_transfer/3,
#{
body => #{
<<"identityID">> => IdentityID,
<<"body">> => #{
<<"amount">> => ?INTEGER,
<<"currency">> => ?RUB
},
<<"sender">> => #{
<<"type">> => <<"BankCardSenderResource">>,
<<"token">> => SenderToken
},
<<"receiver">> => #{
<<"type">> => <<"BankCardReceiverResource">>,
<<"token">> => ReceiverToken
}
}
},
?config(context, C)
),
{ok, #{<<"token">> := QuoteToken}} = quote_p2p_transfer_call_api(C, IdentityID),
{ok, _} = call_api(
fun swag_client_wallet_p2_p_api:create_p2_p_transfer/3,
#{
@ -416,7 +396,7 @@ create_with_quote_token_ok_test(C) ->
-spec create_with_bad_quote_token_fail_test(config()) -> _.
create_with_bad_quote_token_fail_test(C) ->
create_ok_start_mocks(C),
_ = create_ok_start_mocks(C),
SenderToken = store_bank_card(),
ReceiverToken = store_bank_card(),
{error,
@ -453,7 +433,7 @@ create_with_bad_quote_token_fail_test(C) ->
-spec get_quote_fail_identity_not_found_test(config()) -> _.
get_quote_fail_identity_not_found_test(C) ->
IdentityID = <<"id">>,
get_quote_start_mocks(C, fun() -> throw(#fistful_IdentityNotFound{}) end),
_ = get_quote_start_mocks(C, fun() -> {throwing, #fistful_IdentityNotFound{}} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"No such identity">>}}},
quote_p2p_transfer_call_api(C, IdentityID)
@ -468,7 +448,7 @@ get_quote_fail_forbidden_operation_currency_test(C) ->
]
},
IdentityID = <<"id">>,
get_quote_start_mocks(C, fun() -> throw(ForbiddenOperationCurrencyException) end),
_ = get_quote_start_mocks(C, fun() -> {throwing, ForbiddenOperationCurrencyException} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"Currency not allowed">>}}},
quote_p2p_transfer_call_api(C, IdentityID)
@ -484,7 +464,7 @@ get_quote_fail_forbidden_operation_amount_test(C) ->
}
},
IdentityID = <<"id">>,
get_quote_start_mocks(C, fun() -> throw(ForbiddenOperationAmountException) end),
_ = get_quote_start_mocks(C, fun() -> {throwing, ForbiddenOperationAmountException} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"Transfer amount is out of allowed range">>}}},
quote_p2p_transfer_call_api(C, IdentityID)
@ -493,7 +473,7 @@ get_quote_fail_forbidden_operation_amount_test(C) ->
-spec get_quote_fail_operation_not_permitted_test(config()) -> _.
get_quote_fail_operation_not_permitted_test(C) ->
IdentityID = <<"id">>,
get_quote_start_mocks(C, fun() -> throw(#fistful_OperationNotPermitted{}) end),
_ = get_quote_start_mocks(C, fun() -> {throwing, #fistful_OperationNotPermitted{}} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"Operation not permitted">>}}},
quote_p2p_transfer_call_api(C, IdentityID)
@ -505,7 +485,7 @@ get_quote_fail_no_resource_info_test(C) ->
type = sender
},
IdentityID = <<"id">>,
get_quote_start_mocks(C, fun() -> throw(NoResourceInfoException) end),
_ = get_quote_start_mocks(C, fun() -> {throwing, NoResourceInfoException} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"Invalid sender resource">>}}},
quote_p2p_transfer_call_api(C, IdentityID)
@ -514,12 +494,12 @@ get_quote_fail_no_resource_info_test(C) ->
-spec get_ok_test(config()) -> _.
get_ok_test(C) ->
PartyID = ?config(party, C),
get_start_mocks(C, fun() -> {ok, ?P2P_TRANSFER(PartyID)} end),
_ = get_start_mocks(C, fun() -> {ok, ?P2P_TRANSFER(PartyID)} end),
{ok, _} = get_call_api(C).
-spec get_fail_p2p_notfound_test(config()) -> _.
get_fail_p2p_notfound_test(C) ->
get_start_mocks(C, fun() -> throw(#fistful_P2PNotFound{}) end),
_ = get_start_mocks(C, fun() -> {throwing, #fistful_P2PNotFound{}} end),
?assertEqual(
{error, {404, #{}}},
get_call_api(C)
@ -528,7 +508,7 @@ get_fail_p2p_notfound_test(C) ->
-spec get_events_ok(config()) -> _.
get_events_ok(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_p2p_transfer, fun
('GetContext', _) ->
@ -555,16 +535,15 @@ get_events_ok(C) ->
-spec get_events_fail(config()) -> _.
get_events_fail(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_p2p_transfer, fun
('GetContext', _) -> {ok, ?DEFAULT_CONTEXT(PartyID)};
('Get', _) -> throw(#fistful_P2PNotFound{})
('Get', _) -> {throwing, #fistful_P2PNotFound{}}
end}
],
C
),
?assertMatch({error, {404, #{}}}, get_events_call_api(C)).
%%

View File

@ -42,7 +42,7 @@
init([]) ->
{ok, {#{strategy => one_for_all, intensity => 1, period => 1}, []}}.
-spec all() -> [test_case_name()].
-spec all() -> [{group, test_case_name()}].
all() ->
[
{group, base}
@ -100,14 +100,14 @@ init_per_testcase(Name, C) ->
-spec end_per_testcase(test_case_name(), config()) -> config().
end_per_testcase(_Name, C) ->
ok = wapi_context:cleanup(),
wapi_ct_helper:stop_mocked_service_sup(?config(test_sup, C)),
_ = wapi_ct_helper:stop_mocked_service_sup(?config(test_sup, C)),
ok.
%%% Tests
-spec get_provider_ok(config()) -> _.
get_provider_ok(C) ->
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_provider, fun('GetProvider', _) -> {ok, ?PROVIDER} end}
],
@ -125,7 +125,7 @@ get_provider_ok(C) ->
-spec get_provider_fail_notfound(config()) -> _.
get_provider_fail_notfound(C) ->
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_provider, fun('GetProvider', _) -> throw(#fistful_ProviderNotFound{}) end}
],
@ -143,7 +143,7 @@ get_provider_fail_notfound(C) ->
-spec list_providers(config()) -> _.
list_providers(C) ->
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_provider, fun('ListProviders', _) -> {ok, [?PROVIDER, ?PROVIDER]} end}
],
@ -161,7 +161,7 @@ list_providers(C) ->
-spec get_provider_identity_classes(config()) -> _.
get_provider_identity_classes(C) ->
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_provider, fun('GetProvider', _) -> {ok, ?PROVIDER} end}
],
@ -179,7 +179,7 @@ get_provider_identity_classes(C) ->
-spec get_provider_identity_class(config()) -> _.
get_provider_identity_class(C) ->
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_provider, fun('GetProvider', _) -> {ok, ?PROVIDER} end}
],

View File

@ -45,7 +45,7 @@
init([]) ->
{ok, {#{strategy => one_for_all, intensity => 1, period => 1}, []}}.
-spec all() -> [test_case_name()].
-spec all() -> [{group, test_case_name()}].
all() ->
[
{group, base}
@ -103,14 +103,14 @@ init_per_testcase(Name, C) ->
-spec end_per_testcase(test_case_name(), config()) -> config().
end_per_testcase(_Name, C) ->
ok = wapi_context:cleanup(),
wapi_ct_helper:stop_mocked_service_sup(?config(test_sup, C)),
_ = wapi_ct_helper:stop_mocked_service_sup(?config(test_sup, C)),
ok.
%%% Tests
-spec create_report_ok_test(config()) -> _.
create_report_ok_test(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_report, fun
('GenerateReport', _) -> {ok, ?REPORT_ID};
@ -138,7 +138,7 @@ create_report_ok_test(C) ->
-spec get_report_ok_test(config()) -> _.
get_report_ok_test(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_report, fun('GetReport', _) -> {ok, ?REPORT} end},
{fistful_identity, fun('Get', _) -> {ok, ?IDENTITY(PartyID)} end}
@ -159,7 +159,7 @@ get_report_ok_test(C) ->
-spec get_reports_ok_test(config()) -> _.
get_reports_ok_test(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_report, fun('GetReports', _) ->
{ok, [
@ -190,14 +190,14 @@ get_reports_ok_test(C) ->
-spec reports_with_wrong_identity_ok_test(config()) -> _.
reports_with_wrong_identity_ok_test(C) ->
IdentityID = <<"WrongIdentity">>,
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_report, fun
('GenerateReport', _) -> {ok, ?REPORT_ID};
('GetReport', _) -> {ok, ?REPORT};
('GetReports', _) -> {ok, [?REPORT, ?REPORT, ?REPORT]}
end},
{fistful_identity, fun('Get', _) -> throw(#fistful_IdentityNotFound{}) end}
{fistful_identity, fun('Get', _) -> {throwing, #fistful_IdentityNotFound{}} end}
],
C
),
@ -242,7 +242,7 @@ reports_with_wrong_identity_ok_test(C) ->
-spec download_file_ok_test(config()) -> _.
download_file_ok_test(C) ->
wapi_ct_helper:mock_services([{file_storage, fun('GenerateDownloadUrl', _) -> {ok, ?STRING} end}], C),
_ = wapi_ct_helper:mock_services([{file_storage, fun('GenerateDownloadUrl', _) -> {ok, ?STRING} end}], C),
{ok, _} = call_api(
fun swag_client_wallet_downloads_api:download_file/3,
#{

View File

@ -32,7 +32,14 @@
list_destinations_bad_token_error/1,
list_identities/1,
list_identities_invalid_error/1,
list_identities_bad_token_error/1
list_identities_bad_token_error/1,
list_deposit_revert/1,
list_deposit_revert_invalid_error/1,
list_deposit_revert_bad_token_error/1,
list_deposit_adjustment_wo_changes_plan/1,
list_deposit_adjustment_with_changes_plan/1,
list_deposit_adjustment_invalid_error/1,
list_deposit_adjustment_bad_token_error/1
]).
% common-api is used since it is the domain used in production RN
@ -51,7 +58,7 @@
init([]) ->
{ok, {#{strategy => one_for_all, intensity => 1, period => 1}, []}}.
-spec all() -> [test_case_name()].
-spec all() -> [{group, test_case_name()}].
all() ->
[
{group, base}
@ -75,7 +82,14 @@ groups() ->
list_destinations_bad_token_error,
list_identities,
list_identities_invalid_error,
list_identities_bad_token_error
list_identities_bad_token_error,
list_deposit_revert,
list_deposit_revert_invalid_error,
list_deposit_revert_bad_token_error,
list_deposit_adjustment_wo_changes_plan,
list_deposit_adjustment_with_changes_plan,
list_deposit_adjustment_invalid_error,
list_deposit_adjustment_bad_token_error
]}
].
@ -119,7 +133,7 @@ init_per_testcase(Name, C) ->
-spec end_per_testcase(test_case_name(), config()) -> config().
end_per_testcase(_Name, C) ->
ok = wapi_context:cleanup(),
wapi_ct_helper:stop_mocked_service_sup(?config(test_sup, C)),
_ = wapi_ct_helper:stop_mocked_service_sup(?config(test_sup, C)),
ok.
%%% Tests
@ -144,23 +158,19 @@ list_wallets(C) ->
-spec list_wallets_invalid_error(config()) -> _.
list_wallets_invalid_error(C) ->
MockFunc = fun('GetWallets', _) ->
woody_error:raise(business, ?STAT_INVALID_EXCEPTION([<<"Error 1">>, <<"Error 2">>]))
end,
MockFunc = fun('GetWallets', _) -> {throwing, ?STAT_INVALID_EXCEPTION([<<"Error 1">>, <<"Error 2">>])} end,
SwagFunc = fun swag_client_wallet_wallets_api:list_wallets/3,
check_invalid_error(MockFunc, SwagFunc, C).
-spec list_wallets_bad_token_error(config()) -> _.
list_wallets_bad_token_error(C) ->
MockFunc = fun('GetWallets', _) ->
woody_error:raise(business, ?STAT_BADTOKEN_EXCEPTION)
end,
MockFunc = fun('GetWallets', _) -> {throwing, ?STAT_BADTOKEN_EXCEPTION} end,
SwagFunc = fun swag_client_wallet_wallets_api:list_wallets/3,
check_bad_token_error(MockFunc, SwagFunc, C).
-spec list_withdrawals(config()) -> _.
list_withdrawals(C) ->
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_stat, fun('GetWithdrawals', _) -> {ok, ?STAT_RESPONCE(?STAT_WITHDRAWALS)} end}
],
@ -178,23 +188,19 @@ list_withdrawals(C) ->
-spec list_withdrawals_invalid_error(config()) -> _.
list_withdrawals_invalid_error(C) ->
MockFunc = fun('GetWithdrawals', _) ->
woody_error:raise(business, ?STAT_INVALID_EXCEPTION([<<"Error 1">>, <<"Error 2">>]))
end,
MockFunc = fun('GetWithdrawals', _) -> {throwing, ?STAT_INVALID_EXCEPTION([<<"Error 1">>, <<"Error 2">>])} end,
SwagFunc = fun swag_client_wallet_withdrawals_api:list_withdrawals/3,
check_invalid_error(MockFunc, SwagFunc, C).
-spec list_withdrawals_bad_token_error(config()) -> _.
list_withdrawals_bad_token_error(C) ->
MockFunc = fun('GetWithdrawals', _) ->
woody_error:raise(business, ?STAT_BADTOKEN_EXCEPTION)
end,
MockFunc = fun('GetWithdrawals', _) -> {throwing, ?STAT_BADTOKEN_EXCEPTION} end,
SwagFunc = fun swag_client_wallet_withdrawals_api:list_withdrawals/3,
check_bad_token_error(MockFunc, SwagFunc, C).
-spec list_deposits(config()) -> _.
list_deposits(C) ->
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_stat, fun('GetDeposits', _) -> {ok, ?STAT_RESPONCE(?STAT_DEPOSITS)} end}
],
@ -212,23 +218,19 @@ list_deposits(C) ->
-spec list_deposits_invalid_error(config()) -> _.
list_deposits_invalid_error(C) ->
MockFunc = fun('GetDeposits', _) ->
woody_error:raise(business, ?STAT_INVALID_EXCEPTION([<<"Error 1">>, <<"Error 2">>]))
end,
MockFunc = fun('GetDeposits', _) -> {throwing, ?STAT_INVALID_EXCEPTION([<<"Error 1">>, <<"Error 2">>])} end,
SwagFunc = fun swag_client_wallet_deposits_api:list_deposits/3,
check_invalid_error(MockFunc, SwagFunc, C).
-spec list_deposits_bad_token_error(config()) -> _.
list_deposits_bad_token_error(C) ->
MockFunc = fun('GetDeposits', _) ->
woody_error:raise(business, ?STAT_BADTOKEN_EXCEPTION)
end,
MockFunc = fun('GetDeposits', _) -> {throwing, ?STAT_BADTOKEN_EXCEPTION} end,
SwagFunc = fun swag_client_wallet_deposits_api:list_deposits/3,
check_bad_token_error(MockFunc, SwagFunc, C).
-spec list_destinations(config()) -> _.
list_destinations(C) ->
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_stat, fun('GetDestinations', _) -> {ok, ?STAT_RESPONCE(?STAT_DESTINATIONS)} end}
],
@ -246,23 +248,19 @@ list_destinations(C) ->
-spec list_destinations_invalid_error(config()) -> _.
list_destinations_invalid_error(C) ->
MockFunc = fun('GetDestinations', _) ->
woody_error:raise(business, ?STAT_INVALID_EXCEPTION([<<"Error 1">>, <<"Error 2">>]))
end,
MockFunc = fun('GetDestinations', _) -> {throwing, ?STAT_INVALID_EXCEPTION([<<"Error 1">>, <<"Error 2">>])} end,
SwagFunc = fun swag_client_wallet_withdrawals_api:list_destinations/3,
check_invalid_error(MockFunc, SwagFunc, C).
-spec list_destinations_bad_token_error(config()) -> _.
list_destinations_bad_token_error(C) ->
MockFunc = fun('GetDestinations', _) ->
woody_error:raise(business, ?STAT_BADTOKEN_EXCEPTION)
end,
MockFunc = fun('GetDestinations', _) -> {throwing, ?STAT_BADTOKEN_EXCEPTION} end,
SwagFunc = fun swag_client_wallet_withdrawals_api:list_destinations/3,
check_bad_token_error(MockFunc, SwagFunc, C).
-spec list_identities(config()) -> _.
list_identities(C) ->
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_stat, fun('GetIdentities', _) -> {ok, ?STAT_RESPONCE(?STAT_IDENTITIES)} end}
],
@ -280,20 +278,100 @@ list_identities(C) ->
-spec list_identities_invalid_error(config()) -> _.
list_identities_invalid_error(C) ->
MockFunc = fun('GetIdentities', _) ->
woody_error:raise(business, ?STAT_INVALID_EXCEPTION([<<"Error 1">>, <<"Error 2">>]))
end,
MockFunc = fun('GetIdentities', _) -> {throwing, ?STAT_INVALID_EXCEPTION([<<"Error 1">>, <<"Error 2">>])} end,
SwagFunc = fun swag_client_wallet_identities_api:list_identities/3,
check_invalid_error(MockFunc, SwagFunc, C).
-spec list_identities_bad_token_error(config()) -> _.
list_identities_bad_token_error(C) ->
MockFunc = fun('GetIdentities', _) ->
woody_error:raise(business, ?STAT_BADTOKEN_EXCEPTION)
end,
MockFunc = fun('GetIdentities', _) -> {throwing, ?STAT_BADTOKEN_EXCEPTION} end,
SwagFunc = fun swag_client_wallet_identities_api:list_identities/3,
check_bad_token_error(MockFunc, SwagFunc, C).
-spec list_deposit_revert(config) -> _.
list_deposit_revert(Cfg) ->
_ = wapi_ct_helper:mock_services(
[
{fistful_stat, fun('GetDepositReverts', _) -> {ok, ?STAT_RESPONCE(?STAT_DEPOSIT_REVERTS)} end}
],
Cfg
),
{ok, _} = call_api(
fun swag_client_wallet_deposits_api:list_deposit_reverts/3,
#{
qs_val => #{
<<"limit">> => <<"123">>
}
},
wapi_ct_helper:cfg(context, Cfg)
).
-spec list_deposit_revert_invalid_error(config) -> _.
list_deposit_revert_invalid_error(Cfg) ->
MockFunc = fun('GetDepositReverts', _) -> {throwing, ?STAT_INVALID_EXCEPTION([<<"Error 1">>, <<"Error 2">>])} end,
SwagFunc = fun swag_client_wallet_deposits_api:list_deposit_reverts/3,
check_invalid_error(MockFunc, SwagFunc, Cfg).
-spec list_deposit_revert_bad_token_error(config) -> _.
list_deposit_revert_bad_token_error(Cfg) ->
MockFunc = fun('GetDepositReverts', _) -> {throwing, ?STAT_BADTOKEN_EXCEPTION} end,
SwagFunc = fun swag_client_wallet_deposits_api:list_deposit_reverts/3,
check_bad_token_error(MockFunc, SwagFunc, Cfg).
-spec list_deposit_adjustment_wo_changes_plan(config) -> _.
list_deposit_adjustment_wo_changes_plan(Cfg) ->
_ = wapi_ct_helper:mock_services(
[
{fistful_stat, fun('GetDepositAdjustments', _) ->
{ok, ?STAT_RESPONCE(?STAT_DEPOSIT_ADJUSTMENTS_WO_CANGES_PLAN)}
end}
],
Cfg
),
{ok, _} = call_api(
fun swag_client_wallet_deposits_api:list_deposit_adjustments/3,
#{
qs_val => #{
<<"limit">> => <<"123">>
}
},
wapi_ct_helper:cfg(context, Cfg)
).
-spec list_deposit_adjustment_with_changes_plan(config) -> _.
list_deposit_adjustment_with_changes_plan(Cfg) ->
_ = wapi_ct_helper:mock_services(
[
{fistful_stat, fun('GetDepositAdjustments', _) ->
{ok, ?STAT_RESPONCE(?STAT_DEPOSIT_ADJUSTMENTS_WITH_CANGES_PLAN)}
end}
],
Cfg
),
{ok, _} = call_api(
fun swag_client_wallet_deposits_api:list_deposit_adjustments/3,
#{
qs_val => #{
<<"limit">> => <<"123">>
}
},
wapi_ct_helper:cfg(context, Cfg)
).
-spec list_deposit_adjustment_invalid_error(config) -> _.
list_deposit_adjustment_invalid_error(Cfg) ->
MockFunc = fun('GetDepositAdjustments', _) ->
{throwing, ?STAT_INVALID_EXCEPTION([<<"Error 1">>, <<"Error 2">>])}
end,
SwagFunc = fun swag_client_wallet_deposits_api:list_deposit_adjustments/3,
check_invalid_error(MockFunc, SwagFunc, Cfg).
-spec list_deposit_adjustment_bad_token_error(config) -> _.
list_deposit_adjustment_bad_token_error(Cfg) ->
MockFunc = fun('GetDepositAdjustments', _) -> {throwing, ?STAT_BADTOKEN_EXCEPTION} end,
SwagFunc = fun swag_client_wallet_deposits_api:list_deposit_adjustments/3,
check_bad_token_error(MockFunc, SwagFunc, Cfg).
%%
check_invalid_error(MockFunc, SwagFunc, C) ->
@ -303,7 +381,7 @@ check_bad_token_error(MockFunc, SwagFunc, C) ->
check_error(<<"InvalidToken">>, MockFunc, SwagFunc, C).
check_error(Error, MockFunc, SwagFunc, C) ->
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_stat, MockFunc}
],

View File

@ -49,7 +49,7 @@
init([]) ->
{ok, {#{strategy => one_for_all, intensity => 1, period => 1}, []}}.
-spec all() -> [test_case_name()].
-spec all() -> [{group, test_case_name()}].
all() ->
[
{group, base}
@ -111,7 +111,7 @@ init_per_testcase(Name, C) ->
-spec end_per_testcase(test_case_name(), config()) -> config().
end_per_testcase(_Name, C) ->
ok = wapi_context:cleanup(),
wapi_ct_helper:stop_mocked_service_sup(?config(test_sup, C)),
_ = wapi_ct_helper:stop_mocked_service_sup(?config(test_sup, C)),
ok.
%%% Tests
@ -119,13 +119,13 @@ end_per_testcase(_Name, C) ->
-spec create_ok_test(config()) -> _.
create_ok_test(C) ->
PartyID = ?config(party, C),
create_w2_w_transfer_start_mocks(C, fun() -> {ok, ?W2W_TRANSFER(PartyID)} end),
_ = create_w2_w_transfer_start_mocks(C, fun() -> {ok, ?W2W_TRANSFER(PartyID)} end),
{ok, _} = create_w2_w_transfer_call_api(C).
-spec create_fail_unauthorized_wallet_test(config()) -> _.
create_fail_unauthorized_wallet_test(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{bender_thrift, fun('GenerateID', _) -> {ok, ?GENERATE_ID_RESULT} end},
{fistful_wallet, fun('GetContext', _) -> {ok, ?DEFAULT_CONTEXT(<<"someotherparty">>)} end},
@ -143,7 +143,7 @@ create_fail_wallet_notfound_test(C) ->
WalletNotFoundException = #fistful_WalletNotFound{
id = ?STRING
},
create_w2_w_transfer_start_mocks(C, fun() -> throw(WalletNotFoundException) end),
_ = create_w2_w_transfer_start_mocks(C, fun() -> {throwing, WalletNotFoundException} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"No such wallet sender">>}}},
create_w2_w_transfer_call_api(C)
@ -154,7 +154,7 @@ create_fail_invalid_operation_amount_test(C) ->
InvalidOperationAmountException = #fistful_InvalidOperationAmount{
amount = ?CASH
},
create_w2_w_transfer_start_mocks(C, fun() -> throw(InvalidOperationAmountException) end),
_ = create_w2_w_transfer_start_mocks(C, fun() -> {throwing, InvalidOperationAmountException} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"Bad transfer amount">>}}},
create_w2_w_transfer_call_api(C)
@ -168,7 +168,7 @@ create_fail_forbidden_operation_currency_test(C) ->
#'CurrencyRef'{symbolic_code = ?RUB}
]
},
create_w2_w_transfer_start_mocks(C, fun() -> throw(ForbiddenOperationCurrencyException) end),
_ = create_w2_w_transfer_start_mocks(C, fun() -> {throwing, ForbiddenOperationCurrencyException} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"Currency not allowed">>}}},
create_w2_w_transfer_call_api(C)
@ -187,7 +187,7 @@ create_fail_inconsistent_w2w_transfer_currency_test(C) ->
symbolic_code = ?RUB
}
},
create_w2_w_transfer_start_mocks(C, fun() -> throw(InconsistentW2WCurrencyException) end),
_ = create_w2_w_transfer_start_mocks(C, fun() -> {throwing, InconsistentW2WCurrencyException} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"Inconsistent currency">>}}},
create_w2_w_transfer_call_api(C)
@ -198,7 +198,7 @@ create_fail_wallet_inaccessible_test(C) ->
WalletInaccessibleException = #fistful_WalletInaccessible{
id = ?STRING
},
create_w2_w_transfer_start_mocks(C, fun() -> throw(WalletInaccessibleException) end),
_ = create_w2_w_transfer_start_mocks(C, fun() -> {throwing, WalletInaccessibleException} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"Wallet inaccessible">>}}},
create_w2_w_transfer_call_api(C)
@ -207,12 +207,12 @@ create_fail_wallet_inaccessible_test(C) ->
-spec get_ok_test(config()) -> _.
get_ok_test(C) ->
PartyID = ?config(party, C),
get_w2_w_transfer_start_mocks(C, fun() -> {ok, ?W2W_TRANSFER(PartyID)} end),
_ = get_w2_w_transfer_start_mocks(C, fun() -> {ok, ?W2W_TRANSFER(PartyID)} end),
{ok, _} = get_w2_w_transfer_call_api(C).
-spec get_fail_w2w_notfound_test(config()) -> _.
get_fail_w2w_notfound_test(C) ->
get_w2_w_transfer_start_mocks(C, fun() -> throw(#fistful_W2WNotFound{}) end),
_ = get_w2_w_transfer_start_mocks(C, fun() -> {throwing, #fistful_W2WNotFound{}} end),
?assertMatch(
{error, {404, #{}}},
get_w2_w_transfer_call_api(C)

View File

@ -315,6 +315,55 @@
]}
).
-define(STAT_DEPOSIT_REVERTS,
{deposit_reverts, [
#fistfulstat_StatDepositRevert{
id = ?STRING,
wallet_id = ?STRING,
source_id = ?STRING,
status = {succeeded, #fistfulstat_DepositRevertSucceeded{}},
body = ?CASH,
created_at = ?TIMESTAMP,
domain_revision = ?INTEGER,
party_revision = ?INTEGER,
reason = ?STRING,
external_id = ?STRING,
deposit_id = ?STRING
}
]}
).
-define(STAT_DEPOSIT_ADJUSTMENTS_WO_CANGES_PLAN,
?STAT_DEPOSIT_ADJUSTMENTS(#fistfulstat_DepositAdjustmentChangesPlan{})
).
-define(STAT_DEPOSIT_ADJUSTMENTS_WITH_CANGES_PLAN,
?STAT_DEPOSIT_ADJUSTMENTS(
#fistfulstat_DepositAdjustmentChangesPlan{
new_cash = #fistfulstat_DepositAdjustmentCashChangePlan{amount = ?CASH, fee = ?CASH, provider_fee = ?CASH},
new_status = #fistfulstat_DepositAdjustmentStatusChangePlan{
new_status = {succeeded, #fistfulstat_DepositAdjustmentStatusChangePlanSucceeded{}}
}
}
)
).
-define(STAT_DEPOSIT_ADJUSTMENTS(ChangesPlan),
{deposit_adjustments, [
#fistfulstat_StatDepositAdjustment{
id = ?STRING,
status = {succeeded, #fistfulstat_DepositAdjustmentSucceeded{}},
changes_plan = ChangesPlan,
created_at = ?TIMESTAMP,
domain_revision = ?INTEGER,
party_revision = ?INTEGER,
external_id = ?STRING,
operation_timestamp = ?TIMESTAMP,
deposit_id = ?STRING
}
]}
).
-define(IDENT_DOC,
{russian_domestic_passport, #'identdocstore_RussianDomesticPassport'{
issuer = ?STRING,

View File

@ -50,7 +50,7 @@
init([]) ->
{ok, {#{strategy => one_for_all, intensity => 1, period => 1}, []}}.
-spec all() -> [test_case_name()].
-spec all() -> [{group, test_case_name()}].
all() ->
[
{group, base}
@ -113,7 +113,7 @@ init_per_testcase(Name, C) ->
-spec end_per_testcase(test_case_name(), config()) -> config().
end_per_testcase(_Name, C) ->
ok = wapi_context:cleanup(),
wapi_ct_helper:stop_mocked_service_sup(?config(test_sup, C)),
_ = wapi_ct_helper:stop_mocked_service_sup(?config(test_sup, C)),
ok.
%%% Tests
@ -121,12 +121,12 @@ end_per_testcase(_Name, C) ->
-spec create_ok(config()) -> _.
create_ok(C) ->
PartyID = ?config(party, C),
create_wallet_start_mocks(C, fun() -> {ok, ?WALLET(PartyID)} end),
_ = create_wallet_start_mocks(C, fun() -> {ok, ?WALLET(PartyID)} end),
{ok, _} = create_wallet_call_api(C).
-spec create_fail_identity_notfound(config()) -> _.
create_fail_identity_notfound(C) ->
create_wallet_start_mocks(C, fun() -> throw(#fistful_IdentityNotFound{}) end),
_ = create_wallet_start_mocks(C, fun() -> {throwing, #fistful_IdentityNotFound{}} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"No such identity">>}}},
create_wallet_call_api(C)
@ -134,7 +134,7 @@ create_fail_identity_notfound(C) ->
-spec create_fail_currency_notfound(config()) -> _.
create_fail_currency_notfound(C) ->
create_wallet_start_mocks(C, fun() -> throw(#fistful_CurrencyNotFound{}) end),
_ = create_wallet_start_mocks(C, fun() -> {throwing, #fistful_CurrencyNotFound{}} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"Currency not supported">>}}},
create_wallet_call_api(C)
@ -142,7 +142,7 @@ create_fail_currency_notfound(C) ->
-spec create_fail_party_inaccessible(config()) -> _.
create_fail_party_inaccessible(C) ->
create_wallet_start_mocks(C, fun() -> throw(#fistful_PartyInaccessible{}) end),
_ = create_wallet_start_mocks(C, fun() -> {throwing, #fistful_PartyInaccessible{}} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"Identity inaccessible">>}}},
create_wallet_call_api(C)
@ -151,12 +151,12 @@ create_fail_party_inaccessible(C) ->
-spec get_ok(config()) -> _.
get_ok(C) ->
PartyID = ?config(party, C),
get_wallet_start_mocks(C, fun() -> {ok, ?WALLET(PartyID)} end),
_ = get_wallet_start_mocks(C, fun() -> {ok, ?WALLET(PartyID)} end),
{ok, _} = get_wallet_call_api(C).
-spec get_fail_wallet_notfound(config()) -> _.
get_fail_wallet_notfound(C) ->
get_wallet_start_mocks(C, fun() -> throw(#fistful_WalletNotFound{}) end),
_ = get_wallet_start_mocks(C, fun() -> {throwing, #fistful_WalletNotFound{}} end),
?assertEqual(
{error, {404, #{}}},
get_wallet_call_api(C)
@ -165,7 +165,7 @@ get_fail_wallet_notfound(C) ->
-spec get_by_external_id_ok(config()) -> _.
get_by_external_id_ok(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{bender_thrift, fun('GetInternalID', _) -> {ok, ?GET_INTERNAL_ID_RESULT} end},
{fistful_wallet, fun('Get', _) -> {ok, ?WALLET(PartyID)} end}
@ -185,7 +185,7 @@ get_by_external_id_ok(C) ->
-spec get_account_ok(config()) -> _.
get_account_ok(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_wallet, fun
('GetContext', _) -> {ok, ?DEFAULT_CONTEXT(PartyID)};
@ -198,10 +198,10 @@ get_account_ok(C) ->
-spec get_account_fail_get_context_wallet_notfound(config()) -> _.
get_account_fail_get_context_wallet_notfound(C) ->
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_wallet, fun
('GetContext', _) -> throw(#fistful_WalletNotFound{});
('GetContext', _) -> {throwing, #fistful_WalletNotFound{}};
('GetAccountBalance', _) -> {ok, ?ACCOUNT_BALANCE}
end}
],
@ -215,11 +215,11 @@ get_account_fail_get_context_wallet_notfound(C) ->
-spec get_account_fail_get_accountbalance_wallet_notfound(config()) -> _.
get_account_fail_get_accountbalance_wallet_notfound(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_wallet, fun
('GetContext', _) -> {ok, ?DEFAULT_CONTEXT(PartyID)};
('GetAccountBalance', _) -> throw(#fistful_WalletNotFound{})
('GetAccountBalance', _) -> {throwing, #fistful_WalletNotFound{}}
end}
],
C

View File

@ -46,7 +46,7 @@
init([]) ->
{ok, {#{strategy => one_for_all, intensity => 1, period => 1}, []}}.
-spec all() -> [test_case_name()].
-spec all() -> [{group, test_case_name()}].
all() ->
[
{group, base}
@ -104,7 +104,7 @@ init_per_testcase(Name, C) ->
-spec end_per_testcase(test_case_name(), config()) -> config().
end_per_testcase(_Name, C) ->
ok = wapi_context:cleanup(),
wapi_ct_helper:stop_mocked_service_sup(?config(test_sup, C)),
_ = wapi_ct_helper:stop_mocked_service_sup(?config(test_sup, C)),
ok.
%%% Tests
@ -112,7 +112,7 @@ end_per_testcase(_Name, C) ->
-spec create_webhook_ok_test(config()) -> _.
create_webhook_ok_test(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{webhook_manager, fun('Create', _) -> {ok, ?WEBHOOK(?DESTINATION_EVENT_FILTER)} end},
{fistful_identity, fun('GetContext', _) -> {ok, ?DEFAULT_CONTEXT(PartyID)} end},
@ -138,7 +138,7 @@ create_webhook_ok_test(C) ->
-spec create_withdrawal_webhook_ok_test(config()) -> _.
create_withdrawal_webhook_ok_test(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{webhook_manager, fun('Create', _) -> {ok, ?WEBHOOK(?WITHDRAWAL_EVENT_FILTER)} end},
{fistful_identity, fun('GetContext', _) -> {ok, ?DEFAULT_CONTEXT(PartyID)} end},
@ -166,7 +166,7 @@ create_withdrawal_webhook_ok_test(C) ->
-spec get_webhooks_ok_test(config()) -> _.
get_webhooks_ok_test(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{webhook_manager, fun('GetList', _) ->
{ok, [?WEBHOOK(?WITHDRAWAL_EVENT_FILTER), ?WEBHOOK(?DESTINATION_EVENT_FILTER)]}
@ -188,7 +188,7 @@ get_webhooks_ok_test(C) ->
-spec get_webhook_ok_test(config()) -> _.
get_webhook_ok_test(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{webhook_manager, fun('Get', _) -> {ok, ?WEBHOOK(?WITHDRAWAL_EVENT_FILTER)} end},
{fistful_identity, fun('GetContext', _) -> {ok, ?DEFAULT_CONTEXT(PartyID)} end}
@ -211,7 +211,7 @@ get_webhook_ok_test(C) ->
-spec delete_webhook_ok_test(config()) -> _.
delete_webhook_ok_test(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{webhook_manager, fun('Delete', _) -> {ok, ok} end},
{fistful_identity, fun('GetContext', _) -> {ok, ?DEFAULT_CONTEXT(PartyID)} end}

View File

@ -66,7 +66,7 @@
init([]) ->
{ok, {#{strategy => one_for_all, intensity => 1, period => 1}, []}}.
-spec all() -> [test_case_name()].
-spec all() -> [{group, test_case_name()}].
all() ->
[
{group, base}
@ -145,7 +145,7 @@ init_per_testcase(Name, C) ->
-spec end_per_testcase(test_case_name(), config()) -> config().
end_per_testcase(_Name, C) ->
ok = wapi_context:cleanup(),
wapi_ct_helper:stop_mocked_service_sup(?config(test_sup, C)),
_ = wapi_ct_helper:stop_mocked_service_sup(?config(test_sup, C)),
ok.
%%% Tests
@ -153,12 +153,12 @@ end_per_testcase(_Name, C) ->
-spec create_ok(config()) -> _.
create_ok(C) ->
PartyID = ?config(party, C),
create_withdrawal_start_mocks(C, fun() -> {ok, ?WITHDRAWAL(PartyID)} end),
_ = create_withdrawal_start_mocks(C, fun() -> {ok, ?WITHDRAWAL(PartyID)} end),
{ok, _} = create_withdrawal_call_api(C).
-spec create_fail_wallet_notfound(config()) -> _.
create_fail_wallet_notfound(C) ->
create_withdrawal_start_mocks(C, fun() -> throw(#fistful_WalletNotFound{}) end),
_ = create_withdrawal_start_mocks(C, fun() -> {throwing, #fistful_WalletNotFound{}} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"No such wallet">>}}},
create_withdrawal_call_api(C)
@ -166,7 +166,7 @@ create_fail_wallet_notfound(C) ->
-spec create_fail_destination_notfound(config()) -> _.
create_fail_destination_notfound(C) ->
create_withdrawal_start_mocks(C, fun() -> throw(#fistful_DestinationNotFound{}) end),
_ = create_withdrawal_start_mocks(C, fun() -> {throwing, #fistful_DestinationNotFound{}} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"No such destination">>}}},
create_withdrawal_call_api(C)
@ -174,7 +174,7 @@ create_fail_destination_notfound(C) ->
-spec create_fail_destination_unauthorized(config()) -> _.
create_fail_destination_unauthorized(C) ->
create_withdrawal_start_mocks(C, fun() -> throw(#fistful_DestinationUnauthorized{}) end),
_ = create_withdrawal_start_mocks(C, fun() -> {throwing, #fistful_DestinationUnauthorized{}} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"Destination unauthorized">>}}},
create_withdrawal_call_api(C)
@ -188,7 +188,7 @@ create_fail_forbidden_operation_currency(C) ->
#'CurrencyRef'{symbolic_code = ?RUB}
]
},
create_withdrawal_start_mocks(C, fun() -> throw(ForbiddenOperationCurrencyException) end),
_ = create_withdrawal_start_mocks(C, fun() -> {throwing, ForbiddenOperationCurrencyException} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"Forbidden currency">>}}},
create_withdrawal_call_api(C)
@ -203,7 +203,7 @@ create_fail_forbidden_operation_amount(C) ->
lower = {inclusive, ?CASH}
}
},
create_withdrawal_start_mocks(C, fun() -> throw(ForbiddenOperationAmountException) end),
_ = create_withdrawal_start_mocks(C, fun() -> {throwing, ForbiddenOperationAmountException} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"Invalid cash amount">>}}},
create_withdrawal_call_api(C)
@ -214,7 +214,7 @@ create_fail_invalid_operation_amount(C) ->
InvalidOperationAmountException = #fistful_InvalidOperationAmount{
amount = ?CASH
},
create_withdrawal_start_mocks(C, fun() -> throw(InvalidOperationAmountException) end),
_ = create_withdrawal_start_mocks(C, fun() -> {throwing, InvalidOperationAmountException} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"Invalid cash amount">>}}},
create_withdrawal_call_api(C)
@ -233,7 +233,7 @@ create_fail_inconsistent_withdrawal_currency(C) ->
symbolic_code = ?RUB
}
},
create_withdrawal_start_mocks(C, fun() -> throw(InconsistentWithdrawalCurrencyException) end),
_ = create_withdrawal_start_mocks(C, fun() -> {throwing, InconsistentWithdrawalCurrencyException} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"Invalid currency">>}}},
create_withdrawal_call_api(C)
@ -241,7 +241,7 @@ create_fail_inconsistent_withdrawal_currency(C) ->
-spec create_fail_no_destination_resource_info(config()) -> _.
create_fail_no_destination_resource_info(C) ->
create_withdrawal_start_mocks(C, fun() -> throw(#wthd_NoDestinationResourceInfo{}) end),
_ = create_withdrawal_start_mocks(C, fun() -> {throwing, #wthd_NoDestinationResourceInfo{}} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"Unknown card issuer">>}}},
create_withdrawal_call_api(C)
@ -253,7 +253,7 @@ create_fail_identity_providers_mismatch(C) ->
wallet_provider = ?INTEGER,
destination_provider = ?INTEGER
},
create_withdrawal_start_mocks(C, fun() -> throw(IdentityProviderMismatchException) end),
_ = create_withdrawal_start_mocks(C, fun() -> {throwing, IdentityProviderMismatchException} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"This wallet and destination cannot be used together">>}}},
create_withdrawal_call_api(C)
@ -264,7 +264,7 @@ create_fail_wallet_inaccessible(C) ->
WalletInaccessibleException = #fistful_WalletInaccessible{
id = ?STRING
},
create_withdrawal_start_mocks(C, fun() -> throw(WalletInaccessibleException) end),
_ = create_withdrawal_start_mocks(C, fun() -> {throwing, WalletInaccessibleException} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"Wallet inaccessible">>}}},
create_withdrawal_call_api(C)
@ -273,7 +273,7 @@ create_fail_wallet_inaccessible(C) ->
-spec get_ok(config()) -> _.
get_ok(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_withdrawal, fun('Get', _) -> {ok, ?WITHDRAWAL(PartyID)} end}
],
@ -291,9 +291,9 @@ get_ok(C) ->
-spec get_fail_withdrawal_notfound(config()) -> _.
get_fail_withdrawal_notfound(C) ->
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{fistful_withdrawal, fun('Get', _) -> throw(#fistful_WithdrawalNotFound{}) end}
{fistful_withdrawal, fun('Get', _) -> {throwing, #fistful_WithdrawalNotFound{}} end}
],
C
),
@ -313,7 +313,7 @@ get_fail_withdrawal_notfound(C) ->
-spec get_by_external_id_ok(config()) -> _.
get_by_external_id_ok(C) ->
PartyID = ?config(party, C),
wapi_ct_helper:mock_services(
_ = wapi_ct_helper:mock_services(
[
{bender_thrift, fun('GetInternalID', _) -> {ok, ?GET_INTERNAL_ID_RESULT} end},
{fistful_withdrawal, fun('Get', _) -> {ok, ?WITHDRAWAL(PartyID)} end}
@ -332,12 +332,12 @@ get_by_external_id_ok(C) ->
-spec create_quote_ok(config()) -> _.
create_quote_ok(C) ->
get_quote_start_mocks(C, fun() -> {ok, ?WITHDRAWAL_QUOTE} end),
_ = get_quote_start_mocks(C, fun() -> {ok, ?WITHDRAWAL_QUOTE} end),
{ok, _} = create_qoute_call_api(C).
-spec get_quote_fail_wallet_notfound(config()) -> _.
get_quote_fail_wallet_notfound(C) ->
get_quote_start_mocks(C, fun() -> throw(#fistful_WalletNotFound{}) end),
_ = get_quote_start_mocks(C, fun() -> {throwing, #fistful_WalletNotFound{}} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"No such wallet">>}}},
create_qoute_call_api(C)
@ -345,7 +345,7 @@ get_quote_fail_wallet_notfound(C) ->
-spec get_quote_fail_destination_notfound(config()) -> _.
get_quote_fail_destination_notfound(C) ->
get_quote_start_mocks(C, fun() -> throw(#fistful_DestinationNotFound{}) end),
_ = get_quote_start_mocks(C, fun() -> {throwing, #fistful_DestinationNotFound{}} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"No such destination">>}}},
create_qoute_call_api(C)
@ -353,7 +353,7 @@ get_quote_fail_destination_notfound(C) ->
-spec get_quote_fail_destination_unauthorized(config()) -> _.
get_quote_fail_destination_unauthorized(C) ->
get_quote_start_mocks(C, fun() -> throw(#fistful_DestinationUnauthorized{}) end),
_ = get_quote_start_mocks(C, fun() -> {throwing, #fistful_DestinationUnauthorized{}} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"Destination unauthorized">>}}},
create_qoute_call_api(C)
@ -367,7 +367,7 @@ get_quote_fail_forbidden_operation_currency(C) ->
#'CurrencyRef'{symbolic_code = ?RUB}
]
},
get_quote_start_mocks(C, fun() -> throw(ForbiddenOperationCurrencyException) end),
_ = get_quote_start_mocks(C, fun() -> {throwing, ForbiddenOperationCurrencyException} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"Forbidden currency">>}}},
create_qoute_call_api(C)
@ -382,7 +382,7 @@ get_quote_fail_forbidden_operation_amount(C) ->
lower = {inclusive, ?CASH}
}
},
get_quote_start_mocks(C, fun() -> throw(ForbiddenOperationAmountException) end),
_ = get_quote_start_mocks(C, fun() -> {throwing, ForbiddenOperationAmountException} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"Invalid cash amount">>}}},
create_qoute_call_api(C)
@ -393,7 +393,7 @@ get_quote_fail_invalid_operation_amount(C) ->
InvalidOperationAmountException = #fistful_InvalidOperationAmount{
amount = ?CASH
},
get_quote_start_mocks(C, fun() -> throw(InvalidOperationAmountException) end),
_ = get_quote_start_mocks(C, fun() -> {throwing, InvalidOperationAmountException} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"Invalid cash amount">>}}},
create_qoute_call_api(C)
@ -412,7 +412,7 @@ get_quote_fail_inconsistent_withdrawal_currency(C) ->
symbolic_code = ?RUB
}
},
get_quote_start_mocks(C, fun() -> throw(InconsistentWithdrawalCurrencyException) end),
_ = get_quote_start_mocks(C, fun() -> {throwing, InconsistentWithdrawalCurrencyException} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"Invalid currency">>}}},
create_qoute_call_api(C)
@ -424,7 +424,7 @@ get_quote_fail_identity_provider_mismatch(C) ->
wallet_provider = ?INTEGER,
destination_provider = ?INTEGER
},
get_quote_start_mocks(C, fun() -> throw(IdentityProviderMismatchException) end),
_ = get_quote_start_mocks(C, fun() -> {throwing, IdentityProviderMismatchException} end),
?assertEqual(
{error, {422, #{<<"message">> => <<"This wallet and destination cannot be used together">>}}},
create_qoute_call_api(C)
@ -432,7 +432,7 @@ get_quote_fail_identity_provider_mismatch(C) ->
-spec get_event_ok(config()) -> _.
get_event_ok(C) ->
get_events_start_mocks(C, fun() -> {ok, []} end),
_ = get_events_start_mocks(C, fun() -> {ok, []} end),
{ok, _} = call_api(
fun swag_client_wallet_withdrawals_api:get_withdrawal_events/3,
#{
@ -446,7 +446,7 @@ get_event_ok(C) ->
-spec get_events_ok(config()) -> _.
get_events_ok(C) ->
get_events_start_mocks(C, fun() -> {ok, []} end),
_ = get_events_start_mocks(C, fun() -> {ok, []} end),
{ok, _} = call_api(
fun swag_client_wallet_withdrawals_api:poll_withdrawal_events/3,
#{
@ -462,7 +462,7 @@ get_events_ok(C) ->
-spec get_events_fail_withdrawal_notfound(config()) -> _.
get_events_fail_withdrawal_notfound(C) ->
get_events_start_mocks(C, fun() -> throw(#fistful_WithdrawalNotFound{}) end),
_ = get_events_start_mocks(C, fun() -> {throwing, #fistful_WithdrawalNotFound{}} end),
?assertEqual(
{error, {404, #{}}},
call_api(

View File

@ -1,7 +0,0 @@
{
"protected": "eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjdHkiOiJqd2sranNvbiIsImVuYyI6IkEyNTZHQ00iLCJwMmMiOjEwMDAwMCwicDJzIjoiWlhxWUtkN0VvNWwxR29TYU9uRERJdyJ9",
"encrypted_key": "uUC1-fWxYidjoM1vNsvkexPtrSj_QM-175HsORLjaRu4g5yrW8ZIsg",
"iv": "qq5xat9mMtcg_wRU",
"ciphertext": "_kzb1lXyDZMhWcrj8BNsfKAB_XkSHJ0oCpahcCvW2Lp7G_A6YUumsHW_-IwQ3k6TX3KwP5GvaNeLvFOH_LkJOF4RUYhDSKmR1dOSqMBF9Jg_GjNViETyOB1FIAV5gX-LajJ7EkNC5WrAtdjiidO7JrkjgCvEq3QWuUfRp39JYFRzMMrwbfmDys-Uub9mLmNvrv7COUqLr1DWzjEjNJueUyXxZFo2-UxuSYmLmyUvqQfz_KkWPtx8htvrY0d5ks52uYCUnm1iQ35S0xaGQ1mTsTx-6K30jUcOR5hdfUx__F4CRYI3b6ukJ71sAZjEziXWnTYWBuW4fYQ8g10lt95wYOutF1jp1cSAXdYwgSg4sfSCCApmnuhc8QSn902ZN85R6nOlLzmLr1RBpSaAzxisHb7kLwPsPdLsLFSM3zs1mcTxb9Ej-jYEp7rB3Uk2Z9dBmoZbFy6ZTVR_q2zgxAPLkMrOda1Kq2iW8o8lgAHlXRCDmMw1Q-iz3A7FL6f34iOAWuuoE2kim14v5p_2D5bOooNGi_-Ecg42-xryvUxHXZE9VMnX4OE2YLgqDT-T9scv6DXrZO4HEmnxKePvqCqIc-3N9tuCzscf0YAQsOauN0ETkV9uwZKguONVfCCDTPCiYFxFJ6-i1IcKZXUB8iZ59W0IRsJ871bqqm6wWJVVmQZcMouXazdIGz7UA0xaiiySGp8S6Jt90QN1YjQyTj8RHZMcvXdZ8QVcg3MjfbPeZr_hmzETGGbq-XrqJPWL8M9pq-skhZpIGOyUl-IcylbJD_Ayk5VLVUVFmuSamvqZgtOxlf4yiC2Tu6P4T7wkjDkcFS9F2MwQefj9SSoGJhkSaxHj3twQqrjdtDX6LF822lj_QM3PHHyTSrznha_h5fNZv9TUBDQdUAluY5vn4iVSx22AHDg_QcGAUJgUboEQAdtvQzEzow_0Ch0YbREtaDkJAgMjOPBFUQgqx2v70DE1bvuOfvvHi0stl9uj-pIfypYLRrpdQgEg_KiXTqHOXEOroaWcSG-9R4S7OkrZAey1NwbUDnXNdFHwGXXtWceSczFZs9ehThrcl32Y3ubINwHjxYR3fMMiCG2d91eIgym5tNNdxLi9HJu8tT5Rx8w7CdnXFV7ukG_OjgpMxt15M8op91SR9lCAE8RfQMnhkwYRyg23893GJ1fvW2frTG3asMjZhFtjPm8AU8QxTQdZCk62LYskqXACMR_LG_1s8bZqIr4byMyxc2mDiYRHO6LVJpKcJN2R26ht2OoPE9-wt_RCHNa7VB6R_PtCeZQAbrCRMhMau-zKWnKyT7BZrZjHXogqa7u0Q0uL1ttRrzhW9vwmAaSUU5ZCSRAhAXPUfgYG16i2u2FcVSYqhrE4cwxqlYZ0xAZ6pDuQBtG752J9lPS8Ae9W1Ab4RXJtVjG8Q8P9twZ_LDYt4Est9yzjkw6f_s5n5-LcHHMX8-nqC-j3eca_RFa_h_1rWef_Hyem4EDzKkd7kN8mlIt65hA3lzR9w5FegB3AcVKpkrOa2c6EH7z_1fVzFej14-d7Kp6SJIvaL1Pgs9YposYBn2mpEaepFFnRZ2n5UQ-3po8ePT-eJsOOeglm8zwzxcDWPYBY48Y91CVnZws29lNUoj_IhJpDrYj1hh0ksBea_NeG8xJxdTTaIOFwd7H74WgO_S24743_jKhF7Or9Gd-TCVZKJGu46m8Iv2nHEcim-99r8-Zp2NJriLtvUS8CqFxkbsrMOtMg1RiYYqwYJqkmhXVDCUMr_CAE_L3VO3owB0w8kGIxup5kDVg5MMLVuR4K9tDK2fy1sPgd05sqoc0Hz7iWLngr7SYUfFSfVEk8bl7Am6yVz7-dhER6RQ2zlDfUFkeleqnjYR7F-u6sFUf5BKuohzBWFritZWhi7pRYHJb09VZdz1v6zbNErYkskMMHu0bjrGJVcirXsYVzdv876YJXllNk9e3BV2C-pUBMcwEhabby0i5TWlTU-IV9Sf-WV5vVf8ToUo7EdtcrmGzfZE8x6y1aJ02vxej5aajnbCTWG3b-1AOBDwPJG-6M-zmWZvaY4k3f7jUeYR2xhUavYJVfyF5Wq5YhtFTlIFggoyN9XGXkRpETXRPnRVgggkFthjmQ2AcKffCZC-319RUc3uwZ_Cgs_cJjoSOHVCSBTEGDKJ61FwCuqciiZGSgq7KO6-KrDY8ift-yKnBglYRKGnJ0SWxdQ7UVeJ8W4cVKrt0gNVpX0o5GC32Q1aH5c4GKAea_RCTMXbvMhskSEK07A__qqKCAg2LOypPTOu7zNMSQckrRSemwcrXCexYnCVuf0lKPp8dyYWF5uQZUp3SLwLP_tVxZ-nBXFtmvFWNo9fuSuQLPr1DIRVWsYemqSfZBDZxWFq771JXvvD9CUbt9HAXNC-zlqYkLngDxwn02VThFv9t1HKWJUftANPu2EcLExwy9pKIv2Ti9IRXpvAefYHBN6BsY6_h4v05UMD1t46jqIHsm7B-1PuNDEta5KxUU5tc6rXeY2N9V_NObKRb7YzHzCFQ0Mb-Io40CGiOhc3Gy3cr86abENLpJNmYfEdKpYhb-8O52LJcJAroehgTPb_RwNBwvmI5QoXp5EicnbX2p2xwKuRiVsgGxiKx4d7oz4sDAnzZ_X2lCPjXqGefJIvGPeQcaHIj5SudeM-7rIxkE-A_xO1Isxj_EnUs6Oy4ipUFpflGGsu1ryHAfgnFCPbRntxQIgFijvJqxhm07lonK9pZITFXQRH26goypiECjsIpvDBVNzO8jenqym6DJS-Uhz_vz2j9kOF99JyDY3fJvx1FQvqrlkXn6-XDdnO8FQ6nAT70x4DMDrYm5P9iHX5RZBLbcTFbfIuasR-RVeL6r2wzu2votorW-Y-6HYOG830Py6RLMeTaR5rb9vxBc_eh9HeyM_l_QGTy8-xSPoJUk-hK7iMBSDvdIWxcWCitU6mYCM8GvFVVqmZo2UEeTfqLZ_-v7g_LzNdCQ6gvENSVQSPh2vHZ8RUA10LYLrBTIu47uSwwNheGzyL-MTrPrKQpj1sUDm91H4wj6VvxYCpfsx9Z-5h7zOM43v5z9_XSK_dPopWzzbN2Ez2rKdfgEGk7FwNZO4rNUPHI496pclLoCgkuhPJwl7YzqWWyrVYm4o1GtloAbgYpFe80qKj-jsUn9GGcsGu_pHs_LAKkyzu0BE3XlC3Y-v9cibU-97ujNEshZhS5i4mVKN_R5-W3WsVI7DIGudDxydtuGpM6Dd0V1usClB7FjT31NG5xbPHl3AZQEpmSFlf79nqC2hzjXPlX3arpkqj6mpisAdtWKgnNjo4yDdCHAej-bTa1CmU-18gOtX4-Q912eHvrSNAAfaUrPB4Kgnhk28X8-cwe4LNEhHr5GStRF_5mRueC_YWjqAMpCMMPoUyXpkCyPe0_zTc9LvFqPosmowhuzDp7MVcj-D9U6GKCBwke4o2x14mG-UZzACD56po2d6H5JqJdKRdn27f6ZyGDtmwGQO5x2sYgVMMcXGpyYzbvv3hH4orJDogorh0oxqVmCpkU6OLuoBqFlsV9nSA1vfctI7GnHug-OtdUSYg7jHnM5UlCgL5xomf88dHL7yn9980hjKiFrU4Gd43vmTEx3kwWJdZlYna55dN147NXPrngkQ4VeTht0xQQyEqSIUe9WEIS83do4SnmeWAWaKRr_4vQVqbBvUiJazbPIJuCipeCBNho3xl1NI5VV0NqWVeUnEyVr40HMfvlh9W42q6apOkTwF27a8a3jOcz8aFHyYXX1qyrSIkMCdKCtmZVMdmvtXVKdIwIBxZn9vsftJg77Fw0K7rnAQhRNuf6ZG78e9JicKADW65SRT-nNDekjYeTV-0-v1OFaJUpkxYn2VOdA-W9zqq84oTlIiG3Ul4wH-GyNplecEQkrTwGq3vmVND0EDlb0dLG8bE91uHgimTz3Z2SK1yYhUrG3GzYOIyxLDt6cjme6i5m0ThQCupxCK6_CH_2-u3BtfMaiM-i6y-e9x81M7wYBkzoEYZtJViqa_P6hDr5Eqc24ykkZ7kw53fS2iAcmhDFRk6dUkA_7fhon5kYcZkMPru1PBV_YTXlujf13kwgr2VIs-eYh0RfI452L4XUHknTOJ0syH1esUPgxDDy7u4OLeFo6S-k7z1kks6suS0A7S3ipgjSktwW2fxlZpXrucnj8Z_9XcclPsXdjLfn4y9t0_li3qdHODfYKbtZZo66WV1qZ4cgCOze5QQe0gjQghVmOt55Socw3m0ZuDsX7J9KUi55ejb-Iemqd65G_TnzWt9KRvvOeZkrRf5pZ97m4",
"tag": "sroFBm6AGteC4xKLTztiwQ"
}

View File

@ -1,10 +0,0 @@
{
"use": "enc",
"kty": "EC",
"kid": "kxdD0orVPGoAxWrqAMTeQ0U5MRoK47uZxWiSJdgo0t0",
"crv": "P-256",
"alg": "ECDH-ES",
"x": "nHi7TCgBwfrPuNTf49bGvJMczk6WZOI-mCKAghbrOlM",
"y": "_8kiXGOIWkfz57m8K5dmTfbYzCJVYHZZZisCfbYicr0",
"d": "i45qDiARZ5qbS_uzeT-CiKnPUe64qHitKaVdAvcN6TI"
}

View File

@ -1,9 +0,0 @@
{
"use": "enc",
"kty": "EC",
"kid": "kxdD0orVPGoAxWrqAMTeQ0U5MRoK47uZxWiSJdgo0t0",
"crv": "P-256",
"alg": "ECDH-ES",
"x": "nHi7TCgBwfrPuNTf49bGvJMczk6WZOI-mCKAghbrOlM",
"y": "_8kiXGOIWkfz57m8K5dmTfbYzCJVYHZZZisCfbYicr0"
}

View File

@ -1,27 +0,0 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEA4MUtYkvoIAHNgvYtHSydanyY1qD8nJ+D/A1FFp5LF4SmM9nn
vSfTFC2T3D53sCR/DtUzCFIQwZIXXHob22ndFydZqhahrYLLJkpH5IXMy593Sho/
oXzxgwkbXaOMevcLFZcj5AneG+q2vFjaDGeQAJaAAPGinMo6UN94DYguNH2s6zqo
yRc8ng6KWD5UgEFTIEWni1RIZvp2NAnSkh/SeI1zs9uY6AR7bf6oFSChTd9m+li5
d20L5tc0aX7LG842SJEM2dJKckI4ZDZHvU6nDitH3TGrxkMa0CqLe7nUOfvSff2c
H9m0CzSbPy/SnyTQLklWoFsi9z2cqqtY6SvR7QIDAQABAoIBADAoz1KSZQgGmtwG
lx/7ITdhvvWtxLJiU0s8JKN2Ayzk1R+i/s4+rDFUmqvEDq0FBNxOvgJ4YvK2tJ6x
4yoeAqslWUbiVn3w2ko3/DNwn7K5VjvgZ+XX+X9UAjMMCduG9y8HFT+VBawBnGm6
t+2UevxFQuPw4iCqC9isKPLtTMkeBXfaCA+tzBqVytlBeW5nJG1Bh9GSV6OeeNoc
x6lh1X+7kxk/qLQZsogNwZXxPLuIK0qJCfsGzMYodSi43nv2mFtl5vBt0M+iU42i
KrL32SlQmkBI4st/HIie9YpSjj55llOU6L0KBPhH58wc8LDEc2Kwcxeow4/McO0E
fSwf9pkCgYEA+4v+371szXbUTfOBOBO7+bGbTo0gzJ8JnMaSdVDLhBaqyp5dbztS
TPiaCqfEYk4AYnl2dR7nLYRca/WRDle7hvDqB7K2RWWS58RDifiQ4gfJM9lW4Ocu
SIhnxVmr4iVdo4eOs6pxe8yRtF1U+uK8WuoV06+lgL/esEJB2JPyeQsCgYEA5L/U
osQFOogSk1Ycjl66UEXm0Y2HzFONTKMSellUnkdSSscx6+mLOn7eL5voSNSJrnCw
Tfh3uZ0NOh63Yw3aPGCwtn+EIflW1hzx+DJMvCS5TaU3BZF954rljklJL6VpaIPP
fXrc0z1FcsAT2s3aQNmEK2SWp7Y44V6mpQn7a+cCgYEA0Tf+dD+MOFRmfrNSvb6E
MUkMwMfXCPoaN6BdfmAF9cYYpdAULIjtigGXtdcWGyF/ZmhaI03hv9UAPfcQgBpu
ae0E6gQ1YAD8r/Jorl/kuWr6aTqS7Rq7Py7dCKLtuHmVqYb9JOhV3T8nzRl3rfhZ
61AZeWj1QeHUKUvikm1zVkMCgYEAyan42xn3BhgKUEw9VqJanQRTLnEYxGDwlBy7
4JM6j2OPQA+GilXVgddxKAXJ7dM6IkiElei0HDZB//gucqw2tr4DbJDUu2LnVFIm
XEpz7fZuSu6ZqFYQ6n1ATYV8eP3aBOMXnKchYTWGMVj26BJNFJju9ZZzXx293aol
PiCjwAcCgYAmOtRZRtf/p1eXPz1JN1OwEVSrnghJP5KBA8XGsnBmQUTeMmHo3Wl7
rELKg0O2bsPtTTAvm5bfLsRgvee+EY28mAY6MA8xJNHB6OabOHuRHqX7ow/LOagK
15mUtZ9f8AaKamZ3Bmg/XWWJxNmeCt5LJDr1OnmCDyItbfF9DxnXXg==
-----END RSA PRIVATE KEY-----

View File

@ -1,7 +0,0 @@
{
"crv": "Ed25519",
"d": "YwuzCqcMjGrIf23jJNJgtjFl13sZ2OpYGSpRR_HPzN0",
"kid": "K3ZpHNJw3IZYu4fefhImUtB47eSBD4nRmpjWIoGukyg",
"kty": "OKP",
"x": "hqoiLZvfBzgtFQop3mBzUACee1ycgaT3tJIcKQ2Ndjc"
}

View File

@ -35,13 +35,14 @@
-type thrift_type_ref() :: {module(), Name :: atom()}.
-type thrift_struct_def() :: list({
Tag :: pos_integer(),
Requireness :: required | optional | undefined,
Type :: thrift_struct_type(),
Name :: atom(),
Default :: any()
}).
-type thrift_struct_def() ::
list({
Tag :: pos_integer(),
Requireness :: required | optional | undefined,
Type :: thrift_struct_type(),
Name :: atom(),
Default :: any()
}).
serialize(Type, Data) ->
{ok, Trans} = thrift_membuffer_transport:new(),

@ -1 +1 @@
Subproject commit e1318727d4d0c3e48f5122bf3197158b6695f50e
Subproject commit 24aa772730be966667adb285a09fcb494d4f218e

View File

@ -2,46 +2,40 @@
{elvis, [
{config, [
#{
dirs => ["apps/*/src"],
dirs => ["apps/*/**"],
filter => "*.erl",
ignore => ["_thrift.erl$", "src/swag_server*", "src/swag_client*"],
ignore => ["apps/swag_.*", ".+_SUITE.erl"],
rules => [
{elvis_style, line_length, #{limit => 120, skip_comments => false}},
{elvis_style, no_tabs},
{elvis_style, no_trailing_whitespace},
{elvis_text_style, line_length, #{limit => 120, skip_comments => false}},
{elvis_text_style, no_tabs},
{elvis_text_style, no_trailing_whitespace},
{elvis_style, macro_module_names},
{elvis_style, operator_spaces, #{rules => [{right, ","}, {right, "++"}, {left, "++"}]}},
{elvis_style, nesting_level, #{level => 3}},
{elvis_style, god_modules, #{limit => 35, ignore => [wapi_wallet_ff_backend]}},
{elvis_style, god_modules, #{limit => 30, ignore => [wapi_wallet_ff_backend]}},
{elvis_style, no_if_expression},
{elvis_style, invalid_dynamic_call, #{ignore => [wapi_swagger_server, wapi_stream_h]}},
{elvis_style, invalid_dynamic_call, #{ignore => [ff_ct_provider_handler]}},
{elvis_style, used_ignored_variable},
{elvis_style, no_behavior_info},
{elvis_style, module_naming_convention, #{regex => "^([a-z][a-z0-9]*_?)*(_SUITE)?$"}},
{elvis_style, function_naming_convention, #{regex => "^([a-z][a-z0-9]*_?)*$"}},
{elvis_style, state_record_and_type},
{elvis_style, module_naming_convention, #{regex => "^[a-z]([a-z0-9]*_?)*(_SUITE)?$"}},
{elvis_style, function_naming_convention, #{regex => "^[a-z]([a-z0-9]*_?)*$"}},
{elvis_style, state_record_and_type, #{ignore => [machinery_gensrv_backend]}},
{elvis_style, no_spec_with_records},
{elvis_style, dont_repeat_yourself, #{min_complexity => 15}},
{elvis_style, no_debug_call, #{ignore => [elvis, elvis_utils]}}
]
},
#{
dirs => ["apps/*/test"],
filter => "*.erl",
rules => [
{elvis_style, line_length, #{limit => 120, skip_comments => false}},
{elvis_style, no_tabs},
{elvis_style, no_trailing_whitespace},
{elvis_style, macro_module_names},
{elvis_style, operator_spaces, #{rules => [{right, ","}, {right, "++"}, {left, "++"}]}},
{elvis_style, nesting_level, #{level => 3}},
{elvis_style, no_if_expression},
{elvis_style, used_ignored_variable},
{elvis_style, no_behavior_info},
{elvis_style, module_naming_convention, #{regex => "^([a-z][a-z0-9]*_?)*(_SUITE)?$"}},
{elvis_style, function_naming_convention, #{regex => "^([a-z][a-z0-9]*_?)*$"}},
{elvis_style, no_spec_with_records},
{elvis_style, dont_repeat_yourself, #{min_complexity => 30}}
{elvis_style, dont_repeat_yourself, #{
min_complexity => 32,
ignore => [
ff_source_machinery_schema,
ff_deposit_machinery_schema,
ff_destination_machinery_schema,
ff_identity_machinery_schema,
ff_p2p_session_machinery_schema,
ff_p2p_transfer_machinery_schema,
ff_wallet_machinery_schema,
ff_withdrawal_machinery_schema,
ff_withdrawal_session_machinery_schema
]
}},
{elvis_style, no_debug_call, #{}}
]
},
#{
@ -55,32 +49,23 @@
ruleset => elvis_config
},
#{
dirs => ["apps", "apps/*"],
ignore => ["swag_server*", "swag_client*"],
dirs => [".", "apps/*/*"],
filter => "rebar.config",
ignore => ["apps/swag_*"],
rules => [
{elvis_style, line_length, #{limit => 120, skip_comments => false}},
{elvis_style, no_tabs},
{elvis_style, no_trailing_whitespace}
{elvis_text_style, line_length, #{limit => 120, skip_comments => false}},
{elvis_text_style, no_tabs},
{elvis_text_style, no_trailing_whitespace}
]
},
#{
dirs => ["."],
filter => "rebar.config",
rules => [
{elvis_style, line_length, #{limit => 120, skip_comments => false}},
{elvis_style, no_tabs},
{elvis_style, no_trailing_whitespace}
]
},
#{
dirs => ["apps/*/src"],
dirs => ["apps/**"],
filter => "*.app.src",
ignore => ["src/swag_server*", "src/swag_client*"],
ignore => ["apps/swag_*"],
rules => [
{elvis_style, line_length, #{limit => 120, skip_comments => false}},
{elvis_style, no_tabs},
{elvis_style, no_trailing_whitespace}
{elvis_text_style, line_length, #{limit => 120, skip_comments => false}},
{elvis_text_style, no_tabs},
{elvis_text_style, no_trailing_whitespace}
]
}
]}

View File

@ -34,9 +34,9 @@
{woody, {git, "https://github.com/rbkmoney/woody_erlang.git", {branch, "master"}}},
{erl_health, {git, "https://github.com/rbkmoney/erlang-health.git", {branch, "master"}}},
{cowboy, "2.7.0"},
{jose, "1.10.1"},
{jose, "1.11.1"},
{base64url, "0.0.1"},
{jsx, "2.9.0"},
{jsx, "3.0.0"},
{prometheus, "4.6.0"},
{prometheus_cowboy, "0.1.8"},
{damsel, {git, "git@github.com:rbkmoney/damsel.git", {branch, "release/erlang/master"}}},
@ -108,7 +108,8 @@
swag_client_payres,
swag_client_wallet,
swag_server_wallet
]}
]},
{dialyzer, [{plt_extra_apps, [eunit, common_test, meck]}]}
]}
]}.

View File

@ -1,4 +1,4 @@
{"1.1.0",
{"1.2.0",
[{<<"accept">>,{pkg,<<"accept">>,<<"0.3.5">>},2},
{<<"base64url">>,{pkg,<<"base64url">>,<<"0.0.1">>},0},
{<<"bear">>,{pkg,<<"bear">>,<<"0.8.7">>},3},
@ -7,8 +7,8 @@
{ref,"3c1489a397dacd1e613b777834ab511023afad36"}},
0},
{<<"bender_proto">>,
{git,"git@github.com:rbkmoney/bender-proto.git",
{ref,"0d5813b8a25c8d03e4e59e42aa5f4e9b785a3849"}},
{git,"https://github.com/rbkmoney/bender-proto.git",
{ref,"dfe271b09a2b8e457f50e4732b905a0b846bf529"}},
0},
{<<"cache">>,{pkg,<<"cache">>,<<"2.3.3">>},1},
{<<"certifi">>,{pkg,<<"certifi">>,<<"2.5.1">>},1},
@ -26,7 +26,7 @@
{ref,"5a3b084fb8c5a4ff58e3c915a822d709d6023c3b"}},
0},
{<<"cowboy_draining_server">>,
{git,"git@github.com:rbkmoney/cowboy_draining_server.git",
{git,"https://github.com/rbkmoney/cowboy_draining_server.git",
{ref,"186cf4d0722d4ad79afe73d371df6b1371e51905"}},
0},
{<<"cowlib">>,{pkg,<<"cowlib">>,<<"2.8.0">>},1},
@ -45,11 +45,11 @@
0},
{<<"fistful_proto">>,
{git,"git@github.com:rbkmoney/fistful-proto.git",
{ref,"03f620b54774f251a05ccab93146a425775ec018"}},
{ref,"055dc8578b054b895117b469e9708caf996f6bb8"}},
0},
{<<"fistful_reporter_proto">>,
{git,"git@github.com:rbkmoney/fistful-reporter-proto.git",
{ref,"8bec5e6c08c8b43ba606a62fa65d164b07d3de96"}},
{git,"https://github.com/rbkmoney/fistful-reporter-proto.git",
{ref,"3a2155ca864e81979af6eb3211a465eb1e59aa46"}},
0},
{<<"folsom">>,
{git,"https://github.com/folsom-project/folsom.git",
@ -76,9 +76,9 @@
{<<"idna">>,{pkg,<<"idna">>,<<"6.0.0">>},1},
{<<"jesse">>,
{git,"https://github.com/rbkmoney/jesse.git",
{ref,"a21da0609e446f328c01b1a72191cda26a8969a4"}},
{ref,"9b980b7f9ce09b6a136fe5a23d404d1b903f3061"}},
0},
{<<"jose">>,{pkg,<<"jose">>,<<"1.10.1">>},0},
{<<"jose">>,{pkg,<<"jose">>,<<"1.11.1">>},0},
{<<"jsx">>,{pkg,<<"jsx">>,<<"2.9.0">>},0},
{<<"lechiffre">>,
{git,"git@github.com:rbkmoney/lechiffre.git",
@ -112,7 +112,7 @@
0},
{<<"snowflake">>,
{git,"https://github.com/rbkmoney/snowflake.git",
{ref,"7f379ad5e389e1c96389a8d60bae8117965d6a6d"}},
{ref,"de159486ef40cec67074afe71882bdc7f7deab72"}},
1},
{<<"ssl_verify_fun">>,{pkg,<<"ssl_verify_fun">>,<<"1.1.4">>},1},
{<<"thrift">>,
@ -145,7 +145,7 @@
{<<"gproc">>, <<"CEA02C578589C61E5341FCE149EA36CCEF236CC2ECAC8691FBA408E7EA77EC2F">>},
{<<"hackney">>, <<"9F8F471C844B8CE395F7B6D8398139E26DDCA9EBC171A8B91342EE15A19963F4">>},
{<<"idna">>, <<"689C46CBCDF3524C44D5F3DDE8001F364CD7608A99556D8FBD8239A5798D4C10">>},
{<<"jose">>, <<"16D8E460DAE7203C6D1EFA3F277E25B5AF8B659FEBFC2F2EB4BACF87F128B80A">>},
{<<"jose">>, <<"59DA64010C69AAD6CDE2F5B9248B896B84472E99BD18F246085B7B9FE435DCDB">>},
{<<"jsx">>, <<"D2F6E5F069C00266CAD52FB15D87C428579EA4D7D73A33669E12679E203329DD">>},
{<<"metrics">>, <<"25F094DEA2CDA98213CECC3AEFF09E940299D950904393B2A29D191C346A8486">>},
{<<"mimerl">>, <<"67E2D3F571088D5CFD3E550C383094B47159F3EEE8FFA08E64106CDF5E981BE3">>},
@ -154,5 +154,27 @@
{<<"prometheus_httpd">>, <<"F616ED9B85B536B195D94104063025A91F904A4CFC20255363F49A197D96C896">>},
{<<"ranch">>, <<"6B1FAB51B49196860B733A49C07604465A47BDB78AA10C1C16A3D199F7F8C881">>},
{<<"ssl_verify_fun">>, <<"F0EAFFF810D2041E93F915EF59899C923F4568F4585904D010387ED74988E77B">>},
{<<"unicode_util_compat">>, <<"D869E4C68901DD9531385BB0C8C40444EBF624E60B6962D95952775CAC5E90CD">>}]}
{<<"unicode_util_compat">>, <<"D869E4C68901DD9531385BB0C8C40444EBF624E60B6962D95952775CAC5E90CD">>}]},
{pkg_hash_ext,[
{<<"accept">>, <<"11B18C220BCC2EAB63B5470C038EF10EB6783BCB1FCDB11AA4137DEFA5AC1BB8">>},
{<<"base64url">>, <<"FAB09B20E3F5DB886725544CBCF875B8E73EC93363954EB8A1A9ED834AA8C1F9">>},
{<<"bear">>, <<"534217DCE6A719D59E54FB0EB7A367900DBFC5F85757E8C1F94269DF383F6D9B">>},
{<<"cache">>, <<"44516CE6FA03594D3A2AF025DD3A87BFE711000EB730219E1DDEFC816E0AA2F4">>},
{<<"certifi">>, <<"805ABD97539CAF89EC6D4732C91E62BA9DA0CDA51AC462380BBD28EE697A8C42">>},
{<<"cowboy">>, <<"04FD8C6A39EDC6AAA9C26123009200FC61F92A3A94F3178C527B70B767C6E605">>},
{<<"cowlib">>, <<"79F954A7021B302186A950A32869DBC185523D99D3E44CE430CD1F3289F41ED4">>},
{<<"email_validator">>, <<"44CBDB6E9615FE3D558715E4E6D60610E934CD3FE4B8C650FEC5C560304526D6">>},
{<<"gproc">>, <<"580ADAFA56463B75263EF5A5DF4C86AF321F68694E7786CB057FD805D1E2A7DE">>},
{<<"hackney">>, <<"C2790C9F0F7205F4A362512192DEE8179097394400E745E4D20BAB7226A8EAAD">>},
{<<"idna">>, <<"4BDD305EB64E18B0273864920695CB18D7A2021F31A11B9C5FBCD9A253F936E2">>},
{<<"jose">>, <<"078F6C9FB3CD2F4CFAFC972C814261A7D1E8D2B3685C0A76EB87E158EFFF1AC5">>},
{<<"jsx">>, <<"8EE1DB1CABAFDD578A2776A6AAAE87C2A8CE54B47B59E9EC7DAB5D7EB71CD8DC">>},
{<<"metrics">>, <<"69B09ADDDC4F74A40716AE54D140F93BEB0FB8978D8636EADED0C31B6F099F16">>},
{<<"mimerl">>, <<"F278585650AA581986264638EBF698F8BB19DF297F66AD91B18910DFC6E19323">>},
{<<"prometheus">>, <<"4905FD2992F8038ECCD7AA0CD22F40637ED618C0BED1F75C05AACEC15B7545DE">>},
{<<"prometheus_cowboy">>, <<"BA286BECA9302618418892D37BCD5DC669A6CC001F4EB6D6AF85FF81F3F4F34C">>},
{<<"prometheus_httpd">>, <<"0BBE831452CFDF9588538EB2F570B26F30C348ADAE5E95A7D87F35A5910BCF92">>},
{<<"ranch">>, <<"451D8527787DF716D99DC36162FCA05934915DB0B6141BBDAC2EA8D3C7AFC7D7">>},
{<<"ssl_verify_fun">>, <<"603561DC0FD62F4F2EA9B890F4E20E1A0D388746D6E20557CAFB1B16950DE88C">>},
{<<"unicode_util_compat">>, <<"1D1848C40487CDB0B30E8ED975E34E025860C02E419CB615D255849F3427439D">>}]}
].

@ -1 +1 @@
Subproject commit 52dc88cb68a9cac1e72aa2bef4423bef726b2a61
Subproject commit edc67d794ba749f768aabc41ae8c221a9a62364d