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 a call to the program function for the given inputs.
Compared to authorize, this method does not check for circuit satisfiability of the request.
Authorizes a call to the program function for the given inputs.
Compared to authorize, no private key is needed, but this only works for single public requests.
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>, ProcessDeployError>
pub fn deploy<A: Aleo<Network = N>, R: Rng + CryptoRng>( &self, program: &Program<N>, rng: &mut R, ) -> Result<Deployment<N>, ProcessDeployError>
Deploys the given program ID, if it does not exist.
Sourcepub fn load_deployment(&self, deployment: &Deployment<N>) -> Result<()>
pub fn load_deployment(&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 evaluate<A: Aleo<Network = N>>(
&self,
authorization: Authorization<N>,
) -> Result<Response<N>, ProcessEvalError>
pub fn evaluate<A: Aleo<Network = N>>( &self, authorization: Authorization<N>, ) -> Result<Response<N>, ProcessEvalError>
Evaluates a program function on the given request.
Source§impl<N: Network> Process<N>
impl<N: Network> Process<N>
Sourcepub fn verify_deployment<A: Aleo<Network = N>, R: Rng + CryptoRng>(
&self,
consensus_version: ConsensusVersion,
deployment: &Deployment<N>,
rng: &mut R,
) -> Result<()>
pub fn verify_deployment<A: Aleo<Network = N>, R: Rng + CryptoRng>( &self, consensus_version: ConsensusVersion, 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 ensure_records_exist<'a>(
transitions: impl ExactSizeIterator<Item = &'a Transition<N>> + DoubleEndedIterator + Clone,
call_graph: &HashMap<N::TransitionID, Vec<N::TransitionID>>,
execution_stacks: &IndexMap<ProgramID<N>, Arc<Stack<N>>>,
) -> Result<()>
pub fn ensure_records_exist<'a>( transitions: impl ExactSizeIterator<Item = &'a Transition<N>> + DoubleEndedIterator + Clone, call_graph: &HashMap<N::TransitionID, Vec<N::TransitionID>>, execution_stacks: &IndexMap<ProgramID<N>, Arc<Stack<N>>>, ) -> Result<()>
Checks that, for each non-closure function in the execution, each ExternalRecord and DynamicRecord received as an input or from a callee corresponds to a static Record that exists on the ledger at the end of the execution (whether spent or not). A function given this guarantee should itself ensure that all records it outputs or passes to non-closure callees exist on the ledger at the end of the execution.
Input transitions: Iterator over the Transitions in the execution. The root transition must be last.
Input call_graph: A copy of the call graph. It is assumed to contain all transitions in transitions. All
children of a given Transition ID must appear in the same order as the corresponding calls happen in the
function.
Source§impl<N: Network> Process<N>
impl<N: Network> Process<N>
Sourcepub fn verify_execution(
consensus_version: ConsensusVersion,
varuna_version: VarunaVersion,
inclusion_version: InclusionVersion,
execution: &Execution<N>,
execution_stacks: &IndexMap<ProgramID<N>, Arc<Stack<N>>>,
) -> Result<()>
pub fn verify_execution( consensus_version: ConsensusVersion, varuna_version: VarunaVersion, inclusion_version: InclusionVersion, execution: &Execution<N>, execution_stacks: &IndexMap<ProgramID<N>, Arc<Stack<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<'a>( transitions: impl ExactSizeIterator<Item = &'a Transition<N>> + DoubleEndedIterator, execution_stacks: &IndexMap<ProgramID<N>, Arc<Stack<N>>>, ) -> Result<HashMap<N::TransitionID, Vec<N::TransitionID>>>
Source§impl<N: Network> Process<N>
impl<N: Network> Process<N>
Sourcepub fn verify_fee(
&self,
consensus_version: ConsensusVersion,
varuna_version: VarunaVersion,
inclusion_version: InclusionVersion,
fee: &Fee<N>,
deployment_or_execution_id: Field<N>,
) -> Result<()>
pub fn verify_fee( &self, consensus_version: ConsensusVersion, varuna_version: VarunaVersion, inclusion_version: InclusionVersion, fee: &Fee<N>, deployment_or_execution_id: Field<N>, ) -> Result<()>
Verifies the given fee 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>
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 lock(&self) -> ProcessExclusiveGuard<'_, N>
pub fn lock(&self) -> ProcessExclusiveGuard<'_, N>
Guard the Process against any concurrent reads or writes.
Sourcepub fn mapping_types_exist(&self, program: &Program<N>) -> Result<()>
pub fn mapping_types_exist(&self, program: &Program<N>) -> Result<()>
Ensure that the types referred to in this program’s mappings exist.
Source§impl<N: Network> Process<N>
impl<N: Network> Process<N>
Sourcepub fn load_v0() -> Result<Self>
pub fn load_v0() -> Result<Self>
Initializes a new process with the V0 credits.aleo verifiying keys.
Sourcepub const fn universal_srs(&self) -> &UniversalSRS<N>
pub const fn universal_srs(&self) -> &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 program_ids(&self) -> Vec<ProgramID<N>>
pub fn program_ids(&self) -> Vec<ProgramID<N>>
Returns the program IDs of all programs in the process.
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_latest_edition_for_program(&self, program_id: &ProgramID<N>) -> u16
pub fn get_latest_edition_for_program(&self, program_id: &ProgramID<N>) -> u16
Returns the latest deployed edition for the given program ID, defaulting to 0 if unknown.
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 remove_proving_key(
&self,
program_id: &ProgramID<N>,
function_name: &Identifier<N>,
) -> Result<()>
pub fn remove_proving_key( &self, program_id: &ProgramID<N>, function_name: &Identifier<N>, ) -> Result<()>
Removes 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 remove_verifying_key(
&self,
program_id: &ProgramID<N>,
function_name: &Identifier<N>,
) -> Result<()>
pub fn remove_verifying_key( &self, program_id: &ProgramID<N>, function_name: &Identifier<N>, ) -> Result<()>
Removes 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.
Sourcepub fn synthesize_translation_key<A: Aleo<Network = N>, R: Rng + CryptoRng>(
&self,
program_id: &ProgramID<N>,
record_name: &Identifier<N>,
rng: &mut R,
) -> Result<()>
pub fn synthesize_translation_key<A: Aleo<Network = N>, R: Rng + CryptoRng>( &self, program_id: &ProgramID<N>, record_name: &Identifier<N>, rng: &mut R, ) -> Result<()>
Synthesizes the translation key for the given record name.
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> UnsafeUnpin 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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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