grpc

package
v0.0.0-...-eccf466 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface {
	commongrpc.Handler

	// EVM methods
	GetEvmAccount(address common.Address) (*evmtypes.QueryAccountResponse, error)
	EstimateGas(args []byte, GasCap uint64) (*evmtypes.EstimateGasResponse, error)
	GetEvmParams() (*evmtypes.QueryParamsResponse, error)

	// FeeMarket methods
	GetBaseFee() (*feemarkettypes.QueryBaseFeeResponse, error)

	// Gov methods
	GetProposal(proposalID uint64) (*govtypes.QueryProposalResponse, error)
	GetGovParams(paramsType string) (*govtypes.QueryParamsResponse, error)
}

Handler is an interface that defines the methods that are used to query the network's modules via gRPC.

func NewIntegrationHandler

func NewIntegrationHandler(network network.Network) Handler

NewIntegrationHandler creates a new IntegrationHandler instance.

type IntegrationHandler

type IntegrationHandler struct {
	// We take the IntegrationHandler from common/grpc to get the common methods.
	*commongrpc.IntegrationHandler
	// contains filtered or unexported fields
}

IntegrationHandler is a helper struct to query the network's modules via gRPC. This is to simulate the behavior of a real user and avoid querying the modules directly.

func (*IntegrationHandler) EstimateGas

func (gqh *IntegrationHandler) EstimateGas(args []byte, gasCap uint64) (*evmtypes.EstimateGasResponse, error)

EstimateGas returns the estimated gas for the given call args.

func (*IntegrationHandler) GetBaseFee

GetBaseFee returns the base fee from the feemarket module.

func (*IntegrationHandler) GetEvmAccount

func (gqh *IntegrationHandler) GetEvmAccount(address common.Address) (*evmtypes.QueryAccountResponse, error)

GetEvmAccount returns the EVM account for the given address.

func (*IntegrationHandler) GetEvmParams

func (gqh *IntegrationHandler) GetEvmParams() (*evmtypes.QueryParamsResponse, error)

GetEvmParams returns the EVM module params.

func (*IntegrationHandler) GetGovParams

func (gqh *IntegrationHandler) GetGovParams(paramsType string) (*govtypes.QueryParamsResponse, error)

GetGovParams returns the gov params from the gov module.

func (*IntegrationHandler) GetProposal

func (gqh *IntegrationHandler) GetProposal(proposalID uint64) (*govtypes.QueryProposalResponse, error)

GetProposal returns the proposal from the gov module.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL