definition

Attribute Macro definition 

Source
#[definition]
Expand description

Chain extension definition for use with Substrate-based nodes and ink! smart contracts.

§Description

This macro generates code based on activated OBCE features.

When used with ink feature, #[obce::definition] generates a glue code to correctly call your chain extension from ink! smart contracts.

The behaviour of #[obce::definition] with substrate feature enabled is to leave everything as-is, without any additional modifications.

pub struct ChainExtension;

#[obce::definition]
pub trait ChainExtensionDefinition {
    fn some_method(&self, argument: u32) -> u64;
}

§Custom identifiers

You can use #[obce::definition(id = ...)] and #[obce(id = ...)] to override the automatically generated chain extension identifier and chain extension method identifier correspondingly.

id accepts literals of type &str and u16.