sui_bridge::encoding

Trait BridgeMessageEncoding

Source
pub trait BridgeMessageEncoding {
    // Required methods
    fn as_bytes(&self) -> Vec<u8> ;
    fn as_payload_bytes(&self) -> Vec<u8> ;
}
Expand description

Encoded bridge message consists of the following fields:

  1. Message type (1 byte)
  2. Message version (1 byte)
  3. Nonce (8 bytes in big endian)
  4. Chain id (1 byte)
  5. Payload (variable length)

Required Methods§

Source

fn as_bytes(&self) -> Vec<u8>

Convert the entire message to bytes

Source

fn as_payload_bytes(&self) -> Vec<u8>

Convert the payload piece to bytes

Implementors§