Struct bpstd::UnsignedTx 
source · pub struct UnsignedTx {
    pub version: TxVer,
    pub inputs: Confined<Vec<UnsignedTxIn>, 0, bc::::coding::VarIntArray::{constant#1}>,
    pub outputs: Confined<Vec<TxOut>, 0, bc::::coding::VarIntArray::{constant#1}>,
    pub lock_time: LockTime,
}Expand description
Structure representing data on unsigned transaction the way it is stored in PSBTv1 global key.
We can’t use Tx since PSBT may contain unsigned transaction with zero inputs, according to
BIP-174 test cases. Tx containing zero inputs is an invalid structure, prohibited by
consensus. An attempt to deserialize it will be incorrectly identified as a Segwit transaction
(since zero inputs is the trick which was used to make Segwit softfork) and fail with invalid
segwit flag error (since the second byte after 0 segwit indicator must be 01 and not a number
of inputs) fail to parse outputs (for transactions containing just a one output).
UnsignedTx also ensures invariant that none of its inputs contain witnesses or sigscripts.
Fields§
§version: TxVer§inputs: Confined<Vec<UnsignedTxIn>, 0, bc::::coding::VarIntArray::{constant#1}>§outputs: Confined<Vec<TxOut>, 0, bc::::coding::VarIntArray::{constant#1}>§lock_time: LockTimeImplementations§
source§impl UnsignedTx
 
impl UnsignedTx
pub fn with_sigs_removed(tx: Tx) -> UnsignedTx
pub fn txid(&self) -> Txid
pub fn finalize(self) -> Tx
Trait Implementations§
source§impl Clone for UnsignedTx
 
impl Clone for UnsignedTx
source§fn clone(&self) -> UnsignedTx
 
fn clone(&self) -> UnsignedTx
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 UnsignedTx
 
impl Debug for UnsignedTx
source§impl Decode for UnsignedTx
 
impl Decode for UnsignedTx
fn decode(reader: &mut impl Read) -> Result<UnsignedTx, DecodeError>
fn deserialize(bytes: impl AsRef<[u8]>) -> Result<Self, PsbtError>
source§impl Encode for UnsignedTx
 
impl Encode for UnsignedTx
source§impl From<Tx> for UnsignedTx
 
impl From<Tx> for UnsignedTx
source§fn from(tx: Tx) -> UnsignedTx
 
fn from(tx: Tx) -> UnsignedTx
Converts to this type from the input type.
source§impl From<UnsignedTx> for Tx
 
impl From<UnsignedTx> for Tx
source§fn from(unsigned_tx: UnsignedTx) -> Tx
 
fn from(unsigned_tx: UnsignedTx) -> Tx
Converts to this type from the input type.
source§impl Hash for UnsignedTx
 
impl Hash for UnsignedTx
source§impl PartialEq for UnsignedTx
 
impl PartialEq for UnsignedTx
source§fn eq(&self, other: &UnsignedTx) -> bool
 
fn eq(&self, other: &UnsignedTx) -> bool
This method tests for 
self and other values to be equal, and is used
by ==.impl Eq for UnsignedTx
impl StructuralPartialEq for UnsignedTx
Auto Trait Implementations§
impl Freeze for UnsignedTx
impl RefUnwindSafe for UnsignedTx
impl Send for UnsignedTx
impl Sync for UnsignedTx
impl Unpin for UnsignedTx
impl UnwindSafe for UnsignedTx
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<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.