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

Implementations§

source§

impl<N: Network> Transition<N>

source

pub fn to_root(&self) -> Result<Field<N>>

Returns the transition root, by computing the root for a Merkle tree of the input and output IDs.

source

pub fn to_path(&self, leaf: &TransitionLeaf<N>) -> Result<TransitionPath<N>>

Returns the Merkle path for the transition leaf.

source

pub fn to_leaf( &self, id: &Field<N>, is_input: bool ) -> Result<TransitionLeaf<N>>

Returns the Merkle leaf for the given input or output ID in the transition.

source

pub fn to_tree(&self) -> Result<TransitionTree<N>>

The Merkle tree of input and output IDs for the transition.

source§

impl<N: Network> Transition<N>

source

pub fn new( program_id: ProgramID<N>, function_name: Identifier<N>, inputs: Vec<Input<N>>, outputs: Vec<Output<N>>, tpk: Group<N>, tcm: Field<N> ) -> Result<Self>

Initializes a new transition.

source

pub fn from( request: &Request<N>, response: &Response<N>, output_types: &[ValueType<N>], output_registers: &[Option<Register<N>>] ) -> Result<Self>

Initializes a new transition from a request and response.

source§

impl<N: Network> Transition<N>

source

pub const fn id(&self) -> &N::TransitionID

Returns the transition ID.

source

pub const fn program_id(&self) -> &ProgramID<N>

Returns the program ID.

source

pub const fn function_name(&self) -> &Identifier<N>

Returns the function name.

source

pub fn inputs(&self) -> &[Input<N>]

Returns the inputs.

source

pub fn outputs(&self) -> &[Output<N>]

Return the outputs.

source

pub const fn tpk(&self) -> &Group<N>

Returns the transition public key.

source

pub const fn tcm(&self) -> &Field<N>

Returns the transition commitment.

source§

impl<N: Network> Transition<N>

source

pub fn is_bond(&self) -> bool

Returns true if this is a bond transition.

source

pub fn is_unbond(&self) -> bool

Returns true if this is an unbond transition.

source

pub fn is_fee_private(&self) -> bool

Returns true if this is a fee_private transition.

source

pub fn is_fee_public(&self) -> bool

Returns true if this is a fee_public transition.

source

pub fn is_split(&self) -> bool

Returns true if this is a split transition.

source§

impl<N: Network> Transition<N>

source

pub fn contains_serial_number(&self, serial_number: &Field<N>) -> bool

Returns true if the transition contains the given serial number.

source

pub fn contains_commitment(&self, commitment: &Field<N>) -> bool

Returns true if the transition contains the given commitment.

source§

impl<N: Network> Transition<N>

source

pub fn find_record( &self, commitment: &Field<N> ) -> Option<&Record<N, Ciphertext<N>>>

Returns the record with the corresponding commitment, if it exists.

source§

impl<N: Network> Transition<N>

source

pub fn input_ids(&self) -> impl '_ + ExactSizeIterator<Item = &Field<N>>

Returns the input IDs.

source

pub fn serial_numbers(&self) -> impl '_ + Iterator<Item = &Field<N>>

Returns an iterator over the serial numbers, for inputs that are records.

source

pub fn tags(&self) -> impl '_ + Iterator<Item = &Field<N>>

Returns an iterator over the tags, for inputs that are records.

source

pub fn output_ids(&self) -> impl '_ + ExactSizeIterator<Item = &Field<N>>

Returns the output IDs.

source

pub fn commitments(&self) -> impl '_ + Iterator<Item = &Field<N>>

Returns an iterator over the commitments, for outputs that are records.

source

pub fn nonces(&self) -> impl '_ + Iterator<Item = &Group<N>>

Returns an iterator over the nonces, for outputs that are records.

source

pub fn records( &self ) -> impl '_ + Iterator<Item = (&Field<N>, &Record<N, Ciphertext<N>>)>

Returns an iterator over the output records, as a tuple of (commitment, record).

source§

impl<N: Network> Transition<N>

