hydra-cluster
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.Cluster.Scenarios

Synopsis

Documentation

oneOfThreeNodesStopsForAWhile :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO () Source #

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

refuelIfNeeded :: Tracer IO EndToEndLog -> ChainBackendOptions -> Actor -> Coin -> IO () Source #

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

returnFundsToFaucet :: Tracer IO EndToEndLog -> ChainBackendOptions -> Actor -> IO () Source #

Return the remaining funds to the faucet

restartedNodeCanObserveCommitTx :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO () Source #

resumeFromLatestKnownPoint :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO () Source #

restartedNodeCanClose :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO () Source #

nodeReObservesOnChainTxs :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO () Source #

hydraNodeBaseUrl :: HydraClient -> String Source #

Get the base URL for HTTP API calls to a hydra-node, using the actual API port the node was started on (allocated dynamically by allocateHydraNodePorts).

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

singlePartyHeadFullLifeCycle :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [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.

hydraApiPort :: HydraClient -> Option scheme Source #

An Option carrying a hydra-node's actual API port. Use to set the port in a req call.

singlePartyOpenAHead Source #

Arguments

:: Tracer IO EndToEndLog 
-> FilePath 
-> ChainBackendOptions 
-> [TxId] 
-> Maybe (Positive Natural) 
-> (HydraClient -> Secret (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.

canDeposit :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO () Source #

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

singlePartyUsesScriptOnL2 :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO () Source #

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

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

singlePartyUsesWithdrawZeroTrick :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO () Source #

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

canDepositScriptBlueprint :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO () Source #

persistenceCanLoadWithNothingCommitted :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO () Source #

canCloseWithLongContestationPeriod :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [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 :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO () 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 

threeNodesNoErrorsOnOpen :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [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 :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [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 :: FilePath -> Tracer IO EndToEndLog -> ChainBackendOptions -> [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.

initWithDifferentDepositPeriod :: FilePath -> Tracer IO EndToEndLog -> ChainBackendOptions -> [TxId] -> IO () Source #

Scenario for a deposit-period mismatch between peers: alice initializes a head while bob is configured with a different --deposit-period, so bob's node must ignore the head entirely (issue #2664).

startWithWrongPeers :: FilePath -> Tracer IO EndToEndLog -> ChainBackendOptions -> [TxId] -> IO () Source #

canDepositConcurrently :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO () Source #

Open a a two participant head, deposit funds to it and distribute them on fanout.

rejectDeposit :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO () Source #

canDepositPartially :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO () Source #

Open a single participant head and deposit part of a UTxO, with the remainder returned to a change address. This exercises the changeAddress balancing path in the deposit blueprint API.

canRecoverDeposit :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO () Source #

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

canRecoverDepositInAnyState :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO () Source #

Open a single-participant head, perform 3 deposits, and then: 1. Close the head and recover deposit #1 2. Fanout the head and recover deposit #2 3. Open a new head and recover deposit #3

canSeePendingDeposits :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO () Source #

Open a two-participant head, stop one node so deposits stay pending, then verify that GET /commits lists them. Recovery is covered by canRecoverDeposit.

canDecommit :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO () Source #

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

canSideLoadSnapshot :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO () Source #

Integration test for the SideLoadSnapshot API: open a single-party head, deposit UTxO, side-load the deposit snapshot, then spend the deposited UTxO. This exercises the real Cardano ledger and network to ensure the API inputs and outputs are wired up correctly. The consensus-resumption logic is covered by the BehaviorSpec unit tests.

canResumeOnMemberAlreadyBootstrapped :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO () Source #

waitsForChainInSync :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO () Source #

threeNodesWithMirrorParty :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO () Source #

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

respendNTimes :: HasCallStack => HydraClient -> Secret (SigningKey PaymentKey) -> DiffTime -> Int -> IO () Source #

Respend all outputs owned by a given key in the head every delay seconds, for numTimes times.

data EndToEndLog Source #

Instances

Instances details
ToJSON EndToEndLog Source # 
Instance details

Defined in CardanoNode

Methods

toJSON :: EndToEndLog -> Value

toEncoding :: EndToEndLog -> Encoding

toJSONList :: [EndToEndLog] -> Value

toEncodingList :: [EndToEndLog] -> Encoding

omitField :: EndToEndLog -> Bool

Generic EndToEndLog Source # 
Instance details

Defined in CardanoNode

Associated Types

type Rep EndToEndLog :: Type -> Type Source #

Show EndToEndLog Source # 
Instance details

Defined in CardanoNode

Eq EndToEndLog Source # 
Instance details

Defined in CardanoNode

type Rep EndToEndLog Source # 
Instance details

Defined in CardanoNode

type Rep EndToEndLog = D1 ('MetaData "EndToEndLog" "CardanoNode" "hydra-cluster-2.3.0-AKuIRMQTBGS8QbUdMcH2lm" '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))))))