cardano-ledger-shelley-0.1.0.0
Safe Haskell None
Language Haskell2010

Cardano.Ledger.Shelley.UTxO

Synopsis

Primitives

newtype UTxO era Source #

The unspent transaction outputs.

Constructors

UTxO

Fields

Instances

Instances details
( Eq ( TxOut era), Crypto ( Crypto era)) => Eq ( UTxO era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.UTxO

( Show ( TxOut era), Crypto ( Crypto era)) => Show ( UTxO era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.UTxO

Generic ( UTxO era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.UTxO

Associated Types

type Rep ( UTxO era) :: Type -> Type Source #

Semigroup ( UTxO era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.UTxO

Crypto ( Crypto era) => Monoid ( UTxO era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.UTxO

( Era era, NFData ( TxOut era)) => NFData ( UTxO era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.UTxO

Methods

rnf :: UTxO era -> () Source #

( Era era, ToCBOR ( TxOut era)) => ToCBOR ( UTxO era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.UTxO

( FromCBOR ( TxOut era), Era era) => FromCBOR ( UTxO era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.UTxO

( Crypto ( Crypto era), FromSharedCBOR ( TxOut era), Share ( TxOut era) ~ Interns ( Credential ' Staking ( Crypto era))) => FromSharedCBOR ( UTxO era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.UTxO

Associated Types

type Share ( UTxO era) Source #

Default ( UTxO era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.UTxO

TransUTxO NoThunks era => NoThunks ( UTxO era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.UTxO

type Rep ( UTxO era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.UTxO

type Rep ( UTxO era) = D1 (' MetaData "UTxO" "Cardano.Ledger.Shelley.UTxO" "cardano-ledger-shelley-0.1.0.0-4LNBTpyKcsy6EW18a3tTt2" ' True ) ( C1 (' MetaCons "UTxO" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "unUTxO") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( Map ( TxIn ( Crypto era)) ( TxOut era)))))
type Share ( UTxO era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.UTxO

Functions

txins :: HasField "inputs" ( TxBody era) ( Set ( TxIn ( Crypto era))) => TxBody era -> Set ( TxIn ( Crypto era)) Source #

Compute the UTxO inputs of a transaction. txins has the same problems as txouts, see notes below.

txinLookup :: TxIn ( Crypto era) -> UTxO era -> Maybe ( TxOut era) Source #

Lookup a txin for a given UTxO collection

txouts :: forall era. Era era => TxBody era -> UTxO era Source #

Compute the transaction outputs of a transaction.

txup :: forall era tx. ( HasField "update" ( TxBody era) ( StrictMaybe ( Update era)), HasField "body" tx ( TxBody era)) => tx -> Maybe ( Update era) Source #

balance :: forall era. Era era => UTxO era -> Value era Source #

Determine the total balance contained in the UTxO.

sumAllValue :: forall era tx f. ( Foldable f, HasField "value" tx ( Value era), Monoid ( Value era)) => f tx -> Value era Source #

Sum all the value in any Foldable with elements that have a field "value"

totalDeposits :: ( HasField "_poolDeposit" pp Coin , HasField "_keyDeposit" pp Coin ) => pp -> ( KeyHash ' StakePool crypto -> Bool ) -> [ DCert crypto] -> Coin Source #

Determine the total deposit amount needed. The block may (legitimately) contain multiple registration certificates for the same pool, where the first will be treated as a registration and any subsequent ones as re-registration. As such, we must only take a deposit for the first such registration.

Note that this is not an issue for key registrations since subsequent registration certificates would be invalid.

makeWitnessesFromScriptKeys :: ( Crypto crypto, DSignable crypto ( Hash crypto EraIndependentTxBody )) => SafeHash crypto EraIndependentTxBody -> Map ( KeyHash kr crypto) ( KeyPair kr crypto) -> Set ( KeyHash kr crypto) -> Set ( WitVKey ' Witness crypto) Source #

From a list of key pairs and a set of key hashes required for a multi-sig scripts, return the set of required keys.

verifyWitVKey :: ( Typeable kr, Crypto crypto, DSignable crypto ( Hash crypto EraIndependentTxBody )) => Hash crypto EraIndependentTxBody -> WitVKey kr crypto -> Bool Source #

Verify a transaction body witness

getScriptHash :: Addr crypto -> Maybe ( ScriptHash crypto) Source #

Extract script hash from value address with script.

scriptsNeeded :: forall era tx. ( Era era, HasField "body" tx ( TxBody era), HasField "certs" ( TxBody era) ( StrictSeq ( DCert ( Crypto era))), HasField "wdrls" ( TxBody era) ( Wdrl ( Crypto era)), HasField "inputs" ( TxBody era) ( Set ( TxIn ( Crypto era)))) => UTxO era -> tx -> Set ( ScriptHash ( Crypto era)) Source #

Computes the set of script hashes required to unlock the transcation inputs and the withdrawals.

Utilities