source

pub fn into_id(self) -> N::TransitionID

Returns the transition ID, and consumes self.

source

pub fn into_serial_numbers(self) -> impl Iterator<Item = Field<N>>

Returns a consuming iterator over the serial numbers, for inputs that are records.

source

pub fn into_tags(self) -> impl Iterator<Item = Field<N>>

Returns a consuming iterator over the tags, for inputs that are records.

source

pub fn into_commitments(self) -> impl Iterator<Item = Field<N>>

Returns a consuming iterator over the commitments, for outputs that are records.

source

pub fn into_nonces(self) -> impl Iterator<Item = Group<N>>

Returns a consuming iterator over the nonces, for outputs that are records.

source

pub fn into_records( self ) -> impl Iterator<Item = (Field<N>, Record<N, Ciphertext<N>>)>

Returns a consuming iterator over the output records, as a tuple of (commitment, record).

source

pub fn into_tpk(self) -> Group<N>

Returns the transition public key, and consumes self.

Trait Implementations§

source§

impl<N: Clone + Network> Clone for Transition<N>where N::TransitionID: Clone,

source§

fn clone(&self) -> Transition<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
source§

impl<N: Network> Debug for Transition<N>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Prints the transition as a JSON-string.

source§

impl<'de, N: Network> Deserialize<'de> for Transition<N>

source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserializes the transition from a string or bytes.

source§

impl<N: Network> Display for Transition<N>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Displays the transition as a JSON-string.

source§

impl<N: Network> FromBytes for Transition<N>

source§

fn read_le<R: Read>(reader: R) -> IoResult<Self>

Reads the output from a buffer.

§

fn from_bytes_le(bytes: &[u8]) -> Result<Self, Error>where Self: Sized,

Returns Self from a byte array in little-endian order.
source§

impl<N: Network> FromStr for Transition<N>

source§

fn from_str(transition: &str) -> Result<Self, Self::Err>

Initializes the transition from a JSON-string.

§

type Err = Error

The associated error which can be returned from parsing.
source§

impl<N: PartialEq + Network> PartialEq for Transition<N>where N::TransitionID: PartialEq,

source§

fn eq(&self, other: &Transition<N>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<N: Network> Serialize for Transition<N>

source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serializes the transition into string or bytes.

source§

impl<N: Network> ToBytes for Transition<N>

source§

fn write_le<W: Write>(&self, writer: W) -> IoResult<()>

Writes the literal to a buffer.

§

fn to_bytes_le(&self) -> Result<Vec<u8>, Error>where Self: Sized,

Returns self as a byte array in little-endian order.
source§

impl<N: Eq + Network> Eq for Transition<N>where N::TransitionID: Eq,

source§

impl<N: Network> StructuralEq for Transition<N>

source§

impl<N: Network> StructuralPartialEq for Transition<N>

Auto Trait Implementations§

§

impl<N> RefUnwindSafe for Transition<N>where N: RefUnwindSafe, <N as Environment>::Field: RefUnwindSafe, <N as Environment>::Projective: RefUnwindSafe, <N as Environment>::Scalar: RefUnwindSafe, <N as Network>::TransitionID: RefUnwindSafe,

§

impl<N> Send for Transition<N>

§

impl<N> Sync for Transition<N>

§

impl<N> Unpin for Transition<N>where N: Unpin, <N as Environment>::Field: Unpin, <N as Environment>::Projective: Unpin, <N as Environment>::Scalar: Unpin, <N as Network>::TransitionID: Unpin,

§

impl<N> UnwindSafe for Transition<N>where N: UnwindSafe, <N as Environment>::Field: UnwindSafe, <N as Environment>::Projective: UnwindSafe, <N as Environment>::Scalar: UnwindSafe, <N as Network>::TransitionID: UnwindSafe,

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
§

impl<'de, T> DeserializeExt<'de> for Twhere T: DeserializeOwned,

§

fn take_from_value<D>( value: &mut Value, field: &str ) -> Result<T, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,

§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. 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> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,