Struct snarkvm_compiler::VM
source · [−]pub struct VM<N: Network, P: ProgramStorage<N>> { /* private fields */ }
Implementations
sourceimpl<N: Network, P: ProgramStorage<N>> VM<N, P>
impl<N: Network, P: ProgramStorage<N>> VM<N, P>
Authorizes a call to the program function for the given inputs.
sourceimpl<N: Network, P: ProgramStorage<N>> VM<N, P>
impl<N: Network, P: ProgramStorage<N>> VM<N, P>
sourceimpl<N: Network, P: ProgramStorage<N>> VM<N, P>
impl<N: Network, P: ProgramStorage<N>> VM<N, P>
sourcepub fn execute<R: Rng + CryptoRng>(
&self,
authorization: Authorization<N>,
rng: &mut R
) -> Result<(Response<N>, Execution<N>)>
pub fn execute<R: Rng + CryptoRng>(
&self,
authorization: Authorization<N>,
rng: &mut R
) -> Result<(Response<N>, Execution<N>)>
Executes a call to the program function for the given inputs.
sourcepub fn execute_additional_fee<R: Rng + CryptoRng>(
&self,
private_key: &PrivateKey<N>,
credits: Record<N, Plaintext<N>>,
additional_fee_in_gates: u64,
rng: &mut R
) -> Result<(Response<N>, AdditionalFee<N>)>
pub fn execute_additional_fee<R: Rng + CryptoRng>(
&self,
private_key: &PrivateKey<N>,
credits: Record<N, Plaintext<N>>,
additional_fee_in_gates: u64,
rng: &mut R
) -> Result<(Response<N>, AdditionalFee<N>)>
Returns an additional fee for the given private key, credits record, and additional fee amount (in gates).
sourceimpl<N: Network, P: ProgramStorage<N>> VM<N, P>
impl<N: Network, P: ProgramStorage<N>> VM<N, P>
sourcepub fn finalize(&mut self, transaction: &Transaction<N>) -> Result<()>
pub fn finalize(&mut self, transaction: &Transaction<N>) -> Result<()>
Finalizes the transaction into the VM. This method assumes the given transaction is valid.
sourceimpl<N: Network, P: ProgramStorage<N>> VM<N, P>
impl<N: Network, P: ProgramStorage<N>> VM<N, P>
sourcepub fn verify(&self, transaction: &Transaction<N>) -> bool
pub fn verify(&self, transaction: &Transaction<N>) -> bool
Verifies the transaction in the VM.
sourceimpl<N: Network, P: ProgramStorage<N>> VM<N, P>
impl<N: Network, P: ProgramStorage<N>> VM<N, P>
sourcepub fn new(store: ProgramStore<N, P>) -> Result<Self>
pub fn new(store: ProgramStore<N, P>) -> Result<Self>
Initializes a new VM.
sourcepub fn from<B: BlockStorage<N>>(
blocks: &BlockStore<N, B>,
store: ProgramStore<N, P>
) -> Result<Self>
pub fn from<B: BlockStorage<N>>(
blocks: &BlockStore<N, B>,
store: ProgramStore<N, P>
) -> Result<Self>
Initializes the VM from storage.
sourcepub fn contains_program(&self, program_id: &ProgramID<N>) -> bool
pub fn contains_program(&self, program_id: &ProgramID<N>) -> bool
Deploys a program with the given program ID.
Trait Implementations
Auto Trait Implementations
impl<N, P> !RefUnwindSafe for VM<N, P>
impl<N, P> Send for VM<N, P> where
P: Send,
impl<N, P> Sync for VM<N, P>
impl<N, P> Unpin for VM<N, P> where
N: Unpin,
P: Unpin,
impl<N, P> !UnwindSafe for VM<N, P>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more