pub struct ContractMethodInput {
pub method_name: String,
pub arguments: Vec<u8>,
}
Expand description
Input of a contract method in a call, which consists of method name and its borsh-serialized arguments.
Fields§
§method_name: String
§arguments: Vec<u8>
Implementations§
Source§impl ContractMethodInput
impl ContractMethodInput
Sourcepub fn from_transaction() -> Self
pub fn from_transaction() -> Self
Convert the fields in the transaction Call command
Sourcepub fn method_name(&self) -> &str
pub fn method_name(&self) -> &str
Get method_name as &str from Call command.
Sourcepub fn get_multiple_arguments(&self) -> Vec<Vec<u8>>
pub fn get_multiple_arguments(&self) -> Vec<Vec<u8>>
Converts arguments
in Call command to Vec<Vec<u8>>
so that it can be parsed to specific data type for the entrypoint function.
Sourcepub fn parse_multiple_arguments<T: BorshDeserialize>(
args: &[Vec<u8>],
idx: usize,
) -> T
pub fn parse_multiple_arguments<T: BorshDeserialize>( args: &[Vec<u8>], idx: usize, ) -> T
Parser function to deserialize indexed argument into defined data type
Auto Trait Implementations§
impl Freeze for ContractMethodInput
impl RefUnwindSafe for ContractMethodInput
impl Send for ContractMethodInput
impl Sync for ContractMethodInput
impl Unpin for ContractMethodInput
impl UnwindSafe for ContractMethodInput
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