Trait handshakes::types::tx::HandshakeTransaction
source · [−]pub trait HandshakeTransaction: Transaction {
type WTXID: MarkedDigestOutput;
type Witness;
fn new<I, O, W>(
version: u32,
vin: I,
vout: O,
witnesses: W,
locktime: u32
) -> Result<Self, Self::TxError>
where
I: Into<Vec<Self::TxIn>>,
O: Into<Vec<Self::TxOut>>,
W: Into<Vec<Self::Witness>>,
Self: Sized;
fn wtxid(&self) -> Self::WTXID;
fn write_txid_preimage<W: Write>(
&self,
writer: &mut W
) -> Result<usize, Self::Error>;
fn write_wtxid_preimage<W: Write>(
&self,
writer: &mut W
) -> Result<usize, Self::Error>;
fn signature_hash(
&self,
args: &Self::SighashArgs
) -> Result<Blake2b256Digest, Self::TxError> { ... }
}
Expand description
Trait that describes a Handshake Transaction
Required Associated Types
The MarkedDigest type for the Transaction’s Witness TXID
Required Methods
Instantiate a new WitnessTx from the arguments.
Computes the txid preimage.
Provided Methods
fn signature_hash(
&self,
args: &Self::SighashArgs
) -> Result<Blake2b256Digest, Self::TxError>
fn signature_hash(
&self,
args: &Self::SighashArgs
) -> Result<Blake2b256Digest, Self::TxError>
Calculates the BIP143 sighash given the sighash args. See the
WitnessSighashArgsSigh
documentation for more in-depth discussion of sighash.