@@ -3,6 +3,7 @@ module Test.Hydra.Cluster.FaucetSpec where
3
3
import Hydra.Prelude
4
4
import Test.Hydra.Prelude
5
5
6
+ import Cardano.Api.UTxO qualified as UTxO
6
7
import CardanoClient (RunningNode (.. ))
7
8
import CardanoNode (withCardanoNodeDevnet )
8
9
import Control.Concurrent.Async (replicateConcurrently )
33
34
vk <- generate genVerificationKey
34
35
seedFromFaucet node vk 1_000_000 tracer
35
36
-- 10 unique outputs
36
- length (fold utxos) `shouldBe` 10
37
+ length (UTxO. txOutputs $ fold utxos) `shouldBe` 10
37
38
38
39
describe " returnFundsToFaucet" $ do
39
40
it " does nothing if nothing to return" $ \ (tracer, node) -> do
@@ -50,13 +51,13 @@ spec =
50
51
returnFundsToFaucet tracer node actor
51
52
remaining <- queryUTxOFor networkId nodeSocket QueryTip vk
52
53
finalFaucetFunds <- queryUTxOFor networkId nodeSocket QueryTip faucetVk
53
- foldMap txOutValue remaining `shouldBe` mempty
54
+ UTxO. foldMap txOutValue remaining `shouldBe` mempty
54
55
55
56
-- check the faucet has one utxo extra in the end
56
- length finalFaucetFunds `shouldBe` length initialFaucetFunds + 1
57
+ length ( UTxO. txOutputs finalFaucetFunds) `shouldBe` length ( UTxO. txOutputs initialFaucetFunds) + 1
57
58
58
- let initialFaucetValue = selectLovelace (foldMap txOutValue initialFaucetFunds)
59
- let finalFaucetValue = selectLovelace (foldMap txOutValue finalFaucetFunds)
59
+ let initialFaucetValue = selectLovelace (UTxO. foldMap txOutValue initialFaucetFunds)
60
+ let finalFaucetValue = selectLovelace (UTxO. foldMap txOutValue finalFaucetFunds)
60
61
let difference = initialFaucetValue - finalFaucetValue
61
62
-- difference between starting faucet amount and final one should
62
63
-- just be the amount of paid fees
74
75
-- it squashed the UTxO
75
76
utxoAfter <- queryUTxOFor networkId nodeSocket QueryTip vk
76
77
77
- length utxoAfter `shouldBe` 1
78
+ length ( UTxO. txOutputs utxoAfter) `shouldBe` 1
0 commit comments