pub struct ContractCallLocalQuery {
pub header: Option<QueryHeader>,
pub contract_id: Option<ContractId>,
pub gas: i64,
pub function_parameters: Vec<u8>,
pub max_result_size: i64,
pub sender_id: Option<AccountId>,
}Expand description
Call a view function of a given smart contract
The call must provide function parameter inputs as needed.
This is potentially useful for calling view functions that will not revert
when executed in a static EVM context. Many such use cases will be better
served by using a Mirror Node API, however.
This is performed locally on the particular node that the client is
communicating with. Executing the call locally is faster and less costly,
but imposes certain restrictions.
The call MUST NOT change the state of the contract instance. This also
precludes any expenditure or transfer of HBAR or other tokens.
The call SHALL NOT have a separate consensus timestamp.
The call SHALL NOT generate a record nor a receipt.
The response SHALL contain the output returned by the function call.
Any contract call that would use the STATICCALL opcode MAY be called via
contract call local with performance and cost benefits.
Unlike a ContractCall transaction, the node SHALL always consume the entire amount of offered “gas” in determining the fee for this query, so accurate gas estimation is important.
Fields§
§header: Option<QueryHeader>Standard information sent with every query operation.
This includes the signed payment and what kind of response is requested
(cost, state proof, both, or neither).
The payment MUST be sufficient for the base fees _and_ the full amount in the `gas` field.
contract_id: Option<ContractId>The ID of a smart contract to call.
gas: i64The amount of “gas” to use for this call.
This transaction SHALL consume all of the gas offered and charge the corresponding fee according to the current exchange rate between HBAR and "gas".
function_parameters: Vec<u8>The smart contract function to call, and the parameters to pass to that function.
These SHALL be presented in EVM bytecode function call format.
max_result_size: i64Do not use this field; it is ignored in the current software.
The maximum number of bytes that the result might include.
The call will fail if it would have returned more than this number
of bytes.
sender_id: Option<AccountId>The account that is the “sender” for this contract call.
If this is not set it SHALL be interpreted as the accountId from the
associated transactionId.
If this is set then either the associated transaction or the foreign
transaction data MUST be signed by the referenced account.
Trait Implementations§
Source§impl Clone for ContractCallLocalQuery
impl Clone for ContractCallLocalQuery
Source§fn clone(&self) -> ContractCallLocalQuery
fn clone(&self) -> ContractCallLocalQuery
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ContractCallLocalQuery
impl Debug for ContractCallLocalQuery
Source§impl Default for ContractCallLocalQuery
impl Default for ContractCallLocalQuery
Source§impl Message for ContractCallLocalQuery
impl Message for ContractCallLocalQuery
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.Source§impl PartialEq for ContractCallLocalQuery
impl PartialEq for ContractCallLocalQuery
impl StructuralPartialEq for ContractCallLocalQuery
Auto Trait Implementations§
impl Freeze for ContractCallLocalQuery
impl RefUnwindSafe for ContractCallLocalQuery
impl Send for ContractCallLocalQuery
impl Sync for ContractCallLocalQuery
impl Unpin for ContractCallLocalQuery
impl UnsafeUnpin for ContractCallLocalQuery
impl UnwindSafe for ContractCallLocalQuery
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request