Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
{scoper, {git, "https://github.com/valitydev/scoper.git", {tag, "v1.1.0"}}},
{thrift, {git, "https://github.com/valitydev/thrift-erlang.git", {tag, "v1.0.0"}}},
{woody, {git, "https://github.com/valitydev/woody_erlang.git", {tag, "v1.1.0"}}},
{dmt_client, {git, "https://github.com/valitydev/dmt-client.git", {tag, "v2.0.2"}}},
{damsel, {git, "https://github.com/valitydev/damsel.git", {tag, "v2.2.11"}}},
{dmt_client, {git, "https://github.com/valitydev/dmt-client.git", {tag, "v2.0.3"}}},
{damsel, {git, "https://github.com/valitydev/damsel.git", {tag, "v2.2.12"}}},
{identdocstore_proto, {git, "https://github.com/valitydev/identdocstore-proto.git", {branch, "master"}}},
{fistful_proto, {git, "https://github.com/valitydev/fistful-proto.git", {tag, "v2.0.0"}}},
{fistful_reporter_proto, {git, "https://github.com/valitydev/fistful-reporter-proto.git", {branch, "master"}}},
Expand Down
4 changes: 2 additions & 2 deletions rebar.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
{<<"cowlib">>,{pkg,<<"cowlib">>,<<"2.11.0">>},2},
{<<"damsel">>,
{git,"https://github.com/valitydev/damsel.git",
{ref,"ff9b01f552f922ce4a16710827aa872325dbe5a9"}},
{ref,"8cab698cd78125ac47489d0ba81169df376757a4"}},
0},
{<<"dmt_client">>,
{git,"https://github.com/valitydev/dmt-client.git",
{ref,"fff521d3d50b48e3c6b628fe4796b3628aedc6b7"}},
{ref,"20c18cc9b51d0f273db60c929e8a8a871d6a1866"}},
0},
{<<"file_storage_proto">>,
{git,"https://github.com/valitydev/file-storage-proto.git",
Expand Down
11 changes: 6 additions & 5 deletions src/wapi_wallet_backend.erl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
get(WalletID, _HandlerContext) ->
case get_wallet_config(WalletID) of
{ok, WalletConfig} ->
{ok, unmarshal(wallet, {WalletID, WalletConfig}), WalletConfig#domain_WalletConfig.party_id};
#domain_WalletConfig{party_ref = #domain_PartyConfigRef{id = PartyID}} = WalletConfig,
{ok, unmarshal(wallet, {WalletID, WalletConfig}), PartyID};
{error, notfound} ->
{error, {wallet, notfound}}
end.
Expand All @@ -23,8 +24,8 @@ get(WalletID, _HandlerContext) ->
get_account(WalletID, HandlerContext) ->
DomainRevision = wapi_domain_backend:head(),
case get_wallet_config(WalletID) of
{ok, #domain_WalletConfig{party_id = PartyID, account = #domain_WalletAccount{settlement = AccountID}}} ->
Request = {party_management, 'GetAccountState', {PartyID, AccountID, DomainRevision}},
{ok, #domain_WalletConfig{party_ref = PartyRef, account = #domain_WalletAccount{settlement = AccountID}}} ->
Request = {party_management, 'GetAccountState', {PartyRef, AccountID, DomainRevision}},
case wapi_handler_utils:service_call(Request, HandlerContext) of
{ok, AccountBalanceThrift} ->
{ok, unmarshal(account_state, AccountBalanceThrift)};
Expand All @@ -51,14 +52,14 @@ unmarshal(
name = Name,
block = Blocking,
account = #domain_WalletAccount{currency = #domain_CurrencyRef{symbolic_code = Currency}},
party_id = PartyID
party_ref = PartyRef
}}
) ->
genlib_map:compact(#{
<<"id">> => unmarshal(id, WalletID),
<<"name">> => unmarshal(string, Name),
<<"isBlocked">> => unmarshal(blocking, Blocking),
<<"party">> => PartyID,
<<"party">> => PartyRef#domain_PartyConfigRef.id,
<<"currency">> => Currency
});
unmarshal(blocking, {unblocked, _}) ->
Expand Down
4 changes: 1 addition & 3 deletions test/wapi_ct_helper.erl
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ start_app({dmt_client = AppName, SupPid}) ->
currency = #domain_CurrencyRef{symbolic_code = <<"RUB">>},
settlement = ?INTEGER
},
party_id = ?STRING
party_ref = #domain_PartyConfigRef{id = ?STRING}
}
},
PartyConfigObject = #domain_PartyConfigObject{
Expand All @@ -168,8 +168,6 @@ start_app({dmt_client = AppName, SupPid}) ->
{active, #domain_Active{
since = wapi_time:rfc3339()
}},
shops = [],
wallets = [#domain_WalletConfigRef{id = ?STRING}],
contact_info = #domain_PartyContactInfo{
registration_email = <<"test@test.ru">>
}
Expand Down
Loading