[−][src]Struct btc_transaction_utils::p2wpk::InputSigner
An input signer.
Methods
impl InputSigner
[src]
pub fn new(public_key: PublicKey, network: Network) -> InputSigner
[src]
Creates an input signer for the given public key and network.
pub fn secp256k1_context(&self) -> &Secp256k1<All>
[src]
Returns a reference to the secp256k1 engine, used to execute all signature operations.
pub fn secp256k1_context_mut(&mut self) -> &mut Secp256k1<All>
[src]
Returns a mutable reference to the secp256k1 engine, used to execute all signature operations.
pub fn signature_hash<'a, 'b, V: Into<UnspentTxOutValue<'b>>>(
&mut self,
txin: TxInRef<'a>,
value: V
) -> Sha256dHash
[src]
&mut self,
txin: TxInRef<'a>,
value: V
) -> Sha256dHash
Computes the BIP-143
compliant sighash for a SIGHASH_ALL
signature for the given input.
pub fn sign_input<'a, 'b, V: Into<UnspentTxOutValue<'b>>>(
&mut self,
txin: TxInRef<'a>,
value: V,
secret_key: &SecretKey
) -> Result<InputSignature, Error>
[src]
&mut self,
txin: TxInRef<'a>,
value: V,
secret_key: &SecretKey
) -> Result<InputSignature, Error>
Computes the BIP-143
compliant signature for the given input.
Under the hood this method signs sighash
for the given input with the
given secret key.
pub fn verify_input<'a, 'b, 'c, V, S>(
&self,
txin: TxInRef<'a>,
value: V,
public_key: &PublicKey,
signature: S
) -> Result<(), Error> where
V: Into<UnspentTxOutValue<'b>>,
S: Into<InputSignatureRef<'c>>,
[src]
&self,
txin: TxInRef<'a>,
value: V,
public_key: &PublicKey,
signature: S
) -> Result<(), Error> where
V: Into<UnspentTxOutValue<'b>>,
S: Into<InputSignatureRef<'c>>,
Checks correctness of the signature for the given input.
pub fn spend_input(&self, input: &mut TxIn, signature: InputSignature)
[src]
Collects the witness data for the given transaction input. Thus, the input becomes spent.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for InputSigner
impl Send for InputSigner
impl Sync for InputSigner
impl Unpin for InputSigner
impl UnwindSafe for InputSigner
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,