cooked-validators
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cooked.MockChain.GenerateTx.Witness

Description

This module exposes the generation of witnesses and reward account

Synopsis

Documentation

toRewardAccount :: MonadBlockChainBalancing m => Credential -> m RewardAccount Source #

Translates a given credential to a reward account.

toCardanoCredential :: (MonadBlockChainBalancing m, SerialiseAsRawBytes (Hash key)) => AsType key -> (Hash key -> KeyHash kr) -> Credential -> m (Credential kr) Source #

Converts an Credential to a Cardano Credential of the expected kind

toScriptWitness :: (MonadBlockChainBalancing m, ToVScript a) => a -> TxSkelRedeemer -> ScriptDatum b -> m (ScriptWitness b ConwayEra) Source #

Translates a script with its associated redeemer and datum to a script witness. Note on the usage of zeroExecutionUnits: at this stage of the transaction create, we cannot know the execution units used by the script. They will be filled out later on once the full body has been generated. So, for now, we temporarily leave them to 0.

toKeyWitness :: TxBody ConwayEra -> TxSkelSignatory -> Maybe (KeyWitness ConwayEra) Source #

Generates a key witnesses for a given signatory and body, when the signatory contains a private key.

toStakeCredential :: MonadBlockChainBalancing m => Credential -> m (Credential 'Staking) Source #

Translates a credential into a Cardano stake credential

toScriptHash :: MonadBlockChainBalancing m => ScriptHash -> m ScriptHash Source #

Converts a plutus script hash into a cardano ledger script hash

toKeyHash :: (MonadBlockChainBalancing m, SerialiseAsRawBytes (Hash key)) => AsType key -> (Hash key -> KeyHash kr) -> PubKeyHash -> m (KeyHash kr) Source #

Converts a plutus pkhash into a certain cardano ledger hash

toDRepCredential :: MonadBlockChainBalancing m => Credential -> m (Credential 'DRepRole) Source #

Translates a credential into a Cardano drep credential

toStakePoolKeyHash :: MonadBlockChainBalancing m => PubKeyHash -> m (KeyHash 'StakePool) Source #

Converts an PubKeyHash into a cardano ledger stake pool key hash

toColdCredential :: MonadBlockChainBalancing m => Credential -> m (Credential 'ColdCommitteeRole) Source #

Translates a credential into a Cardano cold committee credential

toHotCredential :: MonadBlockChainBalancing m => Credential -> m (Credential 'HotCommitteeRole) Source #

Translates a credential into a Cardano hot committee credential

toVRFVerKeyHash :: MonadBlockChainBalancing m => PubKeyHash -> m (VRFVerKeyHash a) Source #

Converts an PubKeyHash into a cardano ledger VRFVerKeyHash