DataContractProvider

Trait DataContractProvider 

pub trait DataContractProvider: Send + Sync {
    // Required method
    fn as_contract_lookup_fn<'a>(
        &'a self,
        platform_version: &'a PlatformVersion,
    ) -> Box<dyn Fn(&Identifier) -> Result<Option<Arc<DataContract>>, Error> + 'a>;
}
Expand description

A trait that provides a function that can be used to look up a DataContract by its Identifier.

This trait is automatically implemented for any type that implements ContextProvider. It is used internally by the Drive proof verification functions to look up data contracts.

Required Methods§

fn as_contract_lookup_fn<'a>( &'a self, platform_version: &'a PlatformVersion, ) -> Box<dyn Fn(&Identifier) -> Result<Option<Arc<DataContract>>, Error> + 'a>

Returns ContractLookupFn function that can be used to look up a DataContract by its Identifier.

Implementors§

§

impl<C> DataContractProvider for C
where C: ContextProvider + ?Sized,