Struct snarkos_toolkit::dpc::empty_ledger::EmptyLedger [−][src]
Trait Implementations
impl<T: Transaction, P: LoadableMerkleParameters> LedgerScheme for EmptyLedger<T, P>[src]
type Block = Block<Self::Transaction>
type Commitment = T::Commitment
type MerkleParameters = P
type MerklePath = MerklePath<Self::MerkleParameters>
type MerkleTreeDigest = MerkleTreeDigest<Self::MerkleParameters>
type SerialNumber = T::SerialNumber
type Transaction = T
fn new(
_path: &PathBuf,
parameters: Self::MerkleParameters,
_genesis_block: Self::Block
) -> Result<Self>[src]
_path: &PathBuf,
parameters: Self::MerkleParameters,
_genesis_block: Self::Block
) -> Result<Self>
Instantiates a new ledger with a genesis block.
fn len(&self) -> usize[src]
Returns the number of blocks including the genesis block
fn parameters(&self) -> &Self::MerkleParameters[src]
Return the parameters used to construct the ledger Merkle tree.
fn digest(&self) -> Option<Self::MerkleTreeDigest>[src]
Return a digest of the latest ledger Merkle tree.
fn validate_digest(&self, _digest: &Self::MerkleTreeDigest) -> bool[src]
Check that st_{ts} is a valid digest for some (past) ledger state.
fn contains_cm(&self, _cm: &Self::Commitment) -> bool[src]
Returns true if the given commitment exists in the ledger.
fn contains_sn(&self, _sn: &Self::SerialNumber) -> bool[src]
Returns true if the given serial number exists in the ledger.
fn contains_memo(
&self,
_memo: &<Self::Transaction as Transaction>::Memorandum
) -> bool[src]
&self,
_memo: &<Self::Transaction as Transaction>::Memorandum
) -> bool
Returns true if the given memo exists in the ledger.
fn prove_cm(&self, _cm: &Self::Commitment) -> Result<Self::MerklePath>[src]
Returns the Merkle path to the latest ledger digest for a given commitment, if it exists in the ledger.
fn verify_cm(
_parameters: &Self::MerkleParameters,
_digest: &Self::MerkleTreeDigest,
_cm: &Self::Commitment,
_witness: &Self::MerklePath
) -> bool[src]
_parameters: &Self::MerkleParameters,
_digest: &Self::MerkleTreeDigest,
_cm: &Self::Commitment,
_witness: &Self::MerklePath
) -> bool
Returns true if the given Merkle path is a valid witness for the given ledger digest and commitment.
Auto Trait Implementations
impl<T, P> RefUnwindSafe for EmptyLedger<T, P> where
P: RefUnwindSafe,
T: RefUnwindSafe,
P: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, P> Send for EmptyLedger<T, P> where
P: Send,
T: Send,
P: Send,
T: Send,
impl<T, P> Sync for EmptyLedger<T, P> where
P: Sync,
T: Sync,
P: Sync,
T: Sync,
impl<T, P> Unpin for EmptyLedger<T, P> where
P: Unpin,
T: Unpin,
P: Unpin,
T: Unpin,
impl<T, P> UnwindSafe for EmptyLedger<T, P> where
P: UnwindSafe,
T: UnwindSafe,
P: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,