cooked-validators-4.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cooked.Tweak.Signers

Description

This module defines Tweaks revolving around the signers of a transaction. They assume but do not ensure that the list of signers is free of duplicates.

Synopsis

Documentation

getSignersTweak :: MonadTweak m => m [Wallet] Source #

Returns the current list of signers

modifySignersTweak :: MonadTweak m => ([Wallet] -> [Wallet]) -> m [Wallet] Source #

Apply a function to the list of signers and return the old ones

setSignersTweak :: MonadTweak m => [Wallet] -> m [Wallet] Source #

Change the current signers and return the old ones

signersSatisfyTweak :: MonadTweak m => ([Wallet] -> Bool) -> m Bool Source #

Check if the signers satisfy a certain predicate

isSignerTweak :: MonadTweak m => Wallet -> m Bool Source #

Check if a wallet signs a transaction

hasSignersTweak :: MonadTweak m => m Bool Source #

Check if the transaction has at least a signer

addFirstSignerTweak :: MonadTweak m => Wallet -> m [Wallet] Source #

Add a signer to the transaction, at the head of the list of signers, and return the old list of signers

addSignersTweak :: MonadTweak m => [Wallet] -> m [Wallet] Source #

Add signers at the end of the list of signers, and return the old list of signers

addLastSignerTweak :: MonadTweak m => Wallet -> m [Wallet] Source #

Add a signer to the transaction, at the end of the list of signers, and return the old list of signers

removeSignersTweak :: MonadTweak m => [Wallet] -> m [Wallet] Source #

Remove signers from the transaction and return the old list of signers

removeSignerTweak :: MonadTweak m => Wallet -> m [Wallet] Source #

Remove a signer from the transaction and return the old list of signers

replaceFirstSignerTweak :: MonadTweak m => Wallet -> m [Wallet] Source #

Changes the first signer (adds it if there are no signers) and return the old list of signers.