pub trait ChainExtension {
    fn func_id(&self) -> u32;
    fn call(&mut self, input: &[u8], output: &mut Vec<u8, Global>) -> u32;
Expand description

Types implementing this trait can be used as chain extensions.

This trait is only useful for testing contract via the off-chain environment.

Required Methods§

The static function ID of the chain extension.


This is expected to return a constant value.

Calls the chain extension with the given input.

Returns an error code and may fill the output buffer with a SCALE encoded result.