| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Test.Cardano.Ledger.Dijkstra.ImpTest
Contents
Synopsis
- module Test.Cardano.Ledger.Conway.ImpTest
- class (ConwayEraImp era, DijkstraEraTest era, DijkstraEraForecast era, DijkstraEraBlockBody era, EraEndorserBlock era, InjectRuleFailure "BBODY" DijkstraBbodyPredFailure era, InjectRuleFailure "BBODY" DijkstraLeiosCertPredFailure era, InjectRuleFailure "LEDGER" DijkstraLedgerPredFailure era, InjectRuleFailure "LEDGER" DijkstraPoolPredFailure era, InjectRuleFailure "LEDGER" EntitiesPredFailure era, InjectRuleFailure "LEDGER" SubEntitiesPredFailure era, InjectRuleFailure "LEDGER" DijkstraUtxoPredFailure era, InjectRuleFailure "LEDGER" DijkstraUtxowPredFailure era, InjectRuleFailure "MEMPOOL" DijkstraMempoolPredFailure era, InjectRuleFailure "MEMPOOL" DijkstraUtxoPredFailure era, InjectRuleFailure "LEDGER" DijkstraSubUtxoPredFailure era, InjectRuleFailure "LEDGER" DijkstraGovPredFailure era, InjectRuleFailure "LEDGER" DijkstraSubGovPredFailure era, InjectRuleFailure "LEDGER" DijkstraSubUtxowPredFailure era, InjectRuleFailure "LEDGER" DijkstraSubPoolPredFailure era, InjectRuleFailure "LEDGER" DijkstraSubDelegPredFailure era, InjectRuleFailure "LEDGER" DijkstraSubLedgerPredFailure era, InjectRuleFailure "LEDGER" DijkstraSubGovCertPredFailure era, InjectRuleFailure "EB" EbPredFailure era, Inject (NonEmpty (PredicateFailure (EraRule "MEMPOOL" era))) (ApplyTxError era), STS (EraRule "EB" era), BaseM (EraRule "EB" era) ~ ShelleyBase, Environment (EraRule "EB" era) ~ ShelleyLedgersEnv era, State (EraRule "EB" era) ~ NewEpochState era, Signal (EraRule "EB" era) ~ EndorserBlock era, ToExpr (PredicateFailure (EraRule "EB" era)), STS (EraRule "EBLEDGERS" era), EraRuleFailure "EB" era ~ PredicateFailure (EraRule "EB" era)) ⇒ DijkstraEraImp era
- impDijkstraSatisfyNativeScript ∷ ∀ era (l ∷ TxLevel). (DijkstraEraImp era, NativeScript era ~ DijkstraNativeScript era) ⇒ Set (KeyHash 'Witness) → TxBody l era → NativeScript era → ImpTestM era (Maybe (Map (KeyHash 'Witness) (KeyPair 'Witness)))
- fixupSubTransactions ∷ (HasCallStack, DijkstraEraImp era) ⇒ Tx 'TopTx era → ImpTestM era (Tx 'TopTx era)
- balanceSubTransactions ∷ DijkstraEraImp era ⇒ Tx 'TopTx era → ImpTestM era (Tx 'TopTx era)
- switchTxToLegacyMode ∷ DijkstraEraImp era ⇒ Tx 'TopTx era → ImpTestM era (Tx 'TopTx era)
- switchTxToPhase2InvalidLegacyMode ∷ DijkstraEraImp era ⇒ Tx 'TopTx era → ImpTestM era (Tx 'TopTx era)
- mkTopTxWithSubTxs ∷ DijkstraEraImp era ⇒ [Tx 'SubTx era] → Tx 'TopTx era
- mkTopTxWithDistinctSubTxs ∷ DijkstraEraImp era ⇒ [Tx 'SubTx era] → ImpTestM era (Tx 'TopTx era)
- distinctSubTxs ∷ DijkstraEraImp era ⇒ [Tx 'SubTx era] → ImpTestM era [Tx 'SubTx era]
- traverseSubTxs ∷ (Applicative m, EraTx era, DijkstraEraTxBody era) ⇒ (Tx 'SubTx era → m (Tx 'SubTx era)) → Tx 'TopTx era → m (Tx 'TopTx era)
- withPostFixupSubTxs ∷ (HasCallStack, DijkstraEraImp era) ⇒ (Tx 'SubTx era → ImpTestM era (Tx 'SubTx era)) → ImpTestM era a → ImpTestM era a
- submitFailingSubTx ∷ (HasCallStack, DijkstraEraImp era) ⇒ Tx 'SubTx era → NonEmpty (PredicateFailure (EraRule "LEDGER" era)) → ImpTestM era ()
- submitFailingMempoolTx ∷ (HasCallStack, DijkstraEraImp era) ⇒ Tx 'TopTx era → NonEmpty (DijkstraMempoolPredFailure era) → ImpTestM era ()
- expectMempoolRejection ∷ (HasCallStack, DijkstraEraImp era) ⇒ Either (ApplyTxError era) a → NonEmpty (DijkstraMempoolPredFailure era) → ImpTestM era ()
- voteSubTx ∷ DijkstraEraImp era ⇒ Vote → Voter → GovActionId → Tx 'SubTx era
- declareTreasurySubTx ∷ DijkstraEraImp era ⇒ Coin → Tx 'SubTx era
- registerDRepSubTx ∷ DijkstraEraImp era ⇒ ImpTestM era (Credential 'DRepRole)
- setupLeiosCommittee ∷ (HasCallStack, DijkstraEraImp era) ⇒ Int → ImpTestM era [LeiosSigningKey]
- mkLeiosCert ∷ HasCallStack ⇒ [LeiosSigningKey] → SafeHash EraIndependentBlockHeader → ImpTestM era LeiosCert
- applyEndorserBlock ∷ (HasCallStack, DijkstraEraImp era) ⇒ EndorserBlock era → ImpTestM era ()
- applyFailingEndorserBlock ∷ (HasCallStack, DijkstraEraImp era) ⇒ EndorserBlock era → NonEmpty (PredicateFailure (EraRule "EB" era)) → ImpTestM era ()
- makeEndorserBlock ∷ (DijkstraEraImp era, HashAnnotated (Tx 'TopTx era) EraIndependentTx) ⇒ StrictSeq (Tx 'TopTx era) → ImpTestM era (EndorserBlock era)
- mkEbReferencesAnnouncement ∷ EraEndorserBlock era ⇒ EndorserBlock era → EbReferencesAnnouncement
Documentation
class (ConwayEraImp era, DijkstraEraTest era, DijkstraEraForecast era, DijkstraEraBlockBody era, EraEndorserBlock era, InjectRuleFailure "BBODY" DijkstraBbodyPredFailure era, InjectRuleFailure "BBODY" DijkstraLeiosCertPredFailure era, InjectRuleFailure "LEDGER" DijkstraLedgerPredFailure era, InjectRuleFailure "LEDGER" DijkstraPoolPredFailure era, InjectRuleFailure "LEDGER" EntitiesPredFailure era, InjectRuleFailure "LEDGER" SubEntitiesPredFailure era, InjectRuleFailure "LEDGER" DijkstraUtxoPredFailure era, InjectRuleFailure "LEDGER" DijkstraUtxowPredFailure era, InjectRuleFailure "MEMPOOL" DijkstraMempoolPredFailure era, InjectRuleFailure "MEMPOOL" DijkstraUtxoPredFailure era, InjectRuleFailure "LEDGER" DijkstraSubUtxoPredFailure era, InjectRuleFailure "LEDGER" DijkstraGovPredFailure era, InjectRuleFailure "LEDGER" DijkstraSubGovPredFailure era, InjectRuleFailure "LEDGER" DijkstraSubUtxowPredFailure era, InjectRuleFailure "LEDGER" DijkstraSubPoolPredFailure era, InjectRuleFailure "LEDGER" DijkstraSubDelegPredFailure era, InjectRuleFailure "LEDGER" DijkstraSubLedgerPredFailure era, InjectRuleFailure "LEDGER" DijkstraSubGovCertPredFailure era, InjectRuleFailure "EB" EbPredFailure era, Inject (NonEmpty (PredicateFailure (EraRule "MEMPOOL" era))) (ApplyTxError era), STS (EraRule "EB" era), BaseM (EraRule "EB" era) ~ ShelleyBase, Environment (EraRule "EB" era) ~ ShelleyLedgersEnv era, State (EraRule "EB" era) ~ NewEpochState era, Signal (EraRule "EB" era) ~ EndorserBlock era, ToExpr (PredicateFailure (EraRule "EB" era)), STS (EraRule "EBLEDGERS" era), EraRuleFailure "EB" era ~ PredicateFailure (EraRule "EB" era)) ⇒ DijkstraEraImp era Source #
Instances
impDijkstraSatisfyNativeScript ∷ ∀ era (l ∷ TxLevel). (DijkstraEraImp era, NativeScript era ~ DijkstraNativeScript era) ⇒ Set (KeyHash 'Witness) → TxBody l era → NativeScript era → ImpTestM era (Maybe (Map (KeyHash 'Witness) (KeyPair 'Witness))) Source #
fixupSubTransactions ∷ (HasCallStack, DijkstraEraImp era) ⇒ Tx 'TopTx era → ImpTestM era (Tx 'TopTx era) Source #
balanceSubTransactions ∷ DijkstraEraImp era ⇒ Tx 'TopTx era → ImpTestM era (Tx 'TopTx era) Source #
switchTxToLegacyMode ∷ DijkstraEraImp era ⇒ Tx 'TopTx era → ImpTestM era (Tx 'TopTx era) Source #
switchTxToPhase2InvalidLegacyMode ∷ DijkstraEraImp era ⇒ Tx 'TopTx era → ImpTestM era (Tx 'TopTx era) Source #
mkTopTxWithSubTxs ∷ DijkstraEraImp era ⇒ [Tx 'SubTx era] → Tx 'TopTx era Source #
A top level transaction that nests the given sub-transactions and is otherwise empty.
mkTopTxWithDistinctSubTxs ∷ DijkstraEraImp era ⇒ [Tx 'SubTx era] → ImpTestM era (Tx 'TopTx era) Source #
distinctSubTxs ∷ DijkstraEraImp era ⇒ [Tx 'SubTx era] → ImpTestM era [Tx 'SubTx era] Source #
Give each sub-transaction a fresh input, so that otherwise identical sub-transactions get distinct transaction ids
traverseSubTxs ∷ (Applicative m, EraTx era, DijkstraEraTxBody era) ⇒ (Tx 'SubTx era → m (Tx 'SubTx era)) → Tx 'TopTx era → m (Tx 'TopTx era) Source #
Apply an effectful modification to every sub-transaction of a top level transaction.
Sub-transactions are keyed by their transaction id, so a modification that makes two of them equal keeps only the first.
withPostFixupSubTxs ∷ (HasCallStack, DijkstraEraImp era) ⇒ (Tx 'SubTx era → ImpTestM era (Tx 'SubTx era)) → ImpTestM era a → ImpTestM era a Source #
Apply a modification to every sub-transaction, after the given
fixup f has run, in order to provoke a failure that f otherwise
repairs.
The top level transaction is signed again afterwards, since sub-transactions are part of its body and modifying one invalidates its witnesses.
submitFailingSubTx ∷ (HasCallStack, DijkstraEraImp era) ⇒ Tx 'SubTx era → NonEmpty (PredicateFailure (EraRule "LEDGER" era)) → ImpTestM era () Source #
Submit a sub-transaction, nested in an otherwise empty top level transaction, that is expected to be rejected with exactly the given predicate failures.
submitFailingMempoolTx ∷ (HasCallStack, DijkstraEraImp era) ⇒ Tx 'TopTx era → NonEmpty (DijkstraMempoolPredFailure era) → ImpTestM era () Source #
Submit a transaction through the mempool that is expected to be rejected with exactly the given predicate failures.
expectMempoolRejection ∷ (HasCallStack, DijkstraEraImp era) ⇒ Either (ApplyTxError era) a → NonEmpty (DijkstraMempoolPredFailure era) → ImpTestM era () Source #
Expect the result of a mempool submission to be a rejection with exactly the given predicate failures.
voteSubTx ∷ DijkstraEraImp era ⇒ Vote → Voter → GovActionId → Tx 'SubTx era Source #
A sub-transaction that casts a single vote.
declareTreasurySubTx ∷ DijkstraEraImp era ⇒ Coin → Tx 'SubTx era Source #
A sub-transaction that declares the given value as the current treasury value.
registerDRepSubTx ∷ DijkstraEraImp era ⇒ ImpTestM era (Credential 'DRepRole) Source #
setupLeiosCommittee ∷ (HasCallStack, DijkstraEraImp era) ⇒ Int → ImpTestM era [LeiosSigningKey] Source #
Sets up the given number of stake pools with BLS keys and equal stake delegated to them, and passes the two epochs it takes for them to be seated in the Leios committee. Returns the keys the pools vote with.
mkLeiosCert ∷ HasCallStack ⇒ [LeiosSigningKey] → SafeHash EraIndependentBlockHeader → ImpTestM era LeiosCert Source #
Certifies the endorser block announced in the given block header with the votes of the given keys, each of which has to hold a seat in the current Leios committee.
applyEndorserBlock ∷ (HasCallStack, DijkstraEraImp era) ⇒ EndorserBlock era → ImpTestM era () Source #
applyFailingEndorserBlock ∷ (HasCallStack, DijkstraEraImp era) ⇒ EndorserBlock era → NonEmpty (PredicateFailure (EraRule "EB" era)) → ImpTestM era () Source #
makeEndorserBlock ∷ (DijkstraEraImp era, HashAnnotated (Tx 'TopTx era) EraIndependentTx) ⇒ StrictSeq (Tx 'TopTx era) → ImpTestM era (EndorserBlock era) Source #
mkEbReferencesAnnouncement ∷ EraEndorserBlock era ⇒ EndorserBlock era → EbReferencesAnnouncement Source #