pub struct ContractCallData { /* private fields */ }
Expand description

wrapper struct got protocol_types::CallData

Implementations

get method_name as &str from call_data

The field arguments in CallData defines inputs arguments to the function with name which is defined in the field entrypoint The function here converts arguments to Vec<Vec> so that it can be parsed to specific data type for the entrypoint function.

Example
fn method_1(data :i32, name :String) { ...

If arguments represents the above function, the output is a vector = {“data”, “name”} where “data” and “name” are Borsh-Serialized bytes

Parser function to deserialize indexed argument into defined data type

Convert the field data in the transaction into CallData. Valid CallData should follow below requirements

  • first 4 bytes are version bytes which matches CALLDATA_VERSION
  • if it is less than 4 bytes, it assumes version = 0 and CallData is returned with “empty” data
  • return None if version does not match with CALLDATA_VERSION
  • the rest of the bytes are borsh-serialized from the structure CallData

contrust CallData structure for making contract calls. It returns raw bytes that passed into the export functions

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.