pub struct Tx {
pub version: TxVer,
pub inputs: Confined<Vec<TxIn>, 0, bc::::coding::VarIntArray::{constant#1}>,
pub outputs: Confined<Vec<TxOut>, 0, bc::::coding::VarIntArray::{constant#1}>,
pub lock_time: LockTime,
}
Fields§
§version: TxVer
§inputs: Confined<Vec<TxIn>, 0, bc::::coding::VarIntArray::{constant#1}>
§outputs: Confined<Vec<TxOut>, 0, bc::::coding::VarIntArray::{constant#1}>
§lock_time: LockTime
Implementations§
Source§impl Tx
impl Tx
pub fn inputs(&self) -> Iter<'_, TxIn>
pub fn outputs(&self) -> Iter<'_, TxOut>
pub fn is_segwit(&self) -> bool
pub fn to_unsigned_tx(&self) -> Tx
Sourcepub fn ntxid(&self) -> [u8; 32]
pub fn ntxid(&self) -> [u8; 32]
Computes a “normalized TXID” which does not include any signatures.
This gives a way to identify a transaction that is “the same” as another in the sense of having same inputs and outputs.
Sourcepub fn txid(&self) -> Txid
pub fn txid(&self) -> Txid
Computes the Txid
.
Hashes the transaction excluding the segwit data (i.e. the marker,
flag bytes, and the witness fields themselves). For non-segwit
transactions which do not have any segwit data, this will be equal
to Tx::wtxid()
.
Sourcepub fn wtxid(&self) -> Wtxid
pub fn wtxid(&self) -> Wtxid
Computes the segwit version of the transaction id.
Hashes the transaction including all segwit data (i.e. the marker,
flag bytes, and the witness fields themselves). For non-segwit
transactions which do not have any segwit data, this will be equal
to [Transaction::txid()
].
Trait Implementations§
Source§impl ConsensusDecode for Tx
impl ConsensusDecode for Tx
fn consensus_decode(reader: &mut impl Read) -> Result<Tx, ConsensusDecodeError>
fn consensus_deserialize( bytes: impl AsRef<[u8]>, ) -> Result<Self, ConsensusDecodeError>
Source§impl ConsensusEncode for Tx
impl ConsensusEncode for Tx
Source§impl ConvolveCommit<Commitment, TapretProof, TapretFirst> for Tx
impl ConvolveCommit<Commitment, TapretProof, TapretFirst> for Tx
Source§type Commitment = Tx
type Commitment = Tx
Commitment type produced as a result of
Self::convolve_commit
procedure.Source§type CommitError = TapretError
type CommitError = TapretError
Error type that may be reported during
Self::convolve_commit
procedure. It may also be returned from ConvolveCommitProof::verify
in case the proof data are invalid and the commitment can’t be
re-created.Source§fn convolve_commit(
&self,
supplement: &TapretProof,
msg: &Commitment,
) -> Result<(Tx, TapretProof), <Tx as ConvolveCommit<Commitment, TapretProof, TapretFirst>>::CommitError>
fn convolve_commit( &self, supplement: &TapretProof, msg: &Commitment, ) -> Result<(Tx, TapretProof), <Tx as ConvolveCommit<Commitment, TapretProof, TapretFirst>>::CommitError>
Takes the
supplement
to unparse the content of this container (self
)
(“convolves” these two data together) and uses them to produce a final
Self::Commitment
to the message msg
. Read moreSource§impl<'de> Deserialize<'de> for Tx
impl<'de> Deserialize<'de> for Tx
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Tx, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Tx, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl EmbedCommitVerify<Commitment, OpretFirst> for Tx
impl EmbedCommitVerify<Commitment, OpretFirst> for Tx
Source§type Proof = OpretProof
type Proof = OpretProof
The proof of the commitment produced as a result of
Self::embed_commit
procedure. This proof is later used
for verification.Source§type CommitError = OpretError
type CommitError = OpretError
Error type that may be reported during
Self::embed_commit
procedure.
It may also be returned from Self::verify
(wrapped into
EmbedVerifyError
in case the proof data are invalid and the
commitment can’t be re-created.Source§fn embed_commit(
&mut self,
msg: &Commitment,
) -> Result<<Tx as EmbedCommitVerify<Commitment, OpretFirst>>::Proof, <Tx as EmbedCommitVerify<Commitment, OpretFirst>>::CommitError>
fn embed_commit( &mut self, msg: &Commitment, ) -> Result<<Tx as EmbedCommitVerify<Commitment, OpretFirst>>::Proof, <Tx as EmbedCommitVerify<Commitment, OpretFirst>>::CommitError>
Creates a commitment to a message and embeds it into the provided
container (
self
) by mutating it and returning commitment proof. Read moreSource§impl<D> PublishedWitness<TxoSeal<D>> for Txwhere
D: Proof,
impl<D> PublishedWitness<TxoSeal<D>> for Txwhere
D: Proof,
Source§type PubId = Txid
type PubId = Txid
Publication id that may be used for referencing publication of
witness data in the medium. By default, set
()
, so SingleUseSeal
may not implement publication id and related functions.type Error = <D as Proof>::Error
fn pub_id(&self) -> Txid
fn verify_commitment( &self, proof: Proof<D>, ) -> Result<(), <Tx as PublishedWitness<TxoSeal<D>>>::Error>
Source§impl Serialize for Tx
impl Serialize for Tx
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl StrictDecode for Tx
impl StrictDecode for Tx
fn strict_decode(reader: &mut impl TypedRead) -> Result<Tx, DecodeError>
fn strict_read(reader: impl ReadRaw) -> Result<Self, DecodeError>
Source§impl StrictDumb for Tx
impl StrictDumb for Tx
fn strict_dumb() -> Tx
Source§impl StrictEncode for Tx
impl StrictEncode for Tx
fn strict_encode<W>(&self, writer: W) -> Result<W, Error>where
W: TypedWrite,
fn strict_write(&self, writer: impl WriteRaw) -> Result<(), Error>
Source§impl StrictStruct for Tx
impl StrictStruct for Tx
const ALL_FIELDS: &'static [&'static str]
fn strict_check_fields()
fn strict_type_info() -> TypeInfo<Self>
Source§impl StrictType for Tx
impl StrictType for Tx
const STRICT_LIB_NAME: &'static str = LIB_NAME_BITCOIN
fn strict_name() -> Option<TypeName>
Source§impl Weight for Tx
impl Weight for Tx
fn weight_units(&self) -> WeightUnits
fn vbytes(&self) -> VBytes
impl Eq for Tx
impl StrictProduct for Tx
impl StructuralPartialEq for Tx
Auto Trait Implementations§
impl Freeze for Tx
impl RefUnwindSafe for Tx
impl Send for Tx
impl Sync for Tx
impl Unpin for Tx
impl UnwindSafe for Tx
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.