hydra-cluster-0.22.2: Integration test suite using a local cluster of cardano and hydra nodes
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.Cluster.Scenarios

Synopsis

Documentation

data EndToEndLog Source #

Instances

Instances details
ToJSON EndToEndLog Source # 
Instance details

Defined in Hydra.Cluster.Scenarios

Methods

toJSON :: EndToEndLog -> Value

toEncoding :: EndToEndLog -> Encoding

toJSONList :: [EndToEndLog] -> Value

toEncodingList :: [EndToEndLog] -> Encoding

omitField :: EndToEndLog -> Bool

Generic EndToEndLog Source # 
Instance details

Defined in Hydra.Cluster.Scenarios

Associated Types

type Rep EndToEndLog :: Type -> Type Source #

Show EndToEndLog Source # 
Instance details

Defined in Hydra.Cluster.Scenarios

Eq EndToEndLog Source # 
Instance details

Defined in Hydra.Cluster.Scenarios

type Rep EndToEndLog Source # 
Instance details

Defined in Hydra.Cluster.Scenarios

type Rep EndToEndLog = D1 ('MetaData "EndToEndLog" "Hydra.Cluster.Scenarios" "hydra-cluster-0.22.2-GzptauxaFT6APkmcXCipvr" 'False) (((C1 ('MetaCons "ClusterOptions" 'PrefixI 'True) (S1 ('MetaSel ('Just "options") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Options)) :+: C1 ('MetaCons "FromCardanoNode" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 NodeLog))) :+: (C1 ('MetaCons "FromFaucet" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FaucetLog)) :+: (C1 ('MetaCons "FromHydraNode" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 HydraNodeLog)) :+: C1 ('MetaCons "FromMithril" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 MithrilLog))))) :+: ((C1 ('MetaCons "StartingFunds" 'PrefixI 'True) (S1 ('MetaSel ('Just "actor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "utxo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UTxO)) :+: (C1 ('MetaCons "RefueledFunds" 'PrefixI 'True) (S1 ('MetaSel ('Just "actor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: (S1 ('MetaSel ('Just "refuelingAmount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Coin) :*: S1 ('MetaSel ('Just "utxo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UTxO))) :+: C1 ('MetaCons "RemainingFunds" 'PrefixI 'True) (S1 ('MetaSel ('Just "actor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "utxo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UTxO)))) :+: (C1 ('MetaCons "PublishedHydraScriptsAt" 'PrefixI 'True) (S1 ('MetaSel ('Just "hydraScriptsTxId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TxId])) :+: (C1 ('MetaCons "UsingHydraScriptsAt" 'PrefixI 'True) (S1 ('MetaSel ('Just "hydraScriptsTxId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TxId])) :+: C1 ('MetaCons "CreatedKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "keyPath") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath))))))

oneOfThreeNodesStopsForAWhile :: ChainBackend backend => Tracer IO EndToEndLog -> FilePath -> backend -> [TxId] -> IO () Source #

restartedNodeCanObserveCommitTx :: ChainBackend backend => Tracer IO EndToEndLog -> FilePath -> backend -> [TxId] -> IO () Source #

restartedNodeCanAbort :: ChainBackend backend => Tracer IO EndToEndLog -> FilePath -> backend -> [TxId] -> IO () Source #

nodeReObservesOnChainTxs :: ChainBackend backend => Tracer IO EndToEndLog -> FilePath -> backend -> [TxId] -> IO () Source #

singlePartyHeadFullLifeCycle :: ChainBackend backend => Tracer IO EndToEndLog -> FilePath -> backend -> [TxId] -> IO () Source #

Step through the full life cycle of a Hydra Head with only a single participant. This scenario is also used by the smoke test run via the `hydra-cluster` executable.

singlePartyOpenAHead Source #

Arguments

:: ChainBackend backend 
=> Tracer IO EndToEndLog 
-> FilePath 
-> backend 
-> [TxId] 
-> (HydraClient -> SigningKey PaymentKey -> HeadId -> IO a)

Continuation called when the head is open

-> IO a 

Open a Hydra Head with only a single participant but some arbitrary UTxO committed.

singlePartyCommitsFromExternal :: ChainBackend backend => Tracer IO EndToEndLog -> FilePath -> backend -> [TxId] -> IO () Source #

Single hydra-node where the commit is done using some wallet UTxO.

singlePartyUsesScriptOnL2 :: ChainBackend backend => Tracer IO EndToEndLog -> FilePath -> backend -> [TxId] -> IO () Source #

singlePartyUsesWithdrawZeroTrick :: ChainBackend backend => Tracer IO EndToEndLog -> FilePath -> backend -> [TxId] -> IO () Source #

Open a head and run a script using Rewarding script purpose and a zero lovelace withdrawal.

recomputeIntegrityHash :: (AlonzoEraPParams ppera, AlonzoEraTxWits txera, AlonzoEraTxBody txera, EraTx txera) => PParams ppera -> [Language] -> Tx txera -> Tx txera Source #

Compute the integrity hash of a transaction using a list of plutus languages.

singlePartyCommitsScriptBlueprint :: ChainBackend backend => Tracer IO EndToEndLog -> FilePath -> backend -> [TxId] -> IO () Source #

persistenceCanLoadWithEmptyCommit :: ChainBackend backend => Tracer IO EndToEndLog -> FilePath -> backend -> [TxId] -> IO () Source #

singlePartyCommitsFromExternalTxBlueprint :: ChainBackend backend => Tracer IO EndToEndLog -> FilePath -> backend -> [TxId] -> IO () Source #

Single hydra-node where the commit is done from a raw transaction blueprint.

canCloseWithLongContestationPeriod :: ChainBackend backend => Tracer IO EndToEndLog -> FilePath -> backend -> [TxId] -> IO () Source #

Initialize open and close a head on a real network and ensure contestation period longer than the time horizon is possible. For this it is enough that we can close a head and not wait for the deadline.

canSubmitTransactionThroughAPI :: ChainBackend backend => Tracer IO EndToEndLog -> FilePath -> backend -> [TxId] -> IO () Source #

threeNodesNoErrorsOnOpen :: ChainBackend backend => Tracer IO EndToEndLog -> FilePath -> backend -> [TxId] -> IO () Source #

Three hydra nodes open a head and we assert that none of them sees errors. This was particularly misleading when everyone tries to post the collect transaction concurrently.

nodeCanSupportMultipleEtcdClusters :: ChainBackend backend => Tracer IO EndToEndLog -> FilePath -> backend -> [TxId] -> IO () Source #

Hydra nodes ABC run on ABC cluster and connect to each other. Hydra nodes BC shut down. Hydra nodes BC run on BC cluster and connect to each other. Hydra nodes BC shut down. Hydra nodes BC run and connect ABC cluster again.

initWithWrongKeys :: ChainBackend backend => FilePath -> Tracer IO EndToEndLog -> backend -> [TxId] -> IO () Source #

Two hydra node setup where Alice is wrongly configured to use Carol's cardano keys instead of Bob's which will prevent him to be notified the HeadIsInitializing but he should still receive some notification.

startWithWrongPeers :: ChainBackend backend => FilePath -> Tracer IO EndToEndLog -> backend -> [TxId] -> IO () Source #

canCommit :: ChainBackend backend => Tracer IO EndToEndLog -> FilePath -> NominalDiffTime -> backend -> [TxId] -> IO () Source #

Open a a two participant head and incrementally commit to it.

canRecoverDeposit :: ChainBackend backend => Tracer IO EndToEndLog -> FilePath -> backend -> [TxId] -> IO () Source #

Open a a single participant head, deposit and then recover it.

canSeePendingDeposits :: ChainBackend backend => Tracer IO EndToEndLog -> FilePath -> NominalDiffTime -> backend -> [TxId] -> IO () Source #

Make sure to be able to see pending deposits.

canDecommit :: ChainBackend backend => Tracer IO EndToEndLog -> FilePath -> backend -> [TxId] -> IO () Source #

Open a a single participant head with some UTxO and incrementally decommit it.

canSideLoadSnapshot :: ChainBackend backend => Tracer IO EndToEndLog -> FilePath -> backend -> [TxId] -> IO () Source #

Can side load snapshot and resume agreement after a peer comes back online with healthy configuration

threeNodesWithMirrorParty :: ChainBackend backend => Tracer IO EndToEndLog -> FilePath -> backend -> [TxId] -> IO () Source #

Three hydra nodes open a head and we assert that none of them sees errors if a party is duplicated.

L2 scenarios

respendUTxO :: HydraClient -> SigningKey PaymentKey -> NominalDiffTime -> IO () Source #

Finds UTxO owned by given key in the head and creates transactions respending it to the same address as fast as possible, forever. NOTE: This relies on zero-fee protocol parameters.

Utilities

refuelIfNeeded :: ChainBackend backend => Tracer IO EndToEndLog -> backend -> Actor -> Coin -> IO () Source #

Refuel given Actor with given Lovelace if current marked UTxO is below that amount.

returnFundsToFaucet :: ChainBackend backend => Tracer IO EndToEndLog -> backend -> Actor -> IO () Source #

Return the remaining funds to the faucet

headIsInitializingWith :: Set Party -> Value -> Maybe HeadId Source #

checkFanout :: HeadId -> UTxO -> Value -> Maybe () Source #

expectErrorStatus Source #

Arguments

:: Int

Expected http status code

-> Maybe ByteString

Optional string expected to be present somewhere in the response body

-> HttpException

Expected exception

-> Bool