Trait oasis_runtime_sdk::modules::rofl::API

source ·
pub trait API {
    // Required methods
    fn get_origin_rak() -> Option<PublicKey>;
    fn get_origin_registration(app: AppId) -> Option<Registration>;
    fn is_authorized_origin(app: AppId) -> bool;
    fn get_registration(
        app: AppId,
        rak: PublicKey,
    ) -> Result<Registration, Error>;
    fn get_app(id: AppId) -> Result<AppConfig, Error>;
    fn get_instances(id: AppId) -> Result<Vec<Registration>, Error>;
}
Expand description

Interface that can be called from other modules.

Required Methods§

source

fn get_origin_rak() -> Option<PublicKey>

Get the Runtime Attestation Key of the ROFL app instance in case the origin transaction is signed by a ROFL instance. Otherwise None is returned.

§Panics

This method will panic if called outside a transaction environment.

source

fn get_origin_registration(app: AppId) -> Option<Registration>

Get the registration descriptor of the ROFL app instance in case the origin transaction is signed by a ROFL instance of the specified app. Otherwise None is returned.

§Panics

This method will panic if called outside a transaction environment.

source

fn is_authorized_origin(app: AppId) -> bool

Verify whether the origin transaction is signed by an authorized ROFL instance for the given application.

§Panics

This method will panic if called outside a transaction environment.

source

fn get_registration(app: AppId, rak: PublicKey) -> Result<Registration, Error>

Get a specific registered instance for an application.

source

fn get_app(id: AppId) -> Result<AppConfig, Error>

Get an application’s configuration.

source

fn get_instances(id: AppId) -> Result<Vec<Registration>, Error>

Get all registered instances for an application.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<Cfg: Config> API for Module<Cfg>