Trait SystemTransactionRuntimeApi

Source
pub trait SystemTransactionRuntimeApi<E> {
    // Required methods
    fn bech32_encode_address(
        &mut self,
        address: GlobalAddress,
    ) -> Result<String, E>;
    fn get_transaction_hash(&mut self) -> Result<Hash, E>;
    fn generate_ruid(&mut self) -> Result<[u8; 32], E>;
    fn emit_log(&mut self, level: Level, message: String) -> Result<(), E>;
    fn panic(&mut self, message: String) -> Result<(), E>;
}

Required Methods§

Source

fn bech32_encode_address(&mut self, address: GlobalAddress) -> Result<String, E>

Encode an address into Bech32. The HRP part is dependent on the network which is running.

Source

fn get_transaction_hash(&mut self) -> Result<Hash, E>

Retrieve the hash of the current transaction which is running.

Source

fn generate_ruid(&mut self) -> Result<[u8; 32], E>

Generate a unique id

Source

fn emit_log(&mut self, level: Level, message: String) -> Result<(), E>

Emit a log message which will be available in the transaction receipt

Source

fn panic(&mut self, message: String) -> Result<(), E>

End the transaction immediately with a given message to be included in the transaction receipt

Implementors§