pub struct Process<N: Network> { /* private fields */ }
Implementations§
Source§impl<N: Network> Process<N>
impl<N: Network> Process<N>
Authorizes a call to the program function for the given inputs.
Authorizes the fee given the credits record, the fee amount (in microcredits), and the deployment or execution ID.
Authorizes the fee given the the fee amount (in microcredits) and the deployment or execution ID.
Source§impl<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 load_deployment(&mut self, deployment: &Deployment<N>) -> Result<()>
pub fn load_deployment(&mut self, deployment: &Deployment<N>) -> Result<()>
Adds the newly-deployed program. This method assumes the given deployment is valid.
Source§impl<N: Network> Process<N>
impl<N: Network> Process<N>
Sourcepub fn finalize_deployment<P: FinalizeStorage<N>>(
&self,
state: FinalizeGlobalState,
store: &FinalizeStore<N, P>,
deployment: &Deployment<N>,
fee: &Fee<N>,
) -> Result<(Stack<N>, Vec<FinalizeOperation<N>>)>
pub fn finalize_deployment<P: FinalizeStorage<N>>( &self, state: FinalizeGlobalState, store: &FinalizeStore<N, P>, deployment: &Deployment<N>, fee: &Fee<N>, ) -> Result<(Stack<N>, Vec<FinalizeOperation<N>>)>
Finalizes the deployment and fee.
This method assumes the given deployment is valid.
This method should only be called by VM::finalize()
.
Sourcepub fn finalize_execution<P: FinalizeStorage<N>>(
&self,
state: FinalizeGlobalState,
store: &FinalizeStore<N, P>,
execution: &Execution<N>,
fee: Option<&Fee<N>>,
) -> Result<Vec<FinalizeOperation<N>>>
pub fn finalize_execution<P: FinalizeStorage<N>>( &self, state: FinalizeGlobalState, store: &FinalizeStore<N, P>, execution: &Execution<N>, fee: Option<&Fee<N>>, ) -> Result<Vec<FinalizeOperation<N>>>
Finalizes the execution and fee.
This method assumes the given execution is valid.
This method should only be called by VM::finalize()
.
Sourcepub fn finalize_fee<P: FinalizeStorage<N>>(
&self,
state: FinalizeGlobalState,
store: &FinalizeStore<N, P>,
fee: &Fee<N>,
) -> Result<Vec<FinalizeOperation<N>>>
pub fn finalize_fee<P: FinalizeStorage<N>>( &self, state: FinalizeGlobalState, store: &FinalizeStore<N, P>, fee: &Fee<N>, ) -> Result<Vec<FinalizeOperation<N>>>
Finalizes the fee.
This method assumes the given fee is valid.
This method should only be called by VM::finalize()
.
Source§impl<N: Network> Process<N>
impl<N: Network> Process<N>
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 ordered.
Source§impl<N: Network> Process<N>
impl<N: Network> Process<N>
Sourcepub fn verify_execution(&self, execution: &Execution<N>) -> Result<()>
pub fn verify_execution(&self, execution: &Execution<N>) -> Result<()>
Verifies the given execution is valid. Note: This does not check that the global state root exists in the ledger.
Source§impl<N: Network> Process<N>
impl<N: Network> Process<N>
pub fn construct_call_graph( &self, execution: &Execution<N>, ) -> Result<HashMap<N::TransitionID, Vec<N::TransitionID>>>
Source§impl<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.
Source§impl<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: impl TryInto<ProgramID<N>>,
) -> Result<&Arc<Stack<N>>>
pub fn get_stack( &self, program_id: impl TryInto<ProgramID<N>>, ) -> Result<&Arc<Stack<N>>>
Returns the stack for the given program ID.
Sourcepub fn get_program(
&self,
program_id: impl TryInto<ProgramID<N>>,
) -> Result<&Program<N>>
pub fn get_program( &self, program_id: impl TryInto<ProgramID<N>>, ) -> Result<&Program<N>>
Returns the program for the given program ID.
Sourcepub fn get_proving_key(
&self,
program_id: impl TryInto<ProgramID<N>>,
function_name: impl TryInto<Identifier<N>>,
) -> Result<ProvingKey<N>>
pub fn get_proving_key( &self, program_id: impl TryInto<ProgramID<N>>, function_name: impl TryInto<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: impl TryInto<ProgramID<N>>,
function_name: impl TryInto<Identifier<N>>,
) -> Result<VerifyingKey<N>>
pub fn get_verifying_key( &self, program_id: impl TryInto<ProgramID<N>>, function_name: impl TryInto<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.
Sourcepub fn synthesize_key<A: Aleo<Network = N>, R: Rng + CryptoRng>(
&self,
program_id: &ProgramID<N>,
function_name: &Identifier<N>,
rng: &mut R,
) -> Result<()>
pub fn synthesize_key<A: Aleo<Network = N>, R: Rng + CryptoRng>( &self, program_id: &ProgramID<N>, function_name: &Identifier<N>, rng: &mut R, ) -> Result<()>
Synthesizes the proving and verifying key for the given program ID and function name.
Trait Implementations§
Auto Trait Implementations§
impl<N> Freeze for Process<N>
impl<N> !RefUnwindSafe for Process<N>
impl<N> Send for Process<N>
impl<N> Sync for Process<N>
impl<N> Unpin for Process<N>
impl<N> !UnwindSafe for Process<N>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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