laconicd/x/evm/types/querier.go
Federico Kunze 261f86fdf2
bump SDK to v0.39.1 (#386)
* bump sdk version to v0.39.0 candidate

* updates

* update evm

* bump commit

* more changes

* build

* genesis

* fix tests

* fix tests

* bump commit

* bump commit

* bump commit

* add keygen func

* bump version to 0.39.0-rc0

* update AnteHandler

* fix TxDecoder

* lint

* fix test

* update statedb

* changelog

* fixes

* remove extra files

* update make test-import

* rename test

* bump SDK version to final release

* update to 0.39.1-rc1

* fix evm tests

* update RPC

* minor fixes

* update to rc2

* bump to v0.39.1

* fix personal API

* fix string type cast ambiguity (#449)

* init

* fix estimate gas test

* minor genesis change

* remove comments from unstable commit (stargate release)

Co-authored-by: Alessio Treglia <quadrispro@ubuntu.com>
2020-08-23 17:41:54 -04:00

105 lines
2.3 KiB
Go

package types
import (
"fmt"
ethtypes "github.com/ethereum/go-ethereum/core/types"
)
// Supported endpoints
const (
QueryProtocolVersion = "protocolVersion"
QueryBalance = "balance"
QueryBlockNumber = "blockNumber"
QueryStorage = "storage"
QueryCode = "code"
QueryNonce = "nonce"
QueryHashToHeight = "hashToHeight"
QueryTransactionLogs = "transactionLogs"
QueryBloom = "bloom"
QueryLogs = "logs"
QueryAccount = "account"
QueryExportAccount = "exportAccount"
)
// QueryResProtocolVersion is response type for protocol version query
type QueryResProtocolVersion struct {
Version string `json:"version"`
}
func (q QueryResProtocolVersion) String() string {
return q.Version
}
// QueryResBalance is response type for balance query
type QueryResBalance struct {
Balance string `json:"balance"`
}
func (q QueryResBalance) String() string {
return q.Balance
}
// QueryResBlockNumber is response type for block number query
type QueryResBlockNumber struct {
Number int64 `json:"blockNumber"`
}
func (q QueryResBlockNumber) String() string {
return fmt.Sprint(q.Number)
}
// QueryResStorage is response type for storage query
type QueryResStorage struct {
Value []byte `json:"value"`
}
func (q QueryResStorage) String() string {
return string(q.Value)
}
// QueryResCode is response type for code query
type QueryResCode struct {
Code []byte
}
func (q QueryResCode) String() string {
return string(q.Code)
}
// QueryResNonce is response type for Nonce query
type QueryResNonce struct {
Nonce uint64 `json:"nonce"`
}
func (q QueryResNonce) String() string {
return fmt.Sprint(q.Nonce)
}
// QueryETHLogs is response type for tx logs query
type QueryETHLogs struct {
Logs []*ethtypes.Log `json:"logs"`
}
func (q QueryETHLogs) String() string {
return fmt.Sprintf("%+v", q.Logs)
}
// QueryBloomFilter is response type for tx logs query
type QueryBloomFilter struct {
Bloom ethtypes.Bloom `json:"bloom"`
}
func (q QueryBloomFilter) String() string {
return string(q.Bloom.Bytes())
}
// QueryAccount is response type for querying Ethereum state objects
type QueryResAccount struct {
Balance string `json:"balance"`
CodeHash []byte `json:"codeHash"`
Nonce uint64 `json:"nonce"`
}
type QueryResExportAccount = GenesisAccount