From 2f5106fd8580ac2a3c589a7eda69cb7830beab35 Mon Sep 17 00:00:00 2001 From: Pawel Jakubas Date: Tue, 30 May 2023 11:22:58 +0200 Subject: [PATCH] deal properly with withdrawals after refactoring --- .../api/http/Cardano/Wallet/Api/Http/Shelley/Server.hs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/wallet/api/http/Cardano/Wallet/Api/Http/Shelley/Server.hs b/lib/wallet/api/http/Cardano/Wallet/Api/Http/Shelley/Server.hs index 81f0268b9f5..005c89ee61f 100644 --- a/lib/wallet/api/http/Cardano/Wallet/Api/Http/Shelley/Server.hs +++ b/lib/wallet/api/http/Cardano/Wallet/Api/Http/Shelley/Server.hs @@ -2961,12 +2961,20 @@ constructSharedTransaction handler $ W.readRewardAccount @((SharedState n SharedKey)) db pure $ Just (action, path) + pathForWithdrawal <- case withdrawal of + WithdrawalSelf _ _ _ -> do + (_, _, path) <- + handler $ W.readRewardAccount @((SharedState n SharedKey)) db + pure $ Just path + _ -> + pure Nothing + pure $ ApiConstructTransaction { transaction = balancedTx , coinSelection = mkApiCoinSelection deposits refunds delCertsWithPath md - (unsignedTx outs apiDecoded (snd <$> delCertsWithPath)) + (unsignedTx outs apiDecoded pathForWithdrawal) , fee = apiDecoded ^. #fee } where