cardano-ledger-conway-1.19.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 #

Instances

Instances details
ConwayEraImp ConwayEra Source # 
Instance details

Defined in Test.Cardano.Ledger.Conway.ImpTest

trySubmitGovAction ∷ (ShelleyEraImp era, ConwayEraTxBody era) ⇒ GovAction era → ImpTestM era (Either (NonEmpty (PredicateFailure (EraRule "LEDGER" era))) GovActionId) 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) Source #

Submits a transaction that proposes the given proposal

submitVote ∷ (ShelleyEraImp era, ConwayEraTxBody era, HasCallStack) ⇒ VoteVoterGovActionIdImpTestM era TxId Source #

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

submitYesVote_ ∷ (ShelleyEraImp era, ConwayEraTxBody era, HasCallStack) ⇒ VoterGovActionIdImpTestM era () Source #

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

trySubmitVote ∷ (ShelleyEraImp era, ConwayEraTxBody era) ⇒ VoteVoterGovActionIdImpTestM era (Either (NonEmpty (PredicateFailure (EraRule "LEDGER" era))) TxId) 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) Source #

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

unRegisterDRep ∷ ∀ era. (ShelleyEraImp era, ConwayEraTxCert era) ⇒ Credential 'DRepRoleImpTestM era () Source #

Submit a transaction that unregisters a given DRep

updateDRep ∷ ∀ era. (ShelleyEraImp era, ConwayEraTxCert era) ⇒ Credential 'DRepRoleImpTestM era () Source #

Submit a transaction that updates a given DRep

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

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

setupDRepWithoutStakeConwayEraImp era ⇒ ImpTestM era (KeyHash 'DRepRole, KeyHash 'Staking) 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, Credential 'Payment, Credential 'Staking) 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) ⇒ GovActionIdImpTestM era (GovActionState era) Source #

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

lookupGovActionStateConwayEraGov era ⇒ GovActionIdImpTestM 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) ⇒ GovActionIdImpTestM era Rational Source #

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

calculateCommitteeAcceptedRatio ∷ ∀ era. (HasCallStack, ConwayEraGov era) ⇒ GovActionIdImpTestM era Rational Source #

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

logAcceptedRatio ∷ (HasCallStack, ConwayEraGov era) ⇒ GovActionIdImpTestM era () Source #

Logs the ratios of accepted votes per category

isDRepAccepted ∷ (HasCallStack, ConwayEraGov era, ConwayEraPParams era) ⇒ GovActionIdImpTestM 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) ⇒ GovActionIdImpTestM era () Source #

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

resignCommitteeColdKey ∷ (ShelleyEraImp era, ConwayEraTxCert era) ⇒ Credential 'ColdCommitteeRoleStrictMaybe AnchorImpTestM era (Maybe (Credential 'HotCommitteeRole)) 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 'ColdCommitteeRoleImpTestM era (Credential 'HotCommitteeRole) Source #

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

ccShouldBeResignedHasCallStackCredential 'ColdCommitteeRoleImpTestM era () Source #

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

ccShouldNotBeResignedHasCallStackCredential 'ColdCommitteeRoleImpTestM era () Source #

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

mkUpdateCommitteeProposal Source #

Arguments

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

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

Set (Credential 'ColdCommitteeRole)

CC members to remove

→ [(Credential 'ColdCommitteeRole, EpochInterval)]

CC members to add

UnitInterval 
ImpTestM era (ProposalProcedure era) 

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)

CC members to remove

→ [(Credential 'ColdCommitteeRole, EpochInterval)]

CC members to add

UnitInterval 
ImpTestM era GovActionId 

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 #

whenBootstrapEraGov era ⇒ ImpTestM era () → ImpTestM era () 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 #

submitBootstrapAwareEraGov era ⇒ ImpTestM era a → (NonEmpty (PredicateFailure (EraRule "LEDGER" era)) → ImpTestM era a) → SubmitFailureExpectation era → ImpTestM era a Source #

data FailBoth era Source #

Constructors

FailBoth 

Orphan instances