RegistryManagementTrait

Trait RegistryManagementTrait 

Source
pub trait RegistryManagementTrait {
    type Error: From<StdError>;

    // Required methods
    fn register_plugin(
        &self,
        ctx: ExecCtx<'_>,
        code_data: PluginCodeData,
        metadata_data: PluginMetadataData,
    ) -> Result<Response, Self::Error>;
    fn unregister_plugin(
        &self,
        ctx: ExecCtx<'_>,
        id: u64,
    ) -> Result<Response, Self::Error>;
    fn new_plugin_version(
        &self,
        ctx: ExecCtx<'_>,
        id: u64,
        code_update: Option<PluginCodeData>,
        metadata_update: PluginMetadataData,
    ) -> Result<Response, Self::Error>;
    fn update_registry_fee(
        &self,
        ctx: ExecCtx<'_>,
        new_fee: Coin,
    ) -> Result<Response, Self::Error>;
    fn add_or_update_subscription_tiers(
        &self,
        ctx: ExecCtx<'_>,
        tier: u8,
        details: TierDetails,
    ) -> Result<Response, Self::Error>;
    fn get_plugins(
        &self,
        ctx: QueryCtx<'_>,
        limit: Option<u32>,
        start_after: Option<u32>,
    ) -> StdResult<PluginsResponse>;
    fn get_plugin_by_id(
        &self,
        ctx: QueryCtx<'_>,
        id: u64,
    ) -> StdResult<Option<Plugin>>;
    fn get_plugin_by_address(
        &self,
        ctx: QueryCtx<'_>,
        contract_addr: String,
    ) -> StdResult<PluginWithVersionResponse>;
    fn get_config(&self, ctx: QueryCtx<'_>) -> StdResult<RegistryConfigResponse>;
    fn contract_version(
        &self,
        ctx: QueryCtx<'_>,
    ) -> Result<ContractVersion, StdError>;
}
Expand description

The trait for each authenticator contract

Required Associated Types§

Required Methods§

Source

fn register_plugin( &self, ctx: ExecCtx<'_>, code_data: PluginCodeData, metadata_data: PluginMetadataData, ) -> Result<Response, Self::Error>

Source

fn unregister_plugin( &self, ctx: ExecCtx<'_>, id: u64, ) -> Result<Response, Self::Error>

Source

fn new_plugin_version( &self, ctx: ExecCtx<'_>, id: u64, code_update: Option<PluginCodeData>, metadata_update: PluginMetadataData, ) -> Result<Response, Self::Error>

Source

fn update_registry_fee( &self, ctx: ExecCtx<'_>, new_fee: Coin, ) -> Result<Response, Self::Error>

Source

fn add_or_update_subscription_tiers( &self, ctx: ExecCtx<'_>, tier: u8, details: TierDetails, ) -> Result<Response, Self::Error>

Adding new tiers To remove tier there may already be subscribers and so it will require a migration function

Source

fn get_plugins( &self, ctx: QueryCtx<'_>, limit: Option<u32>, start_after: Option<u32>, ) -> StdResult<PluginsResponse>

Source

fn get_plugin_by_id( &self, ctx: QueryCtx<'_>, id: u64, ) -> StdResult<Option<Plugin>>

Source

fn get_plugin_by_address( &self, ctx: QueryCtx<'_>, contract_addr: String, ) -> StdResult<PluginWithVersionResponse>

This helps to do all the neccessary queries to allow caller to know the ipfs_hash

Source

fn get_config(&self, ctx: QueryCtx<'_>) -> StdResult<RegistryConfigResponse>

Source

fn contract_version( &self, ctx: QueryCtx<'_>, ) -> Result<ContractVersion, StdError>

Implementors§