Skip to content

Commit

Permalink
changes after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
ffakenz committed Jan 3, 2025
1 parent 3af8460 commit dce87f7
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 18 deletions.
18 changes: 9 additions & 9 deletions hydra-node/test/Hydra/Chain/Direct/TxTraceSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ import Hydra.Tx.HeadId (headIdToCurrencySymbol, mkHeadId)
import Hydra.Tx.Init (mkHeadOutput)
import Hydra.Tx.IsTx (hashUTxO, utxoFromTx)
import Hydra.Tx.Party (partyToChain)
import Hydra.Tx.ScriptRegistry (ScriptRegistry, registryUTxO, serialisedScriptRegistry)
import Hydra.Tx.ScriptRegistry (ScriptRegistry, registryUTxO)
import Hydra.Tx.Snapshot (ConfirmedSnapshot (..), Snapshot (..), SnapshotNumber (..), SnapshotVersion (..), getSnapshot, number)
import PlutusTx.Builtins (toBuiltin)
import Test.Hydra.Tx.Fixture (alice, bob, carol, testNetworkId)
Expand Down Expand Up @@ -700,14 +700,14 @@ performTx action result =
Deposit{} -> (Just . getTxId . getTxBody $ tx, adjustUTxO tx utxo)
_ -> (depositTxId, adjustUTxO tx utxo)
put adjusted
let observation = observeHeadTx Fixture.testNetworkId serialisedScriptRegistry utxo tx
pure
TxResult
{ constructedTx = Right tx
, spendableUTxO = utxo
, validationError
, observation
}
let observation = observeHeadTx Fixture.testNetworkId serialisedScriptRegistry utxo tx
pure
TxResult
{ constructedTx = Right tx
, spendableUTxO = utxo
, validationError
, observation
}

getValidationError :: Tx -> UTxO -> Maybe String
getValidationError tx utxo =
Expand Down
1 change: 0 additions & 1 deletion hydra-plutus/src/Hydra/Contract.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import Hydra.Cardano.Api (
pattern PlutusScript,
)
import Hydra.Cardano.Api.Prelude qualified as Api
import Hydra.Contract.Head qualified as Head
import Hydra.Contract.HeadTokens qualified as HeadTokens
import Hydra.Plutus (commitValidatorScript, depositValidatorScript, initialValidatorScript)
import Hydra.SerialisedScriptRegistry (SerialisedScriptRegistry (..))
Expand Down
5 changes: 2 additions & 3 deletions hydra-plutus/src/Hydra/SerialisedScriptRegistry.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ import Data.ByteString.Base16 qualified as Base16

import Data.ByteString.Lazy qualified as LBS
import Data.ByteString.Short qualified as SBS
import Hydra.Contract.Deposit qualified as Deposit
import Hydra.Contract.Head qualified as Head
import Hydra.Plutus (commitValidatorScript, initialValidatorScript)
import Hydra.Plutus (commitValidatorScript, depositValidatorScript, initialValidatorScript)
import PlutusLedgerApi.Common (SerialisedScript)

data SerialisedScriptRegistry = SerialisedScriptRegistry
Expand All @@ -26,7 +25,7 @@ serialisedScriptRegistry =
{ initialScriptValidator = initialValidatorScript
, commitScriptValidator = commitValidatorScript
, headScriptValidator = Head.validatorScript
, depositScriptValidator = Deposit.validatorScript
, depositScriptValidator = depositValidatorScript
}

-- XXX: used to parse Aiken `compiledCode`.
Expand Down
4 changes: 2 additions & 2 deletions hydra-tx/src/Hydra/Tx/Deposit.hs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ observeDepositTx ::
Maybe DepositObservation
observeDepositTx networkId SerialisedScriptRegistry{depositScriptValidator} tx = do
-- TODO: could just use the first output and fail otherwise
(TxIn depositTxId _, depositOut) <- findTxOutByAddress (depositAddress networkId) tx
(TxIn depositTxId _, depositOut) <- findTxOutByAddress depositAddr tx
(headId, deposited, deadline) <- observeDepositTxOut (networkIdToNetwork networkId) (toCtxUTxOTxOut depositOut)
if all (`elem` txIns' tx) (UTxO.inputSet deposited)
then
Expand All @@ -97,7 +97,7 @@ observeDepositTx networkId SerialisedScriptRegistry{depositScriptValidator} tx =
where
depositScript = fromPlutusScript depositScriptValidator

depositAddress = mkScriptAddress @PlutusScriptV3 networkId depositScript
depositAddr = mkScriptAddress @PlutusScriptV3 networkId depositScript

observeDepositTxOut ::
Network ->
Expand Down
3 changes: 0 additions & 3 deletions hydra-tx/src/Hydra/Tx/Recover.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@ import Hydra.Ledger.Cardano.Builder (
setValidityLowerBound,
unsafeBuildTransaction,
)
<<<<<<< HEAD
import Hydra.Plutus (depositValidatorScript)
=======
import Hydra.SerialisedScriptRegistry (SerialisedScriptRegistry (..))
>>>>>>> 9cb6d7a62 (move SerialisedScriptRegistry to hydra-plutus)
import Hydra.Tx (HeadId, mkHeadId)
import Hydra.Tx.Utils (mkHydraHeadV1TxName)

Expand Down

0 comments on commit dce87f7

Please sign in to comment.