eth_getTransactionCount implementation (#91)

* Implemented eth_getTransactionCount endpoint

* Linting fixes
This commit is contained in:
Austin Abell
2019-09-06 10:46:26 -04:00
committed by GitHub
parent 0e942527da
commit 1e48e2b115
3 changed files with 43 additions and 4 deletions
+16 -1
View File
@@ -1,10 +1,12 @@
package types
import (
"github.com/ethereum/go-ethereum/common/hexutil"
"math/big"
"github.com/ethereum/go-ethereum/common/hexutil"
)
// QueryResProtocolVersion is response type for protocol version query
type QueryResProtocolVersion struct {
Version string `json:"result"`
}
@@ -13,6 +15,7 @@ func (q QueryResProtocolVersion) String() string {
return q.Version
}
// QueryResBalance is response type for balance query
type QueryResBalance struct {
Balance *hexutil.Big `json:"result"`
}
@@ -21,6 +24,7 @@ func (q QueryResBalance) String() string {
return q.Balance.String()
}
// QueryResBlockNumber is response type for block number query
type QueryResBlockNumber struct {
Number *big.Int `json:"result"`
}
@@ -29,6 +33,7 @@ func (q QueryResBlockNumber) String() string {
return q.Number.String()
}
// QueryResStorage is response type for storage query
type QueryResStorage struct {
Value []byte `json:"value"`
}
@@ -37,6 +42,7 @@ func (q QueryResStorage) String() string {
return string(q.Value)
}
// QueryResCode is response type for code query
type QueryResCode struct {
Code []byte
}
@@ -44,3 +50,12 @@ type QueryResCode struct {
func (q QueryResCode) String() string {
return string(q.Code)
}
// QueryResNonce is response type for Nonce query
type QueryResNonce struct {
Nonce uint64 `json:"result"`
}
func (q QueryResNonce) String() string {
return string(q.Nonce)
}