Skip to content

Commit 48329eb

Browse files
Wrote actual test for UTxO change.
Unfortunately, it fails. Unsure if this is an issue with the balancing code, or with the constraints used to construct the Tx.
1 parent 2ff844d commit 48329eb

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

test/Spec/BotPlutusInterface/Balance.hs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import Spec.MockContract (
4141
paymentPkh3,
4242
pkh3,
4343
pkhAddr3,
44-
runContractPure,
44+
-- runContractPure,
4545
runPABEffectPure,
4646
utxos,
4747
)
@@ -197,10 +197,17 @@ dontAddChangeToDatum = do
197197
case eunbalancedTx of
198198
Left mkTxErr -> assertFailure ("MkTx Error: " <> show mkTxErr)
199199
Right unbalancedTx -> do
200-
let (eRslt, finalState) = runPABEffectPure initState (balanceTxIO @() @'[PABEffect ()] pabConf pkh3 unbalancedTx)
200+
let (eRslt, _finalState) = runPABEffectPure initState (balanceTxIO @() @'[PABEffect ()] pabConf pkh3 unbalancedTx)
201201
case eRslt of
202202
(Left txt) -> assertFailure ("PAB effect error: " <> Text.unpack txt)
203203
(Right (Left txt)) -> assertFailure $ "Balancing error: " <> Text.unpack txt -- <> "\n(Tx: " <> show unbalancedTx <> ")"
204204
(Right (Right trx)) -> do
205205
-- TODO: Write the actual test.
206-
assertFailure "Incomplete Test"
206+
assertBool
207+
( "Original UTxO not in output Tx."
208+
<> "\nOriginal UTxO: "
209+
<> show scrTxOut
210+
<> "\nNew UTxOs: "
211+
<> show (txOutputs trx)
212+
)
213+
(scrTxOut `elem` txOutputs trx)

0 commit comments

Comments
 (0)