cardano-ledger-conway-1.18.0.0: Cardano ledger with an updated on-chain governance system.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Cardano.Ledger.Conway.ImpTest

Synopsis

Documentation

class (AlonzoEraImp era, ConwayEraGov era, ConwayEraTxBody era, ConwayEraTxCert era, ConwayEraPParams era, STS (EraRule "ENACT" era), BaseM (EraRule "ENACT" era) ~ ShelleyBase, State (EraRule "ENACT" era) ~ EnactState era, Signal (EraRule "ENACT" era) ~ EnactSignal era, Environment (EraRule "ENACT" era) ~ (), NativeScript era ~ Timelock era, Script era ~ AlonzoScript era, GovState era ~ ConwayGovState era) ⇒ ConwayEraImp era Source #

trySubmitGovAction ∷ (ShelleyEraImp era, ConwayEraTxBody era) ⇒ GovAction era → ImpTestM era (Either (NonEmpty (PredicateFailure (EraRule "LEDGER" era))) (GovActionId (EraCrypto era))) Source #

Submits a transaction that proposes the given governance action. For proposing multiple actions in the same transaciton use trySubmitGovActions instead.

trySubmitGovActions ∷ (ShelleyEraImp era, ConwayEraTxBody era) ⇒ NonEmpty (GovAction era) → ImpTestM era (Either (NonEmpty (PredicateFailure (EraRule "LEDGER" era)), Tx era) (Tx era)) Source #

Submits a transaction that proposes the given governance action

trySubmitProposal ∷ (ShelleyEraImp era, ConwayEraTxBody era) ⇒ ProposalProcedure era → ImpTestM era (Either (NonEmpty (PredicateFailure (EraRule "LEDGER" era))) (GovActionId (EraCrypto era))) Source #

Submits a transaction that proposes the given proposal

submitVote ∷ (ShelleyEraImp era, ConwayEraTxBody era, HasCallStack) ⇒ VoteVoter (EraCrypto era) → GovActionId (EraCrypto era) → ImpTestM era (TxId (EraCrypto era)) Source #

Submits a transaction with a Vote for the given governance action as some voter

submitYesVote_ ∷ (ShelleyEraImp era, ConwayEraTxBody era, HasCallStack) ⇒ Voter (EraCrypto era) → GovActionId (EraCrypto era) → ImpTestM era () Source #

Submits a transaction that votes Yes for the given governance action as some voter

trySubmitVote ∷ (ShelleyEraImp era, ConwayEraTxBody era) ⇒ VoteVoter (EraCrypto era) → GovActionId (EraCrypto era) → ImpTestM era (Either (NonEmpty (PredicateFailure (EraRule "LEDGER" era))) (TxId (EraCrypto era))) Source #

Submits a transaction that votes Yes for the given governance action as some voter, and expects an Either result.

registerDRepConwayEraImp era ⇒ ImpTestM era (KeyHash 'DRepRole (EraCrypto era)) Source #

Submit a transaction that registers a new DRep and return the keyhash belonging to that DRep

unRegisterDRep ∷ ∀ era. (ShelleyEraImp era, ConwayEraTxCert era) ⇒ Credential 'DRepRole (EraCrypto era) → ImpTestM era () Source #

Submit a transaction that unregisters a given DRep

updateDRep ∷ ∀ era. (ShelleyEraImp era, ConwayEraTxCert era) ⇒ Credential 'DRepRole (EraCrypto era) → ImpTestM era () Source #

Submit a transaction that updates a given DRep

setupSingleDRepConwayEraImp era ⇒ IntegerImpTestM era (Credential 'DRepRole (EraCrypto era), Credential 'Staking (EraCrypto era), KeyPair 'Payment (EraCrypto era)) Source #

Registers a new DRep, registers its stake credentials and delegates the specified amount of ADA to it.

setupDRepWithoutStakeConwayEraImp era ⇒ ImpTestM era (KeyHash 'DRepRole (EraCrypto era), KeyHash 'Staking (EraCrypto era)) Source #

In contrast to setupSingleDRep, this function does not make a UTxO entry that could count as delegated stake to the DRep

setupPoolWithStake ∷ (ShelleyEraImp era, ConwayEraTxCert era) ⇒ CoinImpTestM era (KeyHash 'StakePool (EraCrypto era), Credential 'Payment (EraCrypto era), Credential 'Staking (EraCrypto era)) Source #

Sets up a stake pool with coin delegated to it.

NOTE: This uses the RegDepositDelegTxCert for delegating, so it has to be in Conway. The Shelley version of this function would have to separately register the staking credential and then delegate it.

conwayModifyPParamsConwayEraGov era ⇒ (PParams era → PParams era) → ImpTestM era () Source #

Modify the PParams in the current state with the given function

getGovActionState ∷ (HasCallStack, ConwayEraGov era) ⇒ GovActionId (EraCrypto era) → ImpTestM era (GovActionState era) Source #

Looks up the governance action state corresponding to the governance action id

lookupGovActionStateConwayEraGov era ⇒ GovActionId (EraCrypto era) → ImpTestM era (Maybe (GovActionState era)) Source #

Looks up the governance action state corresponding to the governance action id

getRatifyEnvConwayEraGov era ⇒ ImpTestM era (RatifyEnv era) Source #

Builds a RatifyEnv from the current state

calculateDRepAcceptedRatio ∷ ∀ era. (HasCallStack, ConwayEraGov era) ⇒ GovActionId (EraCrypto era) → ImpTestM era Rational Source #

Calculates the ratio of DReps that have voted for the governance action

calculateCommitteeAcceptedRatio ∷ ∀ era. (HasCallStack, ConwayEraGov era) ⇒ GovActionId (EraCrypto era) → ImpTestM era Rational Source #

Calculates the ratio of Committee members that have voted for the governance action

logAcceptedRatio ∷ (HasCallStack, ConwayEraGov era) ⇒ GovActionId (EraCrypto era) → ImpTestM era () Source #

Logs the ratios of accepted votes per category

isDRepAccepted ∷ (HasCallStack, ConwayEraGov era, ConwayEraPParams era) ⇒ GovActionId (EraCrypto era) → ImpTestM era Bool Source #

Checks whether the governance action has enough DRep votes to be accepted in the next epoch. (Note that no other checks except DRep votes are used)

logRatificationChecks ∷ (ConwayEraGov era, ConwayEraPParams era, HasCallStack) ⇒ GovActionId (EraCrypto era) → ImpTestM era () Source #

Logs the results of each check required to make the governance action pass

resignCommitteeColdKey ∷ (ShelleyEraImp era, ConwayEraTxCert era) ⇒ Credential 'ColdCommitteeRole (EraCrypto era) → StrictMaybe (Anchor (EraCrypto era)) → ImpTestM era (Maybe (Credential 'HotCommitteeRole (EraCrypto era))) Source #

Submits a transaction that resigns the cold key. Prior to resignation if there was hot credential authorization for this committee member it will be returned.

registerCommitteeHotKey ∷ (ShelleyEraImp era, ConwayEraTxCert era) ⇒ Credential 'ColdCommitteeRole (EraCrypto era) → ImpTestM era (Credential 'HotCommitteeRole (EraCrypto era)) Source #

