axelar-cgp-sui

Module 0xa1::bytes32

use 0x2::address;
use 0x2::bcs;

Struct Bytes32

struct Bytes32 has copy, drop, store
Fields
bytes: address

Constants

const LENGTH: u64 = 32;

Function new

Casts an address to a bytes32

public fun new(bytes: address): bytes32::Bytes32
Implementation
public fun new(bytes: address): Bytes32 {
    Bytes32 { bytes: bytes }
}

Function default

public fun default(): bytes32::Bytes32
Implementation
public fun default(): Bytes32 {
    Bytes32 { bytes: @0x0 }
}

Function from_bytes

public fun from_bytes(bytes: vector<u8>): bytes32::Bytes32
Implementation
public fun from_bytes(bytes: vector<u8>): Bytes32 {
    new(address::from_bytes(bytes))
}

Function from_address

public fun from_address(addr: address): bytes32::Bytes32
Implementation
public fun from_address(addr: address): Bytes32 {
    new(addr)
}

Function to_bytes

public fun to_bytes(self: bytes32::Bytes32): vector<u8>
Implementation
public fun to_bytes(self: Bytes32): vector<u8> {
    self.bytes.to_bytes()
}

Function length

public fun length(_self: &bytes32::Bytes32): u64
Implementation
public fun length(_self: &Bytes32): u64 {
    LENGTH
}

Function peel

public(friend) fun peel(bcs: &mut bcs::BCS): bytes32::Bytes32
Implementation
public(package) fun peel(bcs: &mut BCS): Bytes32 {
    new(bcs.peel_address())
}