Struct bitcoins::types::witness::WitnessTx[][src]

pub struct WitnessTx { /* fields omitted */ }
Expand description

A witness transaction. Any transaction that contains 1 or more witnesses.

Implementations

Consumes a LegacyTx and instantiates a new WitnessTx with empty witnesses

Trait Implementations

Returns a reference to the tx as a legacy tx.

Consume the tx and convert it to a legacy tx. Useful for when you have dyn BitcoinTransaction or impl BitcoinTransaction types. Read more

Consume the tx and convert it to a legacy tx. Useful for when you have dyn BitcoinTransaction or impl BitcoinTransaction types, but into_witness should be preferred, as it will never drop information. Read more

Return a reference to a slice of witnesses. For legacy txins this will ALWAYS be length 0. For witness txns, this will ALWAYS be the same length as the input vector. Read more

Get a reference to the output by

An associated error type

Returns the byte-length of the serialized data structure.

Deserializes an instance of Self from a std::io::Read. The limit argument is used only when deserializing collections, and specifies a maximum number of instances of the underlying type to read. Read more

Serializes self to a std::io::Write. Following Write trait conventions, its Ok type must be a usize denoting the number of bytes written. Read more

Read a sequence of exactly limit objects from the reader.

Write a sequence of ByteFormat objects to a writer. The iter argument may be any object that implements IntoIterator<Item = &Item>. This means we can seamlessly use vectors, slices, etc. Read more

Decodes a hex string to a Vec<u8>, deserializes an instance of Self from that vector.

Serialize self to a base64 string, using standard RFC4648 non-url safe characters

Serializes self to a vector, returns the hex-encoded vector

Serialize self to a base64 string, using standard RFC4648 non-url safe characters

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

An associated error type, used in Results returned by the Transaction.

The Input type for the transaction

The Output type for the transaction

A type describing arguments for the sighash function for this transaction.

A marked hash (see crate::hashes::marked) to be used as the transaction ID type.

A type that implements HashWriter. Used to generate the TXID and Sighash.

Instantiate a new Transaction by specifying inputs and outputs.

Returns a reference to the transaction input vector

Returns a reference the the transaction output vector

Returns the transaction version number

Returns the transaction’s nLocktime field

Calculates and returns the transaction’s ID. The default TXID is simply the digest of the serialized transaction. Read more

Generate the digest that must be signed to authorize inputs. For Bitcoin transactions this is a function of the transaction, and the input’s prevout. Read more

Calls write_sighash_preimage with the provided arguments and a new HashWriter. Returns the sighash digest which should be signed. Read more

Create a new WitnessTx. Since witnesses correspond to inputs, ensure that there are the same number of witnesses as inputs. The number of witnesses will be trimmed if there are too many and will be filled with empty witnesses if too few.

The MarkedDigest type for the Transaction’s Witness TXID

The BIP143 sighash args needed to sign an input

A type that represents this transactions per-input Witness.

Calculates the witness txid of the transaction.

Writes the Legacy sighash preimage to the provider writer.

Writes the BIP143 sighash preimage to the provided writer. See the WitnessSighashArgsSigh documentation for more in-depth discussion of sighash. Read more

Calculates the Legacy sighash preimage given the sighash args.

Calculates the BIP143 sighash given the sighash args. See the WitnessSighashArgsSigh documentation for more in-depth discussion of sighash. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.