forked from cerc-io/laconicd-deprecated
Basic RPC and CLI Queries (#77)
- 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
This commit is contained in:
@@ -6,4 +6,6 @@ const (
|
||||
|
||||
EvmStoreKey = "evmstore"
|
||||
EvmCodeKey = "evmcode"
|
||||
|
||||
RouterKey = ModuleName
|
||||
)
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user