Struct sapio::contract::context::Context [−][src]
pub struct Context {
pub network: Network,
// some fields omitted
}
Expand description
Context is used to track statet during compilation such as remaining value.
Fields
network: Network
which network is the contract building for?
Implementations
pub fn new(
network: Network,
available_funds: Amount,
emulator: Arc<dyn CTVEmulator>,
path: EffectPath,
effects: Arc<MapEffectDB>
) -> Self
pub fn new(
network: Network,
available_funds: Amount,
emulator: Arc<dyn CTVEmulator>,
path: EffectPath,
effects: Arc<MapEffectDB>
) -> Self
create a context instance. Should only happen once at the very top level.
Get this Context’s effect database, for clients
Gets this Context’s Path, but does not clone (left to caller)
Derive a new contextual path
Derive a new contextual path
use the context’s emulator to get a emulated (or not) clause
Compile the compilable item with this context.
return a context with the new amount if amount is smaller or equal to available
decrease the amount available in this context object.
Add funds to the context object (not typically needed)
converts a descriptor and an optional AmountRange to a Object object. This can be used for e.g. creating raw SegWit Scripts.