Struct snarkvm_compiler::Process
source · [−]pub struct Process<N: Network> { /* private fields */ }
Implementations
sourceimpl<N: Network> Process<N>
impl<N: Network> Process<N>
sourcepub fn execute_additional_fee<A: Aleo<Network = N>, 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<A: Aleo<Network = N>, 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 given the credits record and the additional fee amount (in gates).
sourcepub fn verify_additional_fee(
&self,
additional_fee: &AdditionalFee<N>
) -> Result<()>
pub fn verify_additional_fee(
&self,
additional_fee: &AdditionalFee<N>
) -> Result<()>
Verifies the given additional fee is valid.
sourceimpl<N: Network> Process<N>
impl<N: Network> Process<N>
sourcepub fn deploy<A: Aleo<Network = N>, R: Rng + CryptoRng>(
&self,
program: &Program<N>,
rng: &mut R
) -> Result<Deployment<N>>
pub fn deploy<A: Aleo<Network = N>, R: Rng + CryptoRng>(
&self,
program: &Program<N>,
rng: &mut R
) -> Result<Deployment<N>>
Deploys the given program ID, if it does not exist.
sourcepub fn verify_deployment<A: Aleo<Network = N>, R: Rng + CryptoRng>(
&self,
deployment: &Deployment<N>,
rng: &mut R
) -> Result<()>
pub fn verify_deployment<A: Aleo<Network = N>, R: Rng + CryptoRng>(
&self,
deployment: &Deployment<N>,
rng: &mut R
) -> Result<()>
Verifies the given deployment is well-formed.
sourcepub fn finalize_deployment<P: ProgramStorage<N>>(
&mut self,
store: &ProgramStore<N, P>,
deployment: &Deployment<N>
) -> Result<()>
pub fn finalize_deployment<P: ProgramStorage<N>>(
&mut self,
store: &ProgramStore<N, P>,
deployment: &Deployment<N>
) -> Result<()>
Finalizes the deployment. This method assumes the given deployment is valid.
sourceimpl<N: Network> Process<N>
impl<N: Network> Process<N>
sourcepub fn evaluate<A: Aleo<Network = N>>(
&self,
authorization: Authorization<N>
) -> Result<Response<N>>
pub fn evaluate<A: Aleo<Network = N>>(
&self,
authorization: Authorization<N>
) -> Result<Response<N>>
Evaluates a program function on the given request.
sourceimpl<N: Network> Process<N>
impl<N: Network> Process<N>
sourcepub fn execute<A: Aleo<Network = N>, R: Rng + CryptoRng>(
&self,
authorization: Authorization<N>,
rng: &mut R
) -> Result<(Response<N>, Execution<N>)>
pub fn execute<A: Aleo<Network = N>, R: Rng + CryptoRng>(
&self,
authorization: Authorization<N>,
rng: &mut R
) -> Result<(Response<N>, Execution<N>)>
Executes the given authorization.
sourcepub fn verify_execution(&self, execution: &Execution<N>) -> Result<()>
pub fn verify_execution(&self, execution: &Execution<N>) -> Result<()>
Verifies the given execution is valid.
sourcepub fn finalize_execution<P: ProgramStorage<N>>(
&self,
store: &ProgramStore<N, P>,
execution: &Execution<N>
) -> Result<()>
pub fn finalize_execution<P: ProgramStorage<N>>(
&self,
store: &ProgramStore<N, P>,
execution: &Execution<N>
) -> Result<()>
Finalizes the execution. This method assumes the given execution is valid.
sourceimpl<N: Network> Process<N>
impl<N: Network> Process<N>
sourcepub fn setup<A: Aleo<Network = N>, R: Rng + CryptoRng>(
rng: &mut R
) -> Result<Self>
pub fn setup<A: Aleo<Network = N>, R: Rng + CryptoRng>(
rng: &mut R
) -> Result<Self>
Initializes a new process.
sourcepub fn add_program(&mut self, program: &Program<N>) -> Result<()>
pub fn add_program(&mut self, program: &Program<N>) -> Result<()>
Adds a new program to the process.
If you intend to execute
the program, use deploy
and finalize_deployment
instead.
sourceimpl<N: Network> Process<N>
impl<N: Network> Process<N>
sourcepub const fn universal_srs(&self) -> &Arc<UniversalSRS<N>>
pub const fn universal_srs(&self) -> &Arc<UniversalSRS<N>>
Returns the universal SRS.
sourcepub fn contains_program(&self, program_id: &ProgramID<N>) -> bool
pub fn contains_program(&self, program_id: &ProgramID<N>) -> bool
Returns true
if the process contains the program with the given ID.
sourcepub fn get_stack(&self, program_id: &ProgramID<N>) -> Result<&Stack<N>>
pub fn get_stack(&self, program_id: &ProgramID<N>) -> Result<&Stack<N>>
Returns the stack for the given program ID.
sourcepub fn get_program(&self, program_id: &ProgramID<N>) -> Result<&Program<N>>
pub fn get_program(&self, program_id: &ProgramID<N>) -> Result<&Program<N>>
Returns the program for the given program ID.
sourcepub fn get_proving_key(
&self,
program_id: &ProgramID<N>,
function_name: &Identifier<N>
) -> Result<ProvingKey<N>>
pub fn get_proving_key(
&self,
program_id: &ProgramID<N>,
function_name: &Identifier<N>
) -> Result<ProvingKey<N>>
Returns the proving key for the given program ID and function name.
sourcepub fn get_verifying_key(
&self,
program_id: &ProgramID<N>,
function_name: &Identifier<N>
) -> Result<VerifyingKey<N>>
pub fn get_verifying_key(
&self,
program_id: &ProgramID<N>,
function_name: &Identifier<N>
) -> Result<VerifyingKey<N>>
Returns the verifying key for the given program ID and function name.
sourcepub fn insert_proving_key(
&self,
program_id: &ProgramID<N>,
function_name: &Identifier<N>,
proving_key: ProvingKey<N>
) -> Result<()>
pub fn insert_proving_key(
&self,
program_id: &ProgramID<N>,
function_name: &Identifier<N>,
proving_key: ProvingKey<N>
) -> Result<()>
Inserts the given proving key, for the given program ID and function name.
sourcepub fn insert_verifying_key(
&self,
program_id: &ProgramID<N>,
function_name: &Identifier<N>,
verifying_key: VerifyingKey<N>
) -> Result<()>
pub fn insert_verifying_key(
&self,
program_id: &ProgramID<N>,
function_name: &Identifier<N>,
verifying_key: VerifyingKey<N>
) -> Result<()>
Inserts the given verifying key, for the given program ID and function name.
Trait Implementations
Auto Trait Implementations
impl<N> !RefUnwindSafe for Process<N>
impl<N> Send for Process<N>
impl<N> Sync for Process<N>
impl<N> Unpin for Process<N> where
N: Unpin,
<N as Environment>::Field: Unpin,
<N as Environment>::Projective: Unpin,
<N as Environment>::Scalar: Unpin,
impl<N> !UnwindSafe for Process<N>
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