Struct odra_modules::cep78::utils::MockContractHostRef
source · pub struct MockContractHostRef { /* private fields */ }Expand description
[MockContract] Host Ref.
Implementations§
source§impl MockContractHostRef
impl MockContractHostRef
pub fn set_address(&mut self, nft_contract: &Address)
pub fn mint( &mut self, token_metadata: String, is_reverse_lookup_enabled: bool ) -> (String, Address, String)
pub fn mint_with_hash( &mut self, token_metadata: String, token_hash: String ) -> (String, Address, String)
pub fn burn(&mut self, token_id: u64)
pub fn mint_for( &mut self, token_owner: Address, token_metadata: String ) -> (String, Address, String)
pub fn transfer(&mut self, token_id: u64, target: Address) -> (String, Address)
pub fn transfer_from( &mut self, token_id: u64, source: Address, target: Address ) -> (String, Address)
pub fn approve(&mut self, spender: Address, token_id: u64)
pub fn revoke(&mut self, token_id: u64)
source§impl MockContractHostRef
impl MockContractHostRef
sourcepub fn try_set_address(&mut self, nft_contract: &Address) -> OdraResult<()>
pub fn try_set_address(&mut self, nft_contract: &Address) -> OdraResult<()>
Does not fail in case of error, returns odra::OdraResult instead.
sourcepub fn try_mint(
&mut self,
token_metadata: String,
is_reverse_lookup_enabled: bool
) -> OdraResult<(String, Address, String)>
pub fn try_mint( &mut self, token_metadata: String, is_reverse_lookup_enabled: bool ) -> OdraResult<(String, Address, String)>
Does not fail in case of error, returns odra::OdraResult instead.
sourcepub fn try_mint_with_hash(
&mut self,
token_metadata: String,
token_hash: String
) -> OdraResult<(String, Address, String)>
pub fn try_mint_with_hash( &mut self, token_metadata: String, token_hash: String ) -> OdraResult<(String, Address, String)>
Does not fail in case of error, returns odra::OdraResult instead.
sourcepub fn try_burn(&mut self, token_id: u64) -> OdraResult<()>
pub fn try_burn(&mut self, token_id: u64) -> OdraResult<()>
Does not fail in case of error, returns odra::OdraResult instead.
sourcepub fn try_mint_for(
&mut self,
token_owner: Address,
token_metadata: String
) -> OdraResult<(String, Address, String)>
pub fn try_mint_for( &mut self, token_owner: Address, token_metadata: String ) -> OdraResult<(String, Address, String)>
Does not fail in case of error, returns odra::OdraResult instead.
sourcepub fn try_transfer(
&mut self,
token_id: u64,
target: Address
) -> OdraResult<(String, Address)>
pub fn try_transfer( &mut self, token_id: u64, target: Address ) -> OdraResult<(String, Address)>
Does not fail in case of error, returns odra::OdraResult instead.
sourcepub fn try_transfer_from(
&mut self,
token_id: u64,
source: Address,
target: Address
) -> OdraResult<(String, Address)>
pub fn try_transfer_from( &mut self, token_id: u64, source: Address, target: Address ) -> OdraResult<(String, Address)>
Does not fail in case of error, returns odra::OdraResult instead.
sourcepub fn try_approve(&mut self, spender: Address, token_id: u64) -> OdraResult<()>
pub fn try_approve(&mut self, spender: Address, token_id: u64) -> OdraResult<()>
Does not fail in case of error, returns odra::OdraResult instead.
sourcepub fn try_revoke(&mut self, token_id: u64) -> OdraResult<()>
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 MockContractHostRef
impl EntryPointsCallerProvider for MockContractHostRef
source§fn entry_points_caller(env: &HostEnv) -> EntryPointsCaller
fn entry_points_caller(env: &HostEnv) -> EntryPointsCaller
Returns an EntryPointsCaller for the given host environment.
source§impl HasIdent for MockContractHostRef
impl HasIdent for MockContractHostRef
source§impl HostRef for MockContractHostRef
impl HostRef for MockContractHostRef
source§fn new(address: Address, env: HostEnv) -> Self
fn new(address: Address, env: HostEnv) -> Self
Creates a new host side reference to a contract.
source§fn with_tokens(&self, tokens: U512) -> Self
fn with_tokens(&self, tokens: U512) -> Self
Creates a new host reference with attached tokens, based on the current instance. Read more
source§fn get_event<T>(&self, index: i32) -> Result<T, EventError>where
T: FromBytes + EventInstance,
fn get_event<T>(&self, index: i32) -> Result<T, EventError>where
T: FromBytes + EventInstance,
Returns the n-th event emitted by the contract. Read more
source§fn last_call(&self) -> ContractCallResult
fn last_call(&self) -> ContractCallResult
Returns a detailed information about the last call of the contract.
Auto Trait Implementations§
impl Freeze for MockContractHostRef
impl !RefUnwindSafe for MockContractHostRef
impl !Send for MockContractHostRef
impl !Sync for MockContractHostRef
impl Unpin for MockContractHostRef
impl !UnwindSafe for MockContractHostRef
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more