Struct monero::blockdata::transaction::TransactionPrefix
source · pub struct TransactionPrefix {
pub version: VarInt,
pub unlock_time: VarInt,
pub inputs: Vec<TxIn>,
pub outputs: Vec<TxOut>,
pub extra: RawExtraField,
}
Expand description
The part of the transaction that contains all the data except signatures.
As transaction prefix implements hash::Hashable
it is possible to generate the transaction
prefix hash with tx_prefix.hash()
.
Fields§
§version: VarInt
Transaction format version.
unlock_time: VarInt
The transaction can not be spend until after a certain number of blocks, or until a certain time.
inputs: Vec<TxIn>
Array of inputs.
outputs: Vec<TxOut>
Array of outputs.
extra: RawExtraField
Additional data associated with a transaction.
Implementations§
source§impl TransactionPrefix
impl TransactionPrefix
sourcepub fn nb_outputs(&self) -> usize
pub fn nb_outputs(&self) -> usize
Return the number of transaction’s outputs.
sourcepub fn check_outputs(
&self,
pair: &ViewPair,
major: Range<u32>,
minor: Range<u32>,
rct_sig_base: Option<&RctSigBase>
) -> Result<Vec<OwnedTxOut<'_>>, Error>
pub fn check_outputs(
&self,
pair: &ViewPair,
major: Range<u32>,
minor: Range<u32>,
rct_sig_base: Option<&RctSigBase>
) -> Result<Vec<OwnedTxOut<'_>>, Error>
Iterate over transaction outputs and find outputs related to view pair.
sourcepub fn check_outputs_with(
&self,
checker: &SubKeyChecker<'_>,
rct_sig_base: Option<&RctSigBase>
) -> Result<Vec<OwnedTxOut<'_>>, Error>
pub fn check_outputs_with(
&self,
checker: &SubKeyChecker<'_>,
rct_sig_base: Option<&RctSigBase>
) -> Result<Vec<OwnedTxOut<'_>>, Error>
Iterate over transaction outputs using the provided SubKeyChecker
to find outputs
related to the SubKeyChecker
’s view pair.
Trait Implementations§
source§impl Clone for TransactionPrefix
impl Clone for TransactionPrefix
source§fn clone(&self) -> TransactionPrefix
fn clone(&self) -> TransactionPrefix
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for TransactionPrefix
impl Debug for TransactionPrefix
source§impl Decodable for TransactionPrefix
impl Decodable for TransactionPrefix
source§fn consensus_decode<R: Read + ?Sized>(
r: &mut R
) -> Result<TransactionPrefix, Error>
fn consensus_decode<R: Read + ?Sized>(
r: &mut R
) -> Result<TransactionPrefix, Error>
Decode an object with a well-defined format.
source§impl Default for TransactionPrefix
impl Default for TransactionPrefix
source§fn default() -> TransactionPrefix
fn default() -> TransactionPrefix
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for TransactionPrefix
impl<'de> Deserialize<'de> for TransactionPrefix
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for TransactionPrefix
impl Display for TransactionPrefix
source§impl Encodable for TransactionPrefix
impl Encodable for TransactionPrefix
source§impl Hashable for TransactionPrefix
impl Hashable for TransactionPrefix
source§fn hash_to_scalar(&self) -> PrivateKey
fn hash_to_scalar(&self) -> PrivateKey
Apply
hash()
on itself and return the interpreted scalar returned by the hash result.source§impl PartialEq<TransactionPrefix> for TransactionPrefix
impl PartialEq<TransactionPrefix> for TransactionPrefix
source§fn eq(&self, other: &TransactionPrefix) -> bool
fn eq(&self, other: &TransactionPrefix) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.