Struct MockCep78OperatorHostRef

Source
pub struct MockCep78OperatorHostRef { /* private fields */ }
Expand description

Implementations§

Source§

impl MockCep78OperatorHostRef

Source

pub fn set_address(&mut self, nft_contract: &Address)

Source

pub fn mint(&mut self, token_metadata: String, is_reverse_lookup_enabled: bool)

Source

pub fn mint_with_hash(&mut self, token_metadata: String, token_hash: String)

Source

pub fn burn(&mut self, token_id: u64)

Source

pub fn mint_for(&mut self, token_owner: Address, token_metadata: String)

Source

pub fn transfer(&mut self, token_id: u64, target: Address)

Source

pub fn transfer_from(&mut self, token_id: u64, source: Address, target: Address)

Source

pub fn approve(&mut self, spender: Address, token_id: u64)

Source

pub fn revoke(&mut self, token_id: u64)

Source§

impl MockCep78OperatorHostRef

Source

pub fn try_set_address(&mut self, nft_contract: &Address) -> OdraResult<()>

Does not fail in case of error, returns odra::OdraResult instead.

Source

pub fn try_mint( &mut self, token_metadata: String, is_reverse_lookup_enabled: bool, ) -> OdraResult<()>

Does not fail in case of error, returns odra::OdraResult instead.

Source

pub fn try_mint_with_hash( &mut self, token_metadata: String, token_hash: String, ) -> OdraResult<()>

Does not fail in case of error, returns odra::OdraResult instead.

Source

pub fn try_burn(&mut self, token_id: u64) -> OdraResult<()>

Does not fail in case of error, returns odra::OdraResult instead.

Source

pub fn try_mint_for( &mut self, token_owner: Address, token_metadata: String, ) -> OdraResult<()>

Does not fail in case of error, returns odra::OdraResult instead.

Source

pub fn try_transfer(&mut self, token_id: u64, target: Address) -> OdraResult<()>

Does not fail in case of error, returns odra::OdraResult instead.

Source

pub fn try_transfer_from( &mut self, token_id: u64, source: Address, target: Address, ) -> OdraResult<()>

Does not fail in case of error, returns odra::OdraResult instead.

Source

pub fn try_approve(&mut self, spender: Address, token_id: u64) -> OdraResult<()>

Does not fail in case of error, returns odra::OdraResult instead.

Source

pub fn try_revoke(&mut self, token_id: u64) -> OdraResult<()>

Does not fail in case of error, returns odra::OdraResult instead.

Trait Implementations§

Source§

impl EntryPointsCallerProvider for MockCep78OperatorHostRef

Source§

fn entry_points_caller(env: &HostEnv) -> EntryPointsCaller

Returns an EntryPointsCaller for the given host environment.
Source§

impl HasIdent for MockCep78OperatorHostRef

Source§

fn ident() -> String

Returns the contract’s ident.
Source§

impl HostRef for MockCep78OperatorHostRef

Source§

fn new(address: Address, env: HostEnv) -> Self

Creates a new host side reference to a contract.
Source§

fn with_tokens(&self, tokens: U512) -> Self

Creates a new host reference with attached tokens, based on the current instance. Read more
Source§

fn address(&self) -> &Address

Returns the address of the contract.
Source§

fn env(&self) -> &HostEnv

Returns the host environment.
Source§

fn get_event<T>(&self, index: i32) -> Result<T, EventError>

Returns the n-th event emitted by the contract. Read more
Source§

fn last_call(&self) -> ContractCallResult

Returns a detailed information about the last call of the contract.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Addressable for T
where T: HostRef,

Source§

fn address(&self) -> &Address

Returns a reference to the Address of the type.
Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.