pub enum Context {
Predicate {
program: RuntimePredicate,
},
Script {
block_height: u32,
},
Call {
block_height: u32,
},
NotInitialized,
}
Expand description
Runtime context description.
Variants§
Predicate
Fields
§
program: RuntimePredicate
Predicate program to be executed
Current context is a predicate verification.
Script
Current context is a script execution.
Call
Current context is under a CALL
scope
NotInitialized
No transaction initialized/invalid context.
Implementations§
source§impl Context
impl Context
sourcepub const fn is_predicate(&self) -> bool
pub const fn is_predicate(&self) -> bool
Check if the context is predicate
sourcepub const fn is_external(&self) -> bool
pub const fn is_external(&self) -> bool
Return true
if the context is external; false
otherwise.
sourcepub const fn predicate(&self) -> Option<&RuntimePredicate>
pub const fn predicate(&self) -> Option<&RuntimePredicate>
Return the program to be executed, if its a predicate
sourcepub const fn block_height(&self) -> Option<u32>
pub const fn block_height(&self) -> Option<u32>
Return the block height from the context, if either script or call
sourcepub fn update_from_frame_pointer(&mut self, fp: Word)
pub fn update_from_frame_pointer(&mut self, fp: Word)
Update the context according to the provided frame pointer