Struct wallet::LockScript[][src]

pub struct LockScript(_);

Script whose knowledge is required for spending some specific transaction output. This is the deepest nested version of Bitcoin script containing no hashes of other scripts, including P2SH redeemScript hashes or witnessProgram (hash or witness script), or public key hashes

Implementations

impl LockScript[src]

pub fn extract_pubkeyset<Ctx>(
    &self
) -> Result<BTreeSet<PublicKey>, PubkeyParseError> where
    Ctx: ScriptContext
[src]

Returns set of unique public keys from the script; fails on public key hash

pub fn extract_pubkey_hash_set<Ctx>(
    &self
) -> Result<(BTreeSet<PublicKey>, BTreeSet<PubkeyHash>), PubkeyParseError> where
    Ctx: ScriptContext
[src]

Returns tuple of two sets: one for unique public keys and one for unique hash values, extracted from the script

pub fn extract_pubkeys_and_hashes<Ctx>(
    &self
) -> Result<(Vec<PublicKey>, Vec<PubkeyHash>), PubkeyParseError> where
    Ctx: ScriptContext
[src]

Returns tuple with two vectors: one for public keys and one for public key hashes present in the script; if any of the keys or hashes has more than a single occurrence it returns all occurrences for each of them

pub fn extract_pubkeys<Ctx>(&self) -> Result<Vec<PublicKey>, PubkeyParseError> where
    Ctx: ScriptContext
[src]

Returns all public keys found in the script; fails on public key hash. If the key present multiple times in the script it returns all occurrences.

pub fn replace_pubkeys<Ctx, Fpk>(
    &self,
    processor: Fpk
) -> Result<Self, PubkeyParseError> where
    Ctx: ScriptContext,
    Fpk: Fn(&PublicKey) -> PublicKey
[src]

Replaces pubkeys using provided matching function; does not fail on public key hashes.

pub fn replace_pubkeys_and_hashes<Ctx, Fpk, Fpkh>(
    &self,
    key_processor: Fpk,
    hash_processor: Fpkh
) -> Result<Self, PubkeyParseError> where
    Ctx: ScriptContext,
    Fpk: Fn(&PublicKey) -> PublicKey,
    Fpkh: Fn(&Hash) -> Hash, 
[src]

Replaces public keys and public key hashes using provided matching functions.

Trait Implementations

impl AsMut<<LockScript as Wrapper>::Inner> for LockScript[src]

impl AsRef<<LockScript as Wrapper>::Inner> for LockScript[src]

impl Borrow<<LockScript as Wrapper>::Inner> for LockScript[src]

impl BorrowMut<<LockScript as Wrapper>::Inner> for LockScript[src]

impl Clone for LockScript[src]

impl Debug for LockScript[src]

impl Default for LockScript[src]

impl Deref for LockScript[src]

type Target = Self::Inner

The resulting type after dereferencing.

impl DerefMut for LockScript[src]

impl Display for LockScript[src]

impl Eq for LockScript[src]

impl From<LockScript> for WitnessScript[src]

impl From<LockScript> for RedeemScript[src]

impl From<RedeemScript> for LockScript[src]

impl From<Script> for LockScript[src]

impl From<WitnessScript> for LockScript[src]

impl Hash for LockScript[src]

impl LowerHex for LockScript[src]

impl Ord for LockScript[src]

impl PartialEq<LockScript> for LockScript[src]

impl PartialOrd<LockScript> for LockScript[src]

impl Strategy for LockScript[src]

impl StructuralEq for LockScript[src]

impl StructuralPartialEq for LockScript[src]

impl ToPubkeyScript for LockScript[src]

impl ToScripts for LockScript[src]

impl UpperHex for LockScript[src]

impl Wrapper for LockScript[src]

type Inner = Script

Inner type wrapped by the current newtype

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToHex for T where
    T: LowerHex

pub fn to_hex(&self) -> String

Outputs the hash in hexadecimal form

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.