Struct snarkvm_dpc::virtual_machine::virtual_machine::VirtualMachine
source · [−]pub struct VirtualMachine<N: Network> { /* private fields */ }
Implementations
sourceimpl<N: Network> VirtualMachine<N>
impl<N: Network> VirtualMachine<N>
sourcepub fn new(ledger_root: N::LedgerRoot) -> Result<Self>
pub fn new(ledger_root: N::LedgerRoot) -> Result<Self>
Initializes a new instance of the virtual machine, with the given request.
sourcepub fn to_local_proof(&self, commitment: N::Commitment) -> Result<LocalProof<N>>
pub fn to_local_proof(&self, commitment: N::Commitment) -> Result<LocalProof<N>>
Returns the local proof for a given commitment.
sourcepub fn num_transitions(&self) -> usize
pub fn num_transitions(&self) -> usize
Returns the number of transitions in the virtual machine.
sourcepub fn execute<R: Rng + CryptoRng>(
self,
request: &Request<N>,
rng: &mut R
) -> Result<(Self, Response<N>)>
pub fn execute<R: Rng + CryptoRng>(
self,
request: &Request<N>,
rng: &mut R
) -> Result<(Self, Response<N>)>
Executes the request, returning a transaction.
sourcepub fn finalize(&self) -> Result<Transaction<N>>
pub fn finalize(&self) -> Result<Transaction<N>>
Finalizes the virtual machine state and returns a transaction.
sourcepub fn execute_program<R: Rng + CryptoRng>(
self,
request: &Request<N>,
program_id: <N as Network>::ProgramID,
function: &Arc<dyn Function<N>>,
function_path: &MerklePath<<N as Network>::ProgramIDParameters>,
function_verifying_key: <<N as Network>::ProgramSNARK as SNARK>::VerifyingKey,
private_variables: &dyn ProgramPrivateVariables<N>,
custom_events: Vec<Vec<u8>>,
rng: &mut R
) -> Result<(Self, Response<N>)>
pub fn execute_program<R: Rng + CryptoRng>(
self,
request: &Request<N>,
program_id: <N as Network>::ProgramID,
function: &Arc<dyn Function<N>>,
function_path: &MerklePath<<N as Network>::ProgramIDParameters>,
function_verifying_key: <<N as Network>::ProgramSNARK as SNARK>::VerifyingKey,
private_variables: &dyn ProgramPrivateVariables<N>,
custom_events: Vec<Vec<u8>>,
rng: &mut R
) -> Result<(Self, Response<N>)>
Executes the request of a particular program execution and returns a transaction.
Trait Implementations
sourceimpl<N: Network> Clone for VirtualMachine<N> where
N: Network,
impl<N: Network> Clone for VirtualMachine<N> where
N: Network,
Auto Trait Implementations
impl<N> RefUnwindSafe for VirtualMachine<N> where
N: RefUnwindSafe,
<N as Network>::Commitment: RefUnwindSafe,
<N as Network>::FunctionID: RefUnwindSafe,
<N as Network>::InnerScalarField: RefUnwindSafe,
<N as Network>::LedgerRoot: RefUnwindSafe,
<N as Network>::OuterProof: RefUnwindSafe,
<N as Network>::ProgramAffineCurve: RefUnwindSafe,
<N as Network>::RecordCiphertext: RefUnwindSafe,
<N as Network>::RecordViewKey: RefUnwindSafe,
<N as Network>::SerialNumber: RefUnwindSafe,
<N as Network>::TransactionIDParameters: RefUnwindSafe,
<N as Network>::TransitionID: RefUnwindSafe,
impl<N> Send for VirtualMachine<N>
impl<N> Sync for VirtualMachine<N>
impl<N> Unpin for VirtualMachine<N> where
N: Unpin,
<N as Network>::Commitment: Unpin,
<N as Network>::FunctionID: Unpin,
<N as Network>::LedgerRoot: Unpin,
<N as Network>::OuterProof: Unpin,
<N as Network>::ProgramAffineCurve: Unpin,
<N as Network>::RecordCiphertext: Unpin,
<N as Network>::RecordViewKey: Unpin,
<N as Network>::SerialNumber: Unpin,
<N as Network>::TransitionID: Unpin,
impl<N> UnwindSafe for VirtualMachine<N> where
N: UnwindSafe,
<N as Network>::Commitment: UnwindSafe,
<N as Network>::FunctionID: UnwindSafe,
<N as Network>::InnerScalarField: RefUnwindSafe,
<N as Network>::LedgerRoot: UnwindSafe,
<N as Network>::OuterProof: UnwindSafe,
<N as Network>::ProgramAffineCurve: UnwindSafe,
<N as Network>::RecordCiphertext: UnwindSafe,
<N as Network>::RecordViewKey: UnwindSafe,
<N as Network>::SerialNumber: UnwindSafe,
<N as Network>::TransactionIDParameters: RefUnwindSafe,
<N as Network>::TransitionID: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more