Function piecrust_uplink::call_with_limit

source ·
pub fn call_with_limit<A, Ret>(
    contract: ContractId,
    fn_name: &str,
    fn_arg: &A,
    gas_limit: u64
) -> Result<Ret, ContractError>
where A: for<'a> Serialize<StandardBufSerializer<'a>>, Ret: Archive, Ret::Archived: Deserialize<Ret, Infallible>,
Available on crate feature abi only.
Expand description

Calls a contract’s fn_name function with the given argument fn_arg, allowing it to spend the given gas_limit.

A gas limit of 0 is equivalent to using call, and will use the default behavior - i.e. the called contract gets 93% of the remaining gas.

If the gas limit given is above or equal the remaining amount, the default behavior will be used instead.