pub struct Process<N: Network> { /* private fields */ }

Implementations§

source§

impl<N: Network> Process<N>

source

pub fn authorize<A: Aleo<Network = N>, R: Rng + CryptoRng>( &self, private_key: &PrivateKey<N>, program_id: impl TryInto<ProgramID<N>>, function_name: impl TryInto<Identifier<N>>, inputs: impl ExactSizeIterator<Item = impl TryInto<Value<N>>>, rng: &mut R ) -> Result<Authorization<N>>

Authorizes a call to the program function for the given inputs.

source

pub fn authorize_fee_private<A: Aleo<Network = N>, R: Rng + CryptoRng>( &self, private_key: &PrivateKey<N>, credits: Record<N, Plaintext<N>>, base_fee_in_microcredits: u64, priority_fee_in_microcredits: u64, deployment_or_execution_id: Field<N>, rng: &mut R ) -> Result<Authorization<N>>

Authorizes the fee given the credits record, the fee amount (in microcredits), and the deployment or execution ID.

source

pub fn authorize_fee_public<A: Aleo<Network = N>, R: Rng + CryptoRng>( &self, private_key: &PrivateKey<N>, base_fee_in_microcredits: u64, priority_fee_in_microcredits: u64, deployment_or_execution_id: Field<N>, rng: &mut R ) -> Result<Authorization<N>>

Authorizes the fee given the the fee amount (in microcredits) and the deployment or execution ID.

source§

impl<N: Network> Process<N>

source

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.

source

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>

source

pub fn evaluate<A: Aleo<Network = N>>( &self, authorization: Authorization<N> ) -> Result<Response<N>>

Evaluates a program function on the given request.

source§

impl<N: Network> Process<N>

source

pub fn execute<A: Aleo<Network = N>, R: CryptoRng + Rng>( &self, authorization: Authorization<N>, rng: &mut R ) -> Result<(Response<N>, Trace<N>)>

Executes the given authorization.

source§

impl<N: Network> Process<N>

source

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().

source

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().

source

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>

source

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>

source

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>

source

pub fn construct_call_graph( &self, execution: &Execution<N> ) -> Result<HashMap<N::TransitionID, Vec<N::TransitionID>>>

source§

impl<N: Network> Process<N>

source

pub fn verify_fee( &self, 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>

source

pub fn setup<A: Aleo<Network = N>, R: Rng + CryptoRng>( rng: &mut R ) -> Result<Self>

Initializes a new process.

source

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

pub fn add_stack(&mut self, stack: Stack<N>)

Adds a new stack to the process. If you intend to execute the program, use deploy and finalize_deployment instead.

source§

impl<N: Network> Process<N>

source

pub fn load() -> Result<Self>

Initializes a new process.

source

pub const fn universal_srs(&self) -> &Arc<UniversalSRS<N>>

Returns the universal SRS.

source

pub fn contains_program(&self, program_id: &ProgramID<N>) -> bool

Returns true if the process contains the program with the given ID.

source

pub fn get_stack( &self, program_id: impl TryInto<ProgramID<N>> ) -> Result<&Arc<Stack<N>>>

Returns the stack for the given program ID.

source

pub fn get_program( &self, program_id: impl TryInto<ProgramID<N>> ) -> Result<&Program<N>>

Returns the program for the given program ID.

source

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.

source

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.

source

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.

source

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.

source

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§

source§

impl<N: Clone + Network> Clone for Process<N>

source§

fn clone(&self) -> Process<N>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

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 as Environment>::Field: Unpin,

§

impl<N> !UnwindSafe for Process<N>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V