pub trait MerkleRootStorage<Key, StorageType>: StorageMutate<StorageType>where
    StorageType: Mappable,{
    // Required method
    fn root(&self, key: &Key) -> Result<[u8; 32], Self::Error>;
}
Expand description

Returns the merkle root for the StorageType per merkle Key. The type should implement the StorageMutate for the StorageType. Per one storage, it is possible to have several merkle trees under different Key.

Required Methods§

fn root(&self, key: &Key) -> Result<[u8; 32], Self::Error>

Return the merkle root of the stored Type in the storage.

The cryptographic primitive is an arbitrary choice of the implementor and this trait won’t impose any restrictions to that.

Implementations on Foreign Types§

source§

impl<Key, Type> MerkleRootStorage<Key, Type> for PredicateStoragewhere Type: Mappable,

source§

fn root(&self, _parent: &Key) -> Result<[u8; 32], InterpreterError>

source§

impl MerkleRootStorage<ContractId, ContractsState> for MemoryStorage

source§

fn root(&self, parent: &ContractId) -> Result<[u8; 32], Infallible>

source§

impl MerkleRootStorage<ContractId, ContractsAssets> for MemoryStorage

source§

fn root(&self, parent: &ContractId) -> Result<[u8; 32], Infallible>

§

impl<'a, T, Key, Type> MerkleRootStorage<Key, Type> for &'a mut Twhere T: MerkleRootStorage<Key, Type> + ?Sized, Type: Mappable,

§

fn root( &self, key: &Key ) -> Result<[u8; 32], <&'a mut T as StorageInspect<Type>>::Error>

Implementors§