Trait pallet_revive::ReviveApi
source · pub trait ReviveApi<Block: BlockT, AccountId, Balance, Nonce, BlockNumber, EventRecord>: Core<Block>where
AccountId: Codec,
Balance: Codec,
Nonce: Codec,
BlockNumber: Codec,
EventRecord: Codec,{
// Provided methods
fn balance(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
address: H160,
) -> Result<U256, ApiError> { ... }
fn nonce(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
address: H160,
) -> Result<Nonce, ApiError> { ... }
fn call(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
origin: AccountId,
dest: H160,
value: Balance,
gas_limit: Option<Weight>,
storage_deposit_limit: Option<Balance>,
input_data: Vec<u8>,
) -> Result<ContractResult<ExecReturnValue, Balance, EventRecord>, ApiError> { ... }
fn instantiate(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
origin: AccountId,
value: Balance,
gas_limit: Option<Weight>,
storage_deposit_limit: Option<Balance>,
code: Code,
data: Vec<u8>,
salt: Option<[u8; 32]>,
) -> Result<ContractResult<InstantiateReturnValue, Balance, EventRecord>, ApiError> { ... }
fn eth_transact(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
tx: GenericTransaction,
) -> Result<Result<EthTransactInfo<Balance>, EthTransactError>, ApiError> { ... }
fn upload_code(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
origin: AccountId,
code: Vec<u8>,
storage_deposit_limit: Option<Balance>,
) -> Result<CodeUploadResult<Balance>, ApiError> { ... }
fn get_storage(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
address: H160,
key: [u8; 32],
) -> Result<GetStorageResult, ApiError> { ... }
}
Expand description
The API used to dry-run contract interactions.
Provided Methods§
sourcefn balance(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
address: H160,
) -> Result<U256, ApiError>
fn balance( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, address: H160, ) -> Result<U256, ApiError>
Returns the free balance of the given [H160]
address, using EVM decimals.
sourcefn nonce(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
address: H160,
) -> Result<Nonce, ApiError>
fn nonce( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, address: H160, ) -> Result<Nonce, ApiError>
Returns the nonce of the given [H160]
address.
sourcefn call(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
origin: AccountId,
dest: H160,
value: Balance,
gas_limit: Option<Weight>,
storage_deposit_limit: Option<Balance>,
input_data: Vec<u8>,
) -> Result<ContractResult<ExecReturnValue, Balance, EventRecord>, ApiError>
fn call( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, origin: AccountId, dest: H160, value: Balance, gas_limit: Option<Weight>, storage_deposit_limit: Option<Balance>, input_data: Vec<u8>, ) -> Result<ContractResult<ExecReturnValue, Balance, EventRecord>, ApiError>
Perform a call from a specified account to a given contract.
sourcefn instantiate(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
origin: AccountId,
value: Balance,
gas_limit: Option<Weight>,
storage_deposit_limit: Option<Balance>,
code: Code,
data: Vec<u8>,
salt: Option<[u8; 32]>,
) -> Result<ContractResult<InstantiateReturnValue, Balance, EventRecord>, ApiError>
fn instantiate( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, origin: AccountId, value: Balance, gas_limit: Option<Weight>, storage_deposit_limit: Option<Balance>, code: Code, data: Vec<u8>, salt: Option<[u8; 32]>, ) -> Result<ContractResult<InstantiateReturnValue, Balance, EventRecord>, ApiError>
Instantiate a new contract.
See [crate::Pallet::bare_instantiate]
.
sourcefn eth_transact(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
tx: GenericTransaction,
) -> Result<Result<EthTransactInfo<Balance>, EthTransactError>, ApiError>
fn eth_transact( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, tx: GenericTransaction, ) -> Result<Result<EthTransactInfo<Balance>, EthTransactError>, ApiError>
Perform an Ethereum call.
sourcefn upload_code(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
origin: AccountId,
code: Vec<u8>,
storage_deposit_limit: Option<Balance>,
) -> Result<CodeUploadResult<Balance>, ApiError>
fn upload_code( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, origin: AccountId, code: Vec<u8>, storage_deposit_limit: Option<Balance>, ) -> Result<CodeUploadResult<Balance>, ApiError>
Upload new code without instantiating a contract from it.
sourcefn get_storage(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
address: H160,
key: [u8; 32],
) -> Result<GetStorageResult, ApiError>
fn get_storage( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, address: H160, key: [u8; 32], ) -> Result<GetStorageResult, ApiError>
Query a given storage key in a given contract.
Returns Ok(Some(Vec<u8>))
if the storage value exists under the given key in the
specified account and Ok(None)
if it doesn’t. If the account specified by the address
doesn’t exist, or doesn’t have a contract then Err
is returned.