Skip to content

Commit

Permalink
Derive deposited value from the deposit out present in the deposit sc…
Browse files Browse the repository at this point in the history
…ript UTxO
  • Loading branch information
ffakenz committed Oct 24, 2024
1 parent 486cda0 commit ffb252c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hydra-tx/src/Hydra/Tx/Increment.hs
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ incrementTx scriptRegistry vk headId headParameters (headInput, headOutput) snap
, version = toInteger version + 1
}

depositedValue = foldMap (txOutValue . snd) (UTxO.pairs (fromMaybe mempty utxoToCommit))
depositedValue = txOutValue depositOut

depositScript = fromPlutusScript @PlutusScriptV2 Deposit.validatorScript

-- NOTE: we expect always a single output from a deposit tx
(depositIn, _) = List.head $ UTxO.pairs depositScriptUTxO
(depositIn, depositOut) = List.head $ UTxO.pairs depositScriptUTxO

depositRedeemer = toScriptData $ Deposit.Claim $ headIdToCurrencySymbol headId

Expand All @@ -110,4 +110,4 @@ incrementTx scriptRegistry vk headId headParameters (headInput, headOutput) snap
ScriptWitness scriptWitnessInCtx $
mkScriptWitness depositScript InlineScriptDatum depositRedeemer

Snapshot{utxo, utxoToCommit, version, number} = snapshot
Snapshot{utxo, version, number} = snapshot

0 comments on commit ffb252c

Please sign in to comment.