pub struct ContractCall<SA, OriginalResult>
where SA: CallTypeApi + 'static,
{ pub to: ManagedAddress<SA>, pub moax_payment: BigUint<SA>, pub payments: ManagedVec<SA, DctTokenPayment<SA>>, pub endpoint_name: ManagedBuffer<SA>, pub extra_gas_for_callback: u64, pub explicit_gas_limit: u64, pub arg_buffer: ManagedArgBuffer<SA>, pub success_callback: &'static [u8], pub error_callback: &'static [u8], /* private fields */ }
Expand description

Represents metadata for calling another contract. Can transform into either an async call, transfer call or other types of calls.

Fields§

§to: ManagedAddress<SA>§moax_payment: BigUint<SA>§payments: ManagedVec<SA, DctTokenPayment<SA>>§endpoint_name: ManagedBuffer<SA>§extra_gas_for_callback: u64§explicit_gas_limit: u64§arg_buffer: ManagedArgBuffer<SA>§success_callback: &'static [u8]§error_callback: &'static [u8]

Implementations§

source§

impl<SA, OriginalResult> ContractCall<SA, OriginalResult>
where SA: CallTypeApi + 'static,

source

pub fn new(to: ManagedAddress<SA>, endpoint_name: ManagedBuffer<SA>) -> Self

source

pub fn new_with_dct_payment( to: ManagedAddress<SA>, endpoint_name: ManagedBuffer<SA>, payments: ManagedVec<SA, DctTokenPayment<SA>> ) -> Self

source

pub fn add_dct_token_transfer( self, payment_token: TokenIdentifier<SA>, payment_nonce: u64, payment_amount: BigUint<SA> ) -> Self

source

pub fn with_moax_or_single_dct_token_transfer( self, payment_token: MoaxOrDctTokenIdentifier<SA>, payment_nonce: u64, payment_amount: BigUint<SA> ) -> Self

source

pub fn with_moax_transfer(self, moax_amount: BigUint<SA>) -> Self

source

pub fn with_multi_token_transfer( self, payments: ManagedVec<SA, DctTokenPayment<SA>> ) -> Self

source

pub fn with_gas_limit(self, gas_limit: u64) -> Self

source

pub fn with_arguments_raw( self, raw_argument_buffer: ManagedArgBuffer<SA> ) -> Self

source

pub fn push_arg_managed_buffer(&mut self, m_buffer: ManagedBuffer<SA>)

Provided for cases where we build the contract call by hand.

source

pub fn push_argument_raw_bytes(&mut self, bytes: &[u8])

Provided for cases where we build the contract call by hand. Convenience method, also creates the new managed buffer from bytes.

source

pub fn push_endpoint_arg<T: TopEncodeMulti>(&mut self, endpoint_arg: &T)

source

pub fn convert_to_dct_transfer_call(self) -> Self

If this is an DCT call, it converts it to a regular call to DCTTransfer. Async calls require this step, but not transfer_dct_execute.

source

pub fn resolve_gas_limit(&self) -> u64

source

pub fn async_call(self) -> AsyncCall<SA>

source§

impl<SA, OriginalResult> ContractCall<SA, OriginalResult>
where SA: CallTypeApi + 'static, OriginalResult: TopEncodeMulti,

source

pub fn execute_on_dest_context<RequestedResult>(self) -> RequestedResult
where RequestedResult: TopDecodeMulti,

Executes immediately, synchronously, and returns contract call result. Only works if the target contract is in the same shard.

source

pub fn execute_on_dest_context_readonly<RequestedResult>( self ) -> RequestedResult
where RequestedResult: TopDecodeMulti,

source

pub fn execute_on_same_context<RequestedResult>(self) -> RequestedResult
where RequestedResult: TopDecodeMulti,

source§

impl<SA, OriginalResult> ContractCall<SA, OriginalResult>
where SA: CallTypeApi + 'static,

source

pub fn execute_on_dest_context_ignore_result(self)

👎Deprecated since 0.10.6: Redundant method, use let _: IgnoreValue = contract_call.execute_on_dest_context(...) instead

Executes immediately, synchronously.

The result (if any) is ignored.

Deprecated and will be removed soon. Use let _: IgnoreValue = contract_call.execute_on_dest_context(...) instead.

source

pub fn transfer_execute(self)

Immediately launches a transfer-execute call.

This is similar to an async call, but there is no callback and there can be more than one such call per transaction.

Auto Trait Implementations§

§

impl<SA, OriginalResult> CodecFromSelf for ContractCall<SA, OriginalResult>
where OriginalResult: CodecFromSelf, SA: CodecFromSelf,

§

impl<SA, OriginalResult> RefUnwindSafe for ContractCall<SA, OriginalResult>

§

impl<SA, OriginalResult> Send for ContractCall<SA, OriginalResult>
where OriginalResult: Send, SA: Send, <SA as HandleTypeInfo>::BigIntHandle: Send, <SA as HandleTypeInfo>::ManagedBufferHandle: Send,

§

impl<SA, OriginalResult> Sync for ContractCall<SA, OriginalResult>
where OriginalResult: Sync, SA: Sync, <SA as HandleTypeInfo>::BigIntHandle: Sync, <SA as HandleTypeInfo>::ManagedBufferHandle: Sync,

§

impl<SA, OriginalResult> Unpin for ContractCall<SA, OriginalResult>
where OriginalResult: Unpin, SA: Unpin, <SA as HandleTypeInfo>::BigIntHandle: Unpin, <SA as HandleTypeInfo>::ManagedBufferHandle: Unpin,

§

impl<SA, OriginalResult> UnwindSafe for ContractCall<SA, OriginalResult>

Blanket Implementations§

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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.