Skip to content

Commit 3149cb8

Browse files
committed
Apply code review suggestions
1 parent 1d42199 commit 3149cb8

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

doc/balancing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ CTL allows tweaking the default balancer behavior by letting the user impose con
2020

2121
- Using arbitrary address as user's own (for transaction balancing): `mustUseUtxosAtAddresses` / `mustUseUtxosAtAddress`
2222
- Providing additional UTxOs to use: `mustUseAdditionalUtxos`
23-
- Bypassing wallet's collateral selection and select collateral UTxOs from a given set: `mustUseCollateralUtxos`
23+
- Bypassing wallet's collateral selection and selecting collateral UTxOs from a given set: `mustUseCollateralUtxos`
2424
- Overriding change address: `mustSendChangeToAddress`
2525
- Preventing certain UTxOs from being spent: `mustNotSpendUtxosWithOutRefs` / `mustNotSpendUtxoWithOutRef`
2626
- Distributing token outputs equally between change UTxOs: `mustGenChangeOutsWithMaxTokenQuantity`

examples/BalanceTxConstraints.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ contract (ContractParams p) = do
147147
\{ input, output } -> Tuple input output
148148

149149
nonSpendableOref <-
150-
liftedM "Failed to get utxos at Bob's address"
150+
liftedM "Failed to get utxos at Alice's address"
151151
(Set.findMin <<< Map.keys <$> utxosAt aliceAddress)
152152

153153
mp /\ cs <- Helpers.mkCurrencySymbol alwaysMintsPolicy

src/Internal/BalanceTx/BalanceTx.purs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,7 @@ setTransactionCollateral changeAddr transaction = do
273273
mbCollateralUtxos <- asksConstraints _collateralUtxos
274274
-- We must filter out UTxOs that are set as non-spendable in the balancer
275275
-- constraints
276-
let
277-
isSpendable = not <<< flip Set.member nonSpendableSet
276+
let isSpendable = not <<< flip Set.member nonSpendableSet
278277
collateral <- case mbCollateralUtxos of
279278
-- if no collateral utxos are specified, use the wallet, but filter
280279
-- the unspendable ones

src/Internal/BalanceTx/Constraints.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ mustUseAdditionalUtxos :: UtxoMap -> BalanceTxConstraintsBuilder
181181
mustUseAdditionalUtxos = wrap <<< set _additionalUtxos
182182

183183
-- | Tells the balancer to select from the provided UTxO set when choosing
184-
-- | collateral UTxOs. Disables wallet's collateral selection.
184+
-- | collateral UTxOs, instead of UTxOs provided by the browser wallet.
185185
mustUseCollateralUtxos :: UtxoMap -> BalanceTxConstraintsBuilder
186186
mustUseCollateralUtxos = wrap <<< set _collateralUtxos <<< Just
187187

0 commit comments

Comments
 (0)