pub struct UnvaultEmergencyTransaction(_);
Expand description
The transaction spending an unvault output to The Emergency Script.
Implementations
sourceimpl UnvaultEmergencyTransaction
impl UnvaultEmergencyTransaction
sourcepub fn new(
unvault_input: UnvaultTxIn,
emer_address: EmergencyAddress
) -> Result<UnvaultEmergencyTransaction, TransactionCreationError>
pub fn new(
unvault_input: UnvaultTxIn,
emer_address: EmergencyAddress
) -> Result<UnvaultEmergencyTransaction, TransactionCreationError>
The second emergency transaction always spends an unvault output and pays to the Emergency Script.
BIP174 Creator and Updater roles.
sourcepub fn from_raw_psbt(
raw_psbt: &[u8]
) -> Result<Self, TransactionSerialisationError>
pub fn from_raw_psbt(
raw_psbt: &[u8]
) -> Result<Self, TransactionSerialisationError>
Parse an UnvaultEmergency transaction from a PSBT
sourcepub fn emergency_outpoint(&self) -> OutPoint
pub fn emergency_outpoint(&self) -> OutPoint
Get the reference to the Emergency UTXO
Trait Implementations
sourceimpl Clone for UnvaultEmergencyTransaction
impl Clone for UnvaultEmergencyTransaction
sourcefn clone(&self) -> UnvaultEmergencyTransaction
fn clone(&self) -> UnvaultEmergencyTransaction
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for UnvaultEmergencyTransaction
impl Debug for UnvaultEmergencyTransaction
sourceimpl Display for UnvaultEmergencyTransaction
impl Display for UnvaultEmergencyTransaction
sourceimpl FromStr for UnvaultEmergencyTransaction
impl FromStr for UnvaultEmergencyTransaction
sourceimpl PartialEq<UnvaultEmergencyTransaction> for UnvaultEmergencyTransaction
impl PartialEq<UnvaultEmergencyTransaction> for UnvaultEmergencyTransaction
sourcefn eq(&self, other: &UnvaultEmergencyTransaction) -> bool
fn eq(&self, other: &UnvaultEmergencyTransaction) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &UnvaultEmergencyTransaction) -> bool
fn ne(&self, other: &UnvaultEmergencyTransaction) -> bool
This method tests for !=
.
sourceimpl RevaultPresignedTransaction for UnvaultEmergencyTransaction
impl RevaultPresignedTransaction for UnvaultEmergencyTransaction
sourcefn sig_hash(&self) -> Result<SigHash, InputSatisfactionError>
fn sig_hash(&self) -> Result<SigHash, InputSatisfactionError>
Get the sighash for the single input of a presigned Revault transaction.
sourcefn sig_hash_cached(
&self,
cache: &mut SigHashCache<&Transaction>
) -> Result<SigHash, InputSatisfactionError>
fn sig_hash_cached(
&self,
cache: &mut SigHashCache<&Transaction>
) -> Result<SigHash, InputSatisfactionError>
Cached version of [RevaultPresignedTransaction::signature_hash]
sourcefn add_sig<C: Verification>(
&mut self,
pubkey: PublicKey,
signature: Signature,
secp: &Secp256k1<C>
) -> Result<Option<Vec<u8>>, InputSatisfactionError>
fn add_sig<C: Verification>(
&mut self,
pubkey: PublicKey,
signature: Signature,
secp: &Secp256k1<C>
) -> Result<Option<Vec<u8>>, InputSatisfactionError>
Add a signature to the single input of a presigned Revault transaction. Read more
sourcefn signatures(&self) -> &BTreeMap<BitcoinPubKey, Vec<u8>>
fn signatures(&self) -> &BTreeMap<BitcoinPubKey, Vec<u8>>
Get the signatures for the single input of this presigned Revault transaction.
impl StructuralPartialEq for UnvaultEmergencyTransaction
Auto Trait Implementations
impl RefUnwindSafe for UnvaultEmergencyTransaction
impl Send for UnvaultEmergencyTransaction
impl Sync for UnvaultEmergencyTransaction
impl Unpin for UnvaultEmergencyTransaction
impl UnwindSafe for UnvaultEmergencyTransaction
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> RevaultTransaction for T where
T: PrivateInnerMut + Debug + Clone + PartialEq<T>,
impl<T> RevaultTransaction for T where
T: PrivateInnerMut + Debug + Clone + PartialEq<T>,
sourcefn is_finalizable(&self, ctx: &Secp256k1<impl Verification>) -> bool
fn is_finalizable(&self, ctx: &Secp256k1<impl Verification>) -> bool
Check the transaction is valid (fully-signed) and can be finalized. Slighty more efficient than calling RevaultTransaction::finalize on a clone as it gets rid of the belt-and-suspenders checks.
sourcefn is_finalized(&self) -> bool
fn is_finalized(&self) -> bool
Check if the transaction was already finalized.
sourcefn verify_inputs(&self) -> Result<(), Error>
fn verify_inputs(&self) -> Result<(), Error>
Verify all PSBT inputs against libbitcoinconsensus
sourcefn into_bitcoin_serialized(self) -> Vec<u8, Global>
fn into_bitcoin_serialized(self) -> Vec<u8, Global>
Get the network-serialized (inner) transaction. You likely want to be sure the transaction [RevaultTransaction.is_finalized] before serializing it.
The BIP174 Transaction Extractor (without any check, which are done in [RevaultTransaction.finalize]).
sourcefn as_psbt_serialized(&self) -> Vec<u8, Global>
fn as_psbt_serialized(&self) -> Vec<u8, Global>
Get the BIP174-serialized (inner) transaction.
sourcefn as_psbt_string(&self) -> String
fn as_psbt_string(&self) -> String
Get the BIP174-serialized (inner) transaction encoded in base64.
sourcefn from_psbt_str(psbt_str: &str) -> Result<T, TransactionSerialisationError>
fn from_psbt_str(psbt_str: &str) -> Result<T, TransactionSerialisationError>
Create a RevaultTransaction from a base64-encoded BIP174-serialized transaction.
sourcefn from_psbt_serialized(
raw_psbt: &[u8]
) -> Result<T, TransactionSerialisationError>
fn from_psbt_serialized(
raw_psbt: &[u8]
) -> Result<T, TransactionSerialisationError>
Create a RevaultTransaction from a base64-encoded BIP174-serialized transaction.
sourcefn into_tx(self) -> Transaction
fn into_tx(self) -> Transaction
Extract the inner transaction of the inner PSBT. You likely want to be sure the transaction [RevaultTransaction.is_finalized] before serializing it.
The BIP174 Transaction Extractor (without any check, which are done in [RevaultTransaction.finalize]).
sourcefn signature_hash(
&self,
input_index: usize
) -> Result<SigHash, InputSatisfactionError>
fn signature_hash(
&self,
input_index: usize
) -> Result<SigHash, InputSatisfactionError>
Get the sighash for an input of a Revault transaction. Will deduce the scriptCode from the previous witness script. NOTE: transactions are always signed with the SIGHASH_ALL flag. Read more
sourcefn signature_hash_cached(
&self,
input_index: usize,
cache: &mut SigHashCache<&Transaction>
) -> Result<SigHash, InputSatisfactionError>
fn signature_hash_cached(
&self,
input_index: usize,
cache: &mut SigHashCache<&Transaction>
) -> Result<SigHash, InputSatisfactionError>
Cached version of RevaultTransaction::signature_hash
sourcefn add_signature<C>(
&mut self,
input_index: usize,
pubkey: PublicKey,
signature: Signature,
secp: &Secp256k1<C>
) -> Result<Option<Vec<u8, Global>>, InputSatisfactionError> where
C: Verification,
fn add_signature<C>(
&mut self,
input_index: usize,
pubkey: PublicKey,
signature: Signature,
secp: &Secp256k1<C>
) -> Result<Option<Vec<u8, Global>>, InputSatisfactionError> where
C: Verification,
Add a signature in order to eventually satisfy this input. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more