pub enum WitnessCondition {
Boolean(bool),
Not(Box<WitnessCondition>),
And(Vec<WitnessCondition>),
Or(Vec<WitnessCondition>),
ScriptHash(H160),
Group(Secp256r1PublicKey),
CalledByEntry,
CalledByContract(H160),
CalledByGroup(Secp256r1PublicKey),
}
Expand description
Enum representing the different types of witness conditions that can be used in a smart contract.
Variants§
Boolean(bool)
Boolean value.
Not(Box<WitnessCondition>)
Not operator.
And(Vec<WitnessCondition>)
And operator.
Or(Vec<WitnessCondition>)
Or operator.
ScriptHash(H160)
Script hash.
Group(Secp256r1PublicKey)
Public key group.
CalledByEntry
Called by entry.
CalledByContract(H160)
Called by contract.
CalledByGroup(Secp256r1PublicKey)
Called by public key group.
Implementations§
Source§impl WitnessCondition
impl WitnessCondition
Sourcepub fn json_value(&self) -> &'static str
pub fn json_value(&self) -> &'static str
Returns the JSON value of the witness condition.
Sourcepub fn boolean_expression(&self) -> Option<bool>
pub fn boolean_expression(&self) -> Option<bool>
Returns the boolean expression of the witness condition.
Sourcepub fn expression(&self) -> Option<&WitnessCondition>
pub fn expression(&self) -> Option<&WitnessCondition>
Returns the expression of the witness condition.
Sourcepub fn expression_list(&self) -> Option<&[WitnessCondition]>
pub fn expression_list(&self) -> Option<&[WitnessCondition]>
Returns the expression list of the witness condition.
Sourcepub fn script_hash(&self) -> Option<&H160>
pub fn script_hash(&self) -> Option<&H160>
Returns the script hash of the witness condition.
Sourcepub fn group(&self) -> Option<&Secp256r1PublicKey>
pub fn group(&self) -> Option<&Secp256r1PublicKey>
Returns the public key group of the witness condition.
pub fn from_bytes(bytes: &[u8]) -> Result<WitnessCondition, TransactionError>
Trait Implementations§
Source§impl Clone for WitnessCondition
impl Clone for WitnessCondition
Source§fn clone(&self) -> WitnessCondition
fn clone(&self) -> WitnessCondition
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for WitnessCondition
impl Debug for WitnessCondition
Source§impl<'de> Deserialize<'de> for WitnessCondition
impl<'de> Deserialize<'de> for WitnessCondition
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for WitnessCondition
impl Hash for WitnessCondition
Source§impl NeoSerializable for WitnessCondition
impl NeoSerializable for WitnessCondition
Source§impl PartialEq for WitnessCondition
impl PartialEq for WitnessCondition
Source§impl Serialize for WitnessCondition
impl Serialize for WitnessCondition
impl StructuralPartialEq for WitnessCondition
Auto Trait Implementations§
impl Freeze for WitnessCondition
impl RefUnwindSafe for WitnessCondition
impl Send for WitnessCondition
impl Sync for WitnessCondition
impl Unpin for WitnessCondition
impl UnwindSafe for WitnessCondition
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more