From ffb252c54e971006f95920758ce34bf634fd5e2e Mon Sep 17 00:00:00 2001 From: Franco Testagrossa Date: Thu, 24 Oct 2024 11:22:23 +0200 Subject: [PATCH] Derive deposited value from the deposit out present in the deposit script UTxO --- hydra-tx/src/Hydra/Tx/Increment.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hydra-tx/src/Hydra/Tx/Increment.hs b/hydra-tx/src/Hydra/Tx/Increment.hs index 1e101f73321..02ce0b318b3 100644 --- a/hydra-tx/src/Hydra/Tx/Increment.hs +++ b/hydra-tx/src/Hydra/Tx/Increment.hs @@ -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 @@ -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