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: LockTime
Implementations§
Source§impl UnsignedTx
impl UnsignedTx
pub fn with_sigs_removed(tx: Tx) -> UnsignedTx
pub fn txid(&self) -> Txid
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<'de> Deserialize<'de> for UnsignedTx
impl<'de> Deserialize<'de> for UnsignedTx
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<UnsignedTx, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<UnsignedTx, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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 Hash for UnsignedTx
impl Hash for UnsignedTx
Source§impl PartialEq for UnsignedTx
impl PartialEq for UnsignedTx
Source§impl Serialize for UnsignedTx
impl Serialize for UnsignedTx
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 UnsignedTx
impl StrictDecode for UnsignedTx
fn strict_decode(reader: &mut impl TypedRead) -> Result<UnsignedTx, DecodeError>
fn strict_read(reader: impl ReadRaw) -> Result<Self, DecodeError>
Source§impl StrictDumb for UnsignedTx
impl StrictDumb for UnsignedTx
fn strict_dumb() -> UnsignedTx
Source§impl StrictEncode for UnsignedTx
impl StrictEncode for UnsignedTx
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 UnsignedTx
impl StrictStruct for UnsignedTx
const ALL_FIELDS: &'static [&'static str] = _
fn strict_check_fields()
fn strict_type_info() -> TypeInfo<Self>
Source§impl StrictType for UnsignedTx
impl StrictType for UnsignedTx
const STRICT_LIB_NAME: &'static str = crate::LIB_NAME_PSBT
fn strict_name() -> Option<TypeName>
impl Eq for UnsignedTx
impl StrictProduct 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<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.