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§
sourcefn get_origin_rak() -> Option<PublicKey>
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.
sourcefn get_origin_registration(app: AppId) -> Option<Registration>
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.
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.
sourcefn get_registration(app: AppId, rak: PublicKey) -> Result<Registration, Error>
fn get_registration(app: AppId, rak: PublicKey) -> Result<Registration, Error>
Get a specific registered instance for an application.
sourcefn get_instances(id: AppId) -> Result<Vec<Registration>, Error>
fn get_instances(id: AppId) -> Result<Vec<Registration>, Error>
Get all registered instances for an application.