pub struct InputSigner { /* private fields */ }Expand description
An input signer.
Implementations§
Source§impl InputSigner
impl InputSigner
Sourcepub fn new(public_key: PublicKey, network: Network) -> InputSigner
pub fn new(public_key: PublicKey, network: Network) -> InputSigner
Creates an input signer for the given public key and network.
Sourcepub fn secp256k1_context(&self) -> &Secp256k1<All>
pub fn secp256k1_context(&self) -> &Secp256k1<All>
Returns a reference to the secp256k1 engine, used to execute all signature operations.
Sourcepub fn secp256k1_context_mut(&mut self) -> &mut Secp256k1<All>
pub fn secp256k1_context_mut(&mut self) -> &mut Secp256k1<All>
Returns a mutable reference to the secp256k1 engine, used to execute all signature operations.
Sourcepub fn signature_hash<'a, 'b, V: Into<UnspentTxOutValue<'b>>>(
&mut self,
txin: TxInRef<'a>,
value: V,
) -> Sha256dHash
pub fn signature_hash<'a, 'b, V: Into<UnspentTxOutValue<'b>>>( &mut self, txin: TxInRef<'a>, value: V, ) -> Sha256dHash
Computes the BIP-143 compliant sighash for a SIGHASH_ALL
signature for the given input.
Sourcepub fn sign_input<'a, 'b, V: Into<UnspentTxOutValue<'b>>>(
&mut self,
txin: TxInRef<'a>,
value: V,
secret_key: &SecretKey,
) -> Result<InputSignature, Error>
pub fn sign_input<'a, 'b, V: Into<UnspentTxOutValue<'b>>>( &mut self, txin: TxInRef<'a>, value: V, secret_key: &SecretKey, ) -> Result<InputSignature, Error>
Sourcepub fn verify_input<'a, 'b, 'c, V, S>(
&self,
txin: TxInRef<'a>,
value: V,
public_key: &PublicKey,
signature: S,
) -> Result<(), Error>
pub fn verify_input<'a, 'b, 'c, V, S>( &self, txin: TxInRef<'a>, value: V, public_key: &PublicKey, signature: S, ) -> Result<(), Error>
Checks correctness of the signature for the given input.
Sourcepub fn spend_input(&self, input: &mut TxIn, signature: InputSignature)
pub fn spend_input(&self, input: &mut TxIn, signature: InputSignature)
Collects the witness data for the given transaction input. Thus, the input becomes spent.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InputSigner
impl RefUnwindSafe for InputSigner
impl Send for InputSigner
impl Sync for InputSigner
impl Unpin for InputSigner
impl UnsafeUnpin for InputSigner
impl UnwindSafe for InputSigner
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