@@ -18,6 +18,7 @@ import Cardano.Types.Credential (Credential(PubKeyHashCredential))
1818import Cardano.Types.PaymentCredential (PaymentCredential (PaymentCredential))
1919import Cardano.Types.StakeCredential (StakeCredential (StakeCredential))
2020import Cardano.Types.StakePubKeyHash (StakePubKeyHash (StakePubKeyHash))
21+ import Cardano.Wallet.Key (KeyWallet )
2122import Contract.Address (getNetworkId )
2223import Contract.Log (logInfo' )
2324import Contract.Monad
@@ -74,7 +75,6 @@ import Ctl.Internal.Testnet.Utils
7475 , runCleanup
7576 , whenError
7677 )
77- import Ctl.Internal.Wallet.Key (KeyWallet )
7878import Data.Array (concat , fromFoldable , zip ) as Array
7979import Data.Map (values ) as Map
8080import Effect.Aff (bracket ) as Aff
@@ -295,15 +295,16 @@ execDistrFundsPlan withCardanoCliUtxos rounds = do
295295 genesisAddr <- liftedM " Could not get genesis address"
296296 getWalletAddress
297297 withCardanoCliUtxos genesisAddr do
298+ constraintList <- liftAff $ traverse
299+ ( \{ wallet, amount } -> do
300+ addrs <- (unwrap wallet).address network
301+ pure $ mustPayToAddress addrs $ Value .lovelaceValueOf
302+ amount
303+ )
304+ utxos
298305 let
299306 constraints :: TxConstraints
300- constraints =
301- foldMap
302- ( \{ wallet, amount } ->
303- mustPayToAddress ((unwrap wallet).address network) $
304- Value .lovelaceValueOf amount
305- )
306- utxos
307+ constraints = fold constraintList
307308
308309 unbalancedTx <- mkUnbalancedTx mempty constraints
309310 balancedTx <- balanceTx unbalancedTx
0 commit comments