| Safe Haskell | Safe-Inferred |
|---|---|
| Language | GHC2021 |
Hydra.Cluster.Scenarios
Synopsis
- oneOfThreeNodesStopsForAWhile :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO ()
- headIsOpenWith :: Set Party -> Value -> Maybe HeadId
- refuelIfNeeded :: Tracer IO EndToEndLog -> ChainBackendOptions -> Actor -> Coin -> IO ()
- returnFundsToFaucet :: Tracer IO EndToEndLog -> ChainBackendOptions -> Actor -> IO ()
- restartedNodeCanObserveCommitTx :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO ()
- resumeFromLatestKnownPoint :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO ()
- restartedNodeCanClose :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO ()
- nodeReObservesOnChainTxs :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO ()
- hydraNodeBaseUrl :: HydraClient -> String
- headIsFinalizedWith :: HeadId -> UTxO -> Value -> Maybe ()
- singlePartyHeadFullLifeCycle :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO ()
- hydraApiPort :: HydraClient -> Option scheme
- singlePartyOpenAHead :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> Maybe (Positive Natural) -> (HydraClient -> Secret (SigningKey PaymentKey) -> HeadId -> IO a) -> IO a
- canDeposit :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO ()
- singlePartyUsesScriptOnL2 :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO ()
- recomputeIntegrityHash :: (AlonzoEraPParams ppera, AlonzoEraTxWits txera, AlonzoEraTxBody txera, EraTx txera) => PParams ppera -> [Language] -> Tx TopTx txera -> Tx TopTx txera
- singlePartyUsesWithdrawZeroTrick :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO ()
- canDepositScriptBlueprint :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO ()
- persistenceCanLoadWithNothingCommitted :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO ()
- canCloseWithLongContestationPeriod :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO ()
- canSubmitTransactionThroughAPI :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO ()
- expectErrorStatus :: Int -> Maybe ByteString -> HttpException -> Bool
- threeNodesNoErrorsOnOpen :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO ()
- nodeCanSupportMultipleEtcdClusters :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO ()
- initWithWrongKeys :: FilePath -> Tracer IO EndToEndLog -> ChainBackendOptions -> [TxId] -> IO ()
- initWithDifferentDepositPeriod :: FilePath -> Tracer IO EndToEndLog -> ChainBackendOptions -> [TxId] -> IO ()
- startWithWrongPeers :: FilePath -> Tracer IO EndToEndLog -> ChainBackendOptions -> [TxId] -> IO ()
- canDepositConcurrently :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO ()
- rejectDeposit :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO ()
- canDepositPartially :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO ()
- canRecoverDeposit :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO ()
- canRecoverDepositInAnyState :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO ()
- canSeePendingDeposits :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO ()
- canDecommit :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO ()
- canSideLoadSnapshot :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO ()
- canResumeOnMemberAlreadyBootstrapped :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO ()
- waitsForChainInSync :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO ()
- threeNodesWithMirrorParty :: Tracer IO EndToEndLog -> FilePath -> ChainBackendOptions -> [TxId] -> IO ()
- respendNTimes :: HasCallStack => HydraClient -> Secret (SigningKey PaymentKey) -> DiffTime -> Int -> IO ()
- data EndToEndLog
- = ClusterOptions { }
- | FromCardanoNode NodeLog
- | FromFaucet FaucetLog
- | FromHydraNode HydraNodeLog
- | FromMithril MithrilLog
- | StartingFunds { }
- | RefueledFunds {
- actor :: String
- refuelingAmount :: Coin
- utxo :: UTxO
- | RemainingFunds { }
- | PublishedHydraScriptsAt {
- hydraScriptsTxId :: [TxId]
- | UsingHydraScriptsAt {
- hydraScriptsTxId :: [TxId]
- | CreatedKey { }
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.
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 #
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 #
Constructors
| ClusterOptions | |
| FromCardanoNode NodeLog | |
| FromFaucet FaucetLog | |
| FromHydraNode HydraNodeLog | |
| FromMithril MithrilLog | |
| StartingFunds | |
| RefueledFunds | |
Fields
| |
| RemainingFunds | |
| PublishedHydraScriptsAt | |
Fields
| |
| UsingHydraScriptsAt | |
Fields
| |
| CreatedKey | |