Skip to content

Commit

Permalink
Fix observation test for increment
Browse files Browse the repository at this point in the history
  • Loading branch information
v0d1ch committed Oct 9, 2024
1 parent c6226d1 commit 3383deb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions hydra-node/src/Hydra/Chain/Direct/State.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1197,20 +1197,21 @@ genRecoverTx = do

genIncrementTx :: Int -> Gen (ChainContext, [TxOut CtxUTxO], OpenState, UTxO, Tx)
genIncrementTx numParties = do
(utxo, txDeposit) <- genDepositTx
(_utxo, txDeposit) <- genDepositTx
ctx <- genHydraContextFor numParties
cctx <- pickChainContext ctx
let DepositObservation{deposited, depositTxId} = fromJust $ observeDepositTx (ctxNetworkId ctx) txDeposit
(_, st@OpenState{headId}) <- genStOpen ctx
let openUTxO = getKnownUTxO st
let version = 1
snapshot <- genConfirmedSnapshot headId 2 version openUTxO (Just deposited) Nothing (ctxHydraSigningKeys ctx)
let depositUTxO = utxoFromTx txDeposit
pure
( cctx
, maybe mempty toList (utxoToCommit $ getSnapshot snapshot)
, st
, utxo
, unsafeIncrement cctx openUTxO headId (ctxHeadParameters ctx) snapshot depositTxId
, depositUTxO
, unsafeIncrement cctx (openUTxO <> depositUTxO) headId (ctxHeadParameters ctx) snapshot depositTxId
)

genDecrementTx :: Int -> Gen (ChainContext, [TxOut CtxUTxO], OpenState, UTxO, Tx)
Expand Down

0 comments on commit 3383deb

Please sign in to comment.