referrerpolicy=no-referrer-when-downgrade

Trait ReviveApi

Source
pub trait ReviveApi<Block: BlockT, AccountId, Balance, Nonce, BlockNumber>: Core<Block>
where AccountId: Codec, Balance: Codec, Nonce: Codec, BlockNumber: Codec,
{
Show 17 methods // Provided methods fn block_gas_limit( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<U256, ApiError> { ... } fn balance( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, address: H160, ) -> Result<U256, ApiError> { ... } fn gas_price( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> 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>, 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>, 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> { ... } fn get_storage_var_key( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, address: H160, key: Vec<u8>, ) -> Result<GetStorageResult, ApiError> { ... } fn trace_block( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, block: Block, config: TracerType, ) -> Result<Vec<(u32, Trace)>, ApiError> { ... } fn trace_tx( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, block: Block, tx_index: u32, config: TracerType, ) -> Result<Option<Trace>, ApiError> { ... } fn trace_call( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, tx: GenericTransaction, config: TracerType, ) -> Result<Result<Trace, EthTransactError>, ApiError> { ... } fn block_author( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Option<H160>, ApiError> { ... } fn address( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, account_id: AccountId, ) -> Result<H160, ApiError> { ... } fn runtime_pallets_address( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<H160, ApiError> { ... } fn code( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, address: H160, ) -> Result<Vec<u8>, ApiError> { ... }
}
Expand description

The API used to dry-run contract interactions.

Provided Methods§

Source

fn block_gas_limit( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<U256, ApiError>

Returns the block gas limit.

Source

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.

Source

fn gas_price( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<U256, ApiError>

Returns the gas price.

Source

fn nonce( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, address: H160, ) -> Result<Nonce, ApiError>

Returns the nonce of the given [H160] address.

Source

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>, ApiError>

Perform a call from a specified account to a given contract.

See crate::Pallet::bare_call.

Source

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>, ApiError>

Instantiate a new contract.

See [crate::Pallet::bare_instantiate].

Source

fn eth_transact( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, tx: GenericTransaction, ) -> Result<Result<EthTransactInfo<Balance>, EthTransactError>, ApiError>

Perform an Ethereum call.

See crate::Pallet::dry_run_eth_transact

Source

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.

See crate::Pallet::bare_upload_code.

Source

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.

Source

fn get_storage_var_key( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, address: H160, key: Vec<u8>, ) -> Result<GetStorageResult, ApiError>

Query a given variable-sized 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.

Source

fn trace_block( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, block: Block, config: TracerType, ) -> Result<Vec<(u32, Trace)>, ApiError>

Traces the execution of an entire block and returns call traces.

This is intended to be called through state_call to replay the block from the parent block.

See eth-rpc debug_traceBlockByNumber for usage.

Source

fn trace_tx( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, block: Block, tx_index: u32, config: TracerType, ) -> Result<Option<Trace>, ApiError>

Traces the execution of a specific transaction within a block.

This is intended to be called through state_call to replay the block from the parent hash up to the transaction.

See eth-rpc debug_traceTransaction for usage.

Source

fn trace_call( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, tx: GenericTransaction, config: TracerType, ) -> Result<Result<Trace, EthTransactError>, ApiError>

Dry run and return the trace of the given call.

See eth-rpc debug_traceCall for usage.

Source

fn block_author( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Option<H160>, ApiError>

The address of the validator that produced the current block.

Source

fn address( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, account_id: AccountId, ) -> Result<H160, ApiError>

Get the H160 address associated to this account id

Source

fn runtime_pallets_address( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<H160, ApiError>

The address used to call the runtime’s pallets dispatchables

Source

fn code( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, address: H160, ) -> Result<Vec<u8>, ApiError>

The code at the specified address taking pre-compiles into account.

Trait Implementations§

Source§

impl<Block: BlockT, AccountId, Balance, Nonce, BlockNumber> RuntimeApiInfo for dyn ReviveApi<Block, AccountId, Balance, Nonce, BlockNumber>

Source§

const ID: [u8; 8]

The identifier of the runtime api.
Source§

const VERSION: u32 = 1u32

The version of the runtime api.

Implementors§