Enum pallas_traverse::MultiEraTx
source · #[non_exhaustive]pub enum MultiEraTx<'b> {
AlonzoCompatible(Box<Cow<'b, MintedTx<'b>>>, Era),
Babbage(Box<Cow<'b, MintedTx<'b>>>),
Byron(Box<Cow<'b, MintedTxPayload<'b>>>),
}
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AlonzoCompatible(Box<Cow<'b, MintedTx<'b>>>, Era)
Babbage(Box<Cow<'b, MintedTx<'b>>>)
Byron(Box<Cow<'b, MintedTxPayload<'b>>>)
Implementations§
source§impl<'b> MultiEraTx<'b>
impl<'b> MultiEraTx<'b>
pub fn from_byron(tx: &'b MintedTxPayload<'b>) -> Self
pub fn from_alonzo_compatible(tx: &'b MintedTx<'b>, era: Era) -> Self
pub fn from_babbage(tx: &'b MintedTx<'b>) -> Self
pub fn encode(&self) -> Vec<u8> ⓘ
pub fn decode(era: Era, cbor: &'b [u8]) -> Result<Self, Error>
pub fn era(&self) -> Era
pub fn hash(&self) -> Hash<32>
pub fn outputs(&self) -> Vec<MultiEraOutput<'_>>
pub fn output_at(&self, index: usize) -> Option<MultiEraOutput<'_>>
pub fn inputs(&self) -> Vec<MultiEraInput<'_>>
pub fn reference_inputs(&self) -> Vec<MultiEraInput<'_>>
pub fn certs(&self) -> Vec<MultiEraCert<'_>>
pub fn mint(&self) -> MultiEraMint<'_>
pub fn collateral(&self) -> Vec<MultiEraInput<'_>>
pub fn collateral_return(&self) -> Option<MultiEraOutput<'_>>
sourcepub fn consumes(&self) -> Vec<MultiEraInput<'_>>
pub fn consumes(&self) -> Vec<MultiEraInput<'_>>
Returns the list of inputs consumed by the Tx
Helper method to abstract the logic of which inputs are consumed depending on the validity of the Tx. If the Tx is valid, this method will return the list of inputs. If the tx is invalid, it will return the collateral.
sourcepub fn produces(&self) -> Vec<(usize, MultiEraOutput<'_>)>
pub fn produces(&self) -> Vec<(usize, MultiEraOutput<'_>)>
Returns a list of tuples of the outputs produced by the Tx with their indexes
Helper method to abstract the logic of which outputs are produced depending on the validity of the Tx. If the Tx is valid, this method will return the list of outputs. If the Tx is invalid it will return the collateral return if one is present or an empty list if not. Note that the collateral return output index is defined as the next available index after the txouts (Babbage spec, ch 4).
sourcepub fn produces_at(&self, index: usize) -> Option<MultiEraOutput<'_>>
pub fn produces_at(&self, index: usize) -> Option<MultiEraOutput<'_>>
Returns the produced output at the given index if one exists
If the transaction is valid the outputs are produced, otherwise the
collateral return output is produced at index |outputs.len()| if one is
present. This function gets the produced output for an index if one
exists. It behaves exactly as outputs_at
for valid transactions, but
for invalid transactions it returns None except for if the index points
to the collateral-return output and one is present in the transaction,
in which case it returns the collateral-return output.
sourcepub fn requires(&self) -> Vec<MultiEraInput<'_>>
pub fn requires(&self) -> Vec<MultiEraInput<'_>>
Returns the list of UTxO required by the Tx
Helper method to yield all of the UTxO that the Tx requires in order to be fulfilled. This includes normal inputs, reference inputs and collateral.
pub fn withdrawals(&self) -> MultiEraWithdrawals<'_>
pub fn fee(&self) -> Option<u64>
pub fn metadata(&self) -> MultiEraMeta<'_>
pub fn required_signers(&self) -> MultiEraSigners<'_>
pub fn is_valid(&self) -> bool
pub fn as_babbage(&self) -> Option<&MintedTx<'_>>
pub fn as_alonzo(&self) -> Option<&MintedTx<'_>>
pub fn as_byron(&self) -> Option<&MintedTxPayload<'_>>
source§impl<'b> MultiEraTx<'b>
impl<'b> MultiEraTx<'b>
pub fn vkey_witnesses(&self) -> Option<&[VKeyWitness]>
pub fn native_scripts(&self) -> Option<&[NativeScript]>
pub fn bootstrap_witnesses(&self) -> Option<&[BootstrapWitness]>
pub fn plutus_v1_scripts(&self) -> Vec<&PlutusScript>
pub fn plutus_data(&self) -> Vec<&KeepRaw<'b, PlutusData>>
pub fn redeemers(&self) -> Option<&[Redeemer]>
pub fn plutus_v2_scripts(&self) -> Option<&[PlutusV2Script]>
Trait Implementations§
source§impl<'b> Clone for MultiEraTx<'b>
impl<'b> Clone for MultiEraTx<'b>
source§fn clone(&self) -> MultiEraTx<'b>
fn clone(&self) -> MultiEraTx<'b>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more