[][src]Struct lnpbp::bp::scripts::types::LockScript

pub struct LockScript(_);

Script which 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 keys

Implementations

impl LockScript[src]

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

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

pub fn extract_pubkey_hash_set(
    &self
) -> Result<(BTreeSet<PublicKey>, BTreeSet<PubkeyHash>), PubkeyParseError>
[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(
    &self
) -> Result<(Vec<PublicKey>, Vec<PubkeyHash>), PubkeyParseError>
[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(&self) -> Result<Vec<PublicKey>, PubkeyParseError>[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(
    &self,
    processor: impl Fn(&PublicKey) -> Option<PublicKey>
) -> Result<Self, PubkeyParseError>
[src]

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

pub fn replace_pubkeys_and_hashes(
    &self,
    key_processor: impl Fn(&PublicKey) -> Option<PublicKey>,
    hash_processor: impl Fn(&Hash) -> Option<Hash>
) -> Result<Self, PubkeyParseError>
[src]

Replaces public kes 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 LockscriptCommitment[src]

impl From<LockScript> for RedeemScript[src]

impl From<LockScript> for WitnessScript[src]

impl From<Script> for LockScript[src]

impl From<WitnessScript> for LockScript[src]

impl GenerateScripts 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 ScriptGenerators for LockScript[src]

impl ScriptGenerators for LockScript[src]

impl Strategy for LockScript[src]

impl StructuralEq for LockScript[src]

impl StructuralPartialEq 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> Same<T> for T

type Output = T

Should always be Self

impl<T> ToHex for T where
    T: LowerHex
[src]

pub fn to_hex(&self) -> String[src]

Outputs the hash in hexadecimal form

impl<T> ToHex for T where
    T: LowerHex
[src]

pub fn to_hex(&self) -> String[src]

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,