Skip to content

Commit

Permalink
deal properly with withdrawals after refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
paweljakubas committed May 30, 2023
1 parent 807349f commit 2f5106f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/wallet/api/http/Cardano/Wallet/Api/Http/Shelley/Server.hs
Expand Up @@ -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
Expand Down

0 comments on commit 2f5106f

Please sign in to comment.