Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- adjustUTxO :: Tx -> UTxO -> UTxO
- genTxOut :: Gen (TxOut ctx)
- cardanoLedger :: Globals -> LedgerEnv LedgerEra -> Ledger Tx
- newLedgerEnv :: PParams LedgerEra -> LedgerEnv LedgerEra
- fromChainSlot :: ChainSlot -> SlotNo
- mkSimpleTx :: (TxIn, TxOut CtxUTxO) -> (AddressInEra, Value) -> SigningKey PaymentKey -> Either TxBodyError Tx
- mkRangedTx :: (TxIn, TxOut CtxUTxO) -> (AddressInEra, Value) -> SigningKey PaymentKey -> (Maybe TxValidityLowerBound, Maybe TxValidityUpperBound) -> Either TxBodyError Tx
- genSequenceOfSimplePaymentTransactions :: Gen (UTxO, [Tx])
- genFixedSizeSequenceOfSimplePaymentTransactions :: Int -> Gen (UTxO, [Tx])
- generateOneRandomTransfer :: NetworkId -> (UTxO, SigningKey PaymentKey, [Tx]) -> Int -> Gen (UTxO, SigningKey PaymentKey, [Tx])
- mkOneTransfer :: NetworkId -> SigningKey PaymentKey -> (UTxO, SigningKey PaymentKey, [Tx]) -> Int -> (UTxO, SigningKey PaymentKey, [Tx])
- generateOneSelfTransfer :: NetworkId -> (UTxO, SigningKey PaymentKey, [Tx]) -> Int -> Gen (UTxO, SigningKey PaymentKey, [Tx])
- genTxOutByron :: Gen (TxOut ctx)
- genAdaOnlyUTxO :: Gen UTxO
- data ShelleyGenesis c = ShelleyGenesis {
- sgSystemStart :: !UTCTime
- sgNetworkMagic :: !Word32
- sgNetworkId :: !Network
- sgActiveSlotsCoeff :: !PositiveUnitInterval
- sgSecurityParam :: !Word64
- sgEpochLength :: !EpochSize
- sgSlotsPerKESPeriod :: !Word64
- sgMaxKESEvolutions :: !Word64
- sgSlotLength :: !NominalDiffTimeMicro
- sgUpdateQuorum :: !Word64
- sgMaxLovelaceSupply :: !Word64
- sgProtocolParams :: !(PParams (ShelleyEra c))
- sgGenDelegs :: !(Map (KeyHash 'Genesis c) (GenDelegPair c))
- sgInitialFunds :: ListMap (Addr c) Coin
- sgStaking :: ShelleyGenesisStaking c
- data Globals
- data LedgerEnv era
- type Tx = Tx Era
Documentation
adjustUTxO :: Tx -> UTxO -> UTxO Source #
genTxOut :: Gen (TxOut ctx) Source #
Generate a Babbage
era TxOut
, which may contain arbitrary assets
addressed to public keys and scripts, as well as datums.
NOTE: This generator does * not produce byron addresses as most of the cardano ecosystem dropped support for that (including plutus), * not produce reference scripts as they are not fully "visible" from plutus, * replace stake pointers with null references as nobody uses that.
cardanoLedger :: Globals -> LedgerEnv LedgerEra -> Ledger Tx Source #
Use the cardano-ledger as an in-hydra Ledger
.
newLedgerEnv :: PParams LedgerEra -> LedgerEnv LedgerEra Source #
Create a new ledger env from given protocol parameters.
fromChainSlot :: ChainSlot -> SlotNo Source #
Simple conversion from a generic slot to a specific local one.
:: (TxIn, TxOut CtxUTxO) | |
-> (AddressInEra, Value) | Recipient address and amount. |
-> SigningKey PaymentKey | Sender's signing key. |
-> Either TxBodyError Tx |
Create a zero-fee, payment cardano transaction.
:: (TxIn, TxOut CtxUTxO) | |
-> (AddressInEra, Value) | Recipient address and amount. |
-> SigningKey PaymentKey | Sender's signing key. |
-> (Maybe TxValidityLowerBound, Maybe TxValidityUpperBound) | |
-> Either TxBodyError Tx |
Create a zero-fee, payment cardano transaction with validity range.
genSequenceOfSimplePaymentTransactions :: Gen (UTxO, [Tx]) Source #
Generates a sequence of simple "transfer" transactions for a single key.
The kind of transactions produced by this generator is very limited, see generateOneTransfer
.
genFixedSizeSequenceOfSimplePaymentTransactions :: Int -> Gen (UTxO, [Tx]) Source #
generateOneRandomTransfer :: NetworkId -> (UTxO, SigningKey PaymentKey, [Tx]) -> Int -> Gen (UTxO, SigningKey PaymentKey, [Tx]) Source #
mkOneTransfer :: NetworkId -> SigningKey PaymentKey -> (UTxO, SigningKey PaymentKey, [Tx]) -> Int -> (UTxO, SigningKey PaymentKey, [Tx]) Source #
generateOneSelfTransfer :: NetworkId -> (UTxO, SigningKey PaymentKey, [Tx]) -> Int -> Gen (UTxO, SigningKey PaymentKey, [Tx]) Source #
genTxOutByron :: Gen (TxOut ctx) Source #
Generate a TxOut
with a byron address. This is usually not supported by
Hydra or Plutus.
genAdaOnlyUTxO :: Gen UTxO Source #
Generate UTXO entries that do not contain any assets. Useful to test / measure cases where
data ShelleyGenesis c #
ShelleyGenesis | |
|
Instances
Instances
Instances
Generic (LedgerEnv era) | |
Show (PParams era) => Show (LedgerEnv era) | |
NFData (PParams era) => NFData (LedgerEnv era) | |
Defined in Cardano.Ledger.Shelley.Rules.Ledger | |
Eq (PParams era) => Eq (LedgerEnv era) | |
type Rep (LedgerEnv era) | |
Defined in Cardano.Ledger.Shelley.Rules.Ledger type Rep (LedgerEnv era) = D1 ('MetaData "LedgerEnv" "Cardano.Ledger.Shelley.Rules.Ledger" "cardano-ledger-shelley-1.12.2.0-JOV1R4NImAaAOjQOsNzw3u" 'False) (C1 ('MetaCons "LedgerEnv" 'PrefixI 'True) ((S1 ('MetaSel ('Just "ledgerSlotNo") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 SlotNo) :*: S1 ('MetaSel ('Just "ledgerIx") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 TxIx)) :*: (S1 ('MetaSel ('Just "ledgerPp") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (PParams era)) :*: S1 ('MetaSel ('Just "ledgerAccount") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 AccountState)))) |