pub struct CovenantsContext {
pub input_ctxs: HashMap<usize, CovenantInputContext>,
pub shared_ctxs: HashMap<Hash, CovenantSharedContext>,
}Expand description
Pre-computed cache mapping inputs and covenant ids to their execution contexts.
Enables O(1) access for covenant introspection opcodes.
Fields§
§input_ctxs: HashMap<usize, CovenantInputContext>Maps an input index to its local authority context.
Maps a covenant id to its shared transaction-wide context.
Implementations§
Source§impl CovenantsContext
impl CovenantsContext
Sourcepub fn from_tx(tx: &impl VerifiableTransaction) -> Result<Self, CovenantsError>
pub fn from_tx(tx: &impl VerifiableTransaction) -> Result<Self, CovenantsError>
Constructs the covenants execution context for a transaction.
Collects per-input and shared covenant relations from the transaction, validating covenant bindings and handling both continuation and genesis cases. Genesis outputs are validated but do not populate covenant contexts.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CovenantsContext
impl RefUnwindSafe for CovenantsContext
impl Send for CovenantsContext
impl Sync for CovenantsContext
impl Unpin for CovenantsContext
impl UnsafeUnpin for CovenantsContext
impl UnwindSafe for CovenantsContext
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> 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