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_apps() -> Result<Vec<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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.