Submits a transaction that registers a hot key for the given cold key. Returns the hot key hash.

constitutionShouldBe ∷ (HasCallStack, ConwayEraGov era) ⇒ StringImpTestM era () Source #

Asserts that the URL of the current constitution is equal to the given string

ccShouldBeResignedHasCallStackCredential 'ColdCommitteeRole (EraCrypto era) → ImpTestM era () Source #

Test the resignation status for a CC cold key to be resigned

ccShouldNotBeResignedHasCallStackCredential 'ColdCommitteeRole (EraCrypto era) → ImpTestM era () Source #

Test the resignation status for a CC cold key to not be resigned

submitUpdateCommittee Source #

Arguments

ConwayEraImp era 
Maybe (StrictMaybe (GovPurposeId 'CommitteePurpose era))

Set the parent. When Nothing is supplied latest parent will be used.

Set (Credential 'ColdCommitteeRole (EraCrypto era))

CC members to remove

→ [(Credential 'ColdCommitteeRole (EraCrypto era), EpochInterval)]

CC members to add

UnitInterval 
ImpTestM era (GovActionId (EraCrypto era)) 

minorFollowProtVerProtVer Source #

A legal ProtVer that differs in the minor Version

majorFollowProtVerProtVer Source #

A legal ProtVer that moves to the next major Version

cantFollowProtVerProtVer Source #

An illegal ProtVer that skips 3 minor versions

getsPParamsEraGov era ⇒ Lens' (PParams era) a → ImpTestM era a Source #

ifBootstrapEraGov era ⇒ ImpTestM era a → ImpTestM era a → ImpTestM era a Source #

whenPostBootstrapEraGov era ⇒ ImpTestM era () → ImpTestM era () Source #

showConwayTxBalance ∷ (EraUTxO era, ConwayEraTxBody era, Tx era ~ AlonzoTx era) ⇒ PParams era → CertState era → UTxO era → AlonzoTx era → String Source #

logConwayTxBalance ∷ (EraUTxO era, EraGov era, ConwayEraTxBody era, Tx era ~ AlonzoTx era) ⇒ AlonzoTx era → ImpTestM era () Source #

Orphan instances

ShelleyEraImp (ConwayEra c) ⇒ AlonzoEraImp (ConwayEra c) Source # 
Instance details

(Crypto c, NFData (SigDSIGN (DSIGN c)), NFData (VerKeyDSIGN (DSIGN c)), ADDRHASH c ~ Blake2b_224, DSIGN c ~ Ed25519DSIGN, Signable (DSIGN c) (Hash (HASH c) EraIndependentTxBody)) ⇒ MaryEraImp (ConwayEra c) Source # 
Instance details

(Crypto c, NFData (SigDSIGN (DSIGN c)), NFData (VerKeyDSIGN (DSIGN c)), ADDRHASH c ~ Blake2b_224, DSIGN c ~ Ed25519DSIGN, Signable (DSIGN c) (Hash (HASH c) EraIndependentTxBody), Eq (ConwayGovEvent (ConwayEra c))) ⇒ ShelleyEraImp (ConwayEra c) Source # 
Instance details