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

Implementations§

source§

impl<N> Process<N>where N: Network,

source

pub fn authorize<A, R>( &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>, Error>where A: Aleo<Network = N>, R: Rng + CryptoRng,

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

source

pub fn authorize_fee_private<A, R>( &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>, Error>where A: Aleo<Network = N>, R: Rng + CryptoRng,

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, R>( &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>, Error>where A: Aleo<Network = N>, R: Rng + CryptoRng,

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

source§

impl<N> Process<N>where N: Network,

source

pub fn deploy<A, R>( &self, program: &ProgramCore<N, Instruction<N>, Command<N>>, rng: &mut R ) -> Result<Deployment<N>, Error>where A: Aleo<Network = N>, R: Rng + CryptoRng,

Deploys the given program ID, if it does not exist.

source

pub fn load_deployment( &mut self, deployment: &Deployment<N> ) -> Result<(), Error>

Adds the newly-deployed program. This method assumes the given deployment is valid.

source§

impl<N> Process<N>where N: Network,

source

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

Evaluates a program function on the given request.

source§

impl<N> Process<N>where N: Network,

source

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

Executes the given authorization.

source§

impl<N> Process<N>where N: Network,

source

pub fn finalize_deployment<P>( &self, state: FinalizeGlobalState, store: &FinalizeStore<N, P>, deployment: &Deployment<N>, fee: &Fee<N> ) -> Result<(Stack<N>, Vec<FinalizeOperation<N>>), Error>where P: FinalizeStorage<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>( &self, state: FinalizeGlobalState, store: &FinalizeStore<N, P>, execution: &Execution<N>, fee: Option<&Fee<N>> ) -> Result<Vec<FinalizeOperation<N>>, Error>where P: FinalizeStorage<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>( &self, state: FinalizeGlobalState, store: &FinalizeStore<N, P>, fee: &Fee<N> ) -> Result<Vec<FinalizeOperation<N>>, Error>where P: FinalizeStorage<N>,

Finalizes the fee. This method assumes the given fee is valid. This method should only be called by VM::finalize().

source§

impl<N> Process<N>where N: Network,

source

pub fn verify_deployment<A, R>( &self, deployment: &Deployment<N>, rng: &mut R ) -> Result<(), Error>where A: Aleo<Network = N>, R: Rng + CryptoRng,

Verifies the given deployment is ordered.

source§

impl<N> Process<N>where N: Network,

source

pub fn verify_execution(&self, execution: &Execution<N>) -> Result<(), Error>

Verifies the given execution is valid. Note: This does not check that the global state root exists in the ledger.

source§

impl<N> Process<N>where N: Network,

source

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

source§

impl<N> Process<N>where N: Network,

source

pub fn verify_fee( &self, fee: &Fee<N>, deployment_or_execution_id: Field<N> ) -> Result<(), Error>

Verifies the given fee is valid. Note: This does not check that the global state root exists in the ledger.

source§

impl<N> Process<N>where N: Network,

source

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

Initializes a new process.

source

pub fn add_program( &mut self, program: &ProgramCore<N, Instruction<N>, Command<N>> ) -> Result<(), Error>

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> Process<N>where N: Network,

source

pub fn load() -> Result<Process<N>, Error>

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>>, Error>

Returns the stack for the given program ID.

source

pub fn get_program( &self, program_id: impl TryInto<ProgramID<N>> ) -> Result<&ProgramCore<N, Instruction<N>, Command<N>>, Error>

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>, Error>

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>, Error>

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<(), Error>

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<(), Error>

Inserts the given verifying key, for the given program ID and function name.

source

pub fn synthesize_key<A, R>( &self, program_id: &ProgramID<N>, function_name: &Identifier<N>, rng: &mut R ) -> Result<(), Error>where A: Aleo<Network = N>, R: Rng + CryptoRng,

Synthesizes the proving and verifying key for the given program ID and function name.

Trait Implementations§

source§

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

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> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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

source§

impl<T> WithSubscriber for T

source§

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
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more