92dc7d9a59
- Adds ethermint query command (`emintcli query ethermint <query>`) - Supports block number, storage, code, balance lookups - Implements RPC API methods `eth_blockNumber`, `eth_getStorageAt`, `eth_getBalance`, and `eth_getCode` - Adds tester utility for RPC calls - Adheres to go test format, but should not be run with regular suite - Requires daemon and RPC server to be running - Excluded from `make test`, available with `make test-rpc` - Implemented AppModule interface and added EVM module to app - Required for routing - Implements `InitGenesis` (`x/evm/genesis.go`) and stubs `ExportGenesis` - Modifies GenesisAccount to match expected format
47 lines
764 B
Go
47 lines
764 B
Go
package types
|
|
|
|
import (
|
|
"github.com/ethereum/go-ethereum/common/hexutil"
|
|
"math/big"
|
|
)
|
|
|
|
type QueryResProtocolVersion struct {
|
|
Version string `json:"result"`
|
|
}
|
|
|
|
func (q QueryResProtocolVersion) String() string {
|
|
return q.Version
|
|
}
|
|
|
|
type QueryResBalance struct {
|
|
Balance *hexutil.Big `json:"result"`
|
|
}
|
|
|
|
func (q QueryResBalance) String() string {
|
|
return q.Balance.String()
|
|
}
|
|
|
|
type QueryResBlockNumber struct {
|
|
Number *big.Int `json:"result"`
|
|
}
|
|
|
|
func (q QueryResBlockNumber) String() string {
|
|
return q.Number.String()
|
|
}
|
|
|
|
type QueryResStorage struct {
|
|
Value []byte `json:"value"`
|
|
}
|
|
|
|
func (q QueryResStorage) String() string {
|
|
return string(q.Value)
|
|
}
|
|
|
|
type QueryResCode struct {
|
|
Code []byte
|
|
}
|
|
|
|
func (q QueryResCode) String() string {
|
|
return string(q.Code)
|
|
}
|