Trait AddressAllocatorExt

Source
pub trait AddressAllocatorExt {
    // Required methods
    fn address_allocator_new(
        &mut self,
        method_context: MethodContext,
        contract: Address,
    ) -> Result<(), ContractError>;
    fn address_allocator_allocate_address(
        &mut self,
        method_context: MethodContext,
        contract: Address,
    ) -> Result<Address, ContractError>;
}
Expand description

Extension trait that provides helper methods for calling AddressAllocator’s methods on Env for convenience purposes

Required Methods§

Source

fn address_allocator_new( &mut self, method_context: MethodContext, contract: Address, ) -> Result<(), ContractError>

Initialize address allocator for a shard

Source

fn address_allocator_allocate_address( &mut self, method_context: MethodContext, contract: Address, ) -> Result<Address, ContractError>

Allocate a new address for a contract.

This can only be called by [Address::SYSTEM_CODE] contract.

Implementations on Foreign Types§

Source§

impl AddressAllocatorExt for Env<'_>

Source§

fn address_allocator_new( &mut self, method_context: MethodContext, contract: Address, ) -> Result<(), ContractError>

Source§

fn address_allocator_allocate_address( &mut self, method_context: MethodContext, contract: Address, ) -> Result<Address, ContractError>

Implementors§