Script

Struct Script 

Source
pub struct Script<Sig = PushValue, PubKey = Opcode> {
    pub sig: Component<Sig>,
    pub pub_key: Component<PubKey>,
}
Expand description

A Zcash script consists of a sig and a pubkey. The first type parameter is the type of opcodes in the script sig, and the second is the type of opcodes in the script pubkey.

  • Script<opcode::PossiblyBad, opcode::PossiblyBad> – from the chain
  • Script<opcode::PushValue, Opcode> – authoring sig_push_only
  • Script<Opcode, Opcode> – authoring non-sig_push_only

Fields§

§sig: Component<Sig>

The script sig.

§pub_key: Component<PubKey>

The script pubkey.

Implementations§

Source§

impl<Sig: Into<PossiblyBad> + Evaluable + Clone, PubKey: Into<PossiblyBad> + Evaluable + Clone> Script<Sig, PubKey>

Source

pub fn eval( &self, flags: Flags, checker: &dyn SignatureChecker, ) -> Result<bool, (ComponentType, Error)>

Evaluate an entire script.

Trait Implementations§

Source§

impl<T: Asm, U: Asm> Asm for Script<T, U>

Source§

fn to_asm(&self, include_sighash_suffix: bool) -> String

Return the “asm” representation of this type. The attempt_sighash_decode flag indicates whether to try to decode signature hash types in signatures.

Auto Trait Implementations§

§

impl<Sig, PubKey> Freeze for Script<Sig, PubKey>

§

impl<Sig, PubKey> RefUnwindSafe for Script<Sig, PubKey>
where Sig: RefUnwindSafe, PubKey: RefUnwindSafe,

§

impl<Sig, PubKey> Send for Script<Sig, PubKey>
where Sig: Send, PubKey: Send,

§

impl<Sig, PubKey> Sync for Script<Sig, PubKey>
where Sig: Sync, PubKey: Sync,

§

impl<Sig, PubKey> Unpin for Script<Sig, PubKey>
where Sig: Unpin, PubKey: Unpin,

§

impl<Sig, PubKey> UnwindSafe for Script<Sig, PubKey>
where Sig: UnwindSafe, PubKey: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.