Struct monero::blockdata::transaction::Transaction
source · pub struct Transaction {
pub prefix: TransactionPrefix,
pub signatures: Vec<Vec<Signature>>,
pub rct_signatures: RctSig,
}
Expand description
A full transaction containing the prefix and all the signing data.
As transaction implements hash::Hashable
it is possible to generate the transaction hash
with tx.hash()
.
Fields§
§prefix: TransactionPrefix
The transaction prefix.
signatures: Vec<Vec<Signature>>
The signatures.
rct_signatures: RctSig
The RingCT signatures.
Implementations§
source§impl Transaction
impl Transaction
sourcepub fn prefix(&self) -> &TransactionPrefix
pub fn prefix(&self) -> &TransactionPrefix
Return the transaction prefix.
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>
) -> Result<Vec<OwnedTxOut<'_>>, Error>
pub fn check_outputs(
&self,
pair: &ViewPair,
major: Range<u32>,
minor: Range<u32>
) -> Result<Vec<OwnedTxOut<'_>>, Error>
Iterate over transaction outputs and find outputs related to view pair.
sourcepub fn check_outputs_with(
&self,
checker: &SubKeyChecker<'_>
) -> Result<Vec<OwnedTxOut<'_>>, Error>
pub fn check_outputs_with(
&self,
checker: &SubKeyChecker<'_>
) -> Result<Vec<OwnedTxOut<'_>>, Error>
Iterate over transaction outputs using the provided SubKeyChecker
to find outputs
related to the SubKeyChecker
’s view pair.
sourcepub fn signature_hash(&self) -> Result<Hash, SignatureHashError>
Available on crate feature experimental
only.
pub fn signature_hash(&self) -> Result<Hash, SignatureHashError>
experimental
only.Compute the message to be signed by the CLSAG signature algorithm.
The message consists of three parts:
- The hash of the transaction prefix.
- The hash of a consensus-encoded
RctSigBase
. - The hash of all bulletproofs.
Trait Implementations§
source§impl Clone for Transaction
impl Clone for Transaction
source§fn clone(&self) -> Transaction
fn clone(&self) -> Transaction
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 Transaction
impl Debug for Transaction
source§impl Decodable for Transaction
impl Decodable for Transaction
source§fn consensus_decode<R: Read + ?Sized>(r: &mut R) -> Result<Transaction, Error>
fn consensus_decode<R: Read + ?Sized>(r: &mut R) -> Result<Transaction, Error>
Decode an object with a well-defined format.
source§impl Default for Transaction
impl Default for Transaction
source§fn default() -> Transaction
fn default() -> Transaction
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for Transaction
impl<'de> Deserialize<'de> for Transaction
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 Transaction
impl Display for Transaction
source§impl Encodable for Transaction
impl Encodable for Transaction
source§impl Hashable for Transaction
impl Hashable for Transaction
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<Transaction> for Transaction
impl PartialEq<Transaction> for Transaction
source§fn eq(&self, other: &Transaction) -> bool
fn eq(&self, other: &Transaction) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.