Unify eth function and type names
This commit is contained in:
parent
394a773fc3
commit
9fdc9ec4ac
@ -23,8 +23,8 @@ func init() {
|
|||||||
blockChainFactories["btc"] = btc.NewBitcoinRPC
|
blockChainFactories["btc"] = btc.NewBitcoinRPC
|
||||||
blockChainFactories["btc-testnet"] = btc.NewBitcoinRPC
|
blockChainFactories["btc-testnet"] = btc.NewBitcoinRPC
|
||||||
blockChainFactories["zec"] = zec.NewZCashRPC
|
blockChainFactories["zec"] = zec.NewZCashRPC
|
||||||
blockChainFactories["eth"] = eth.NewEthRPC
|
blockChainFactories["eth"] = eth.NewEthereumRPC
|
||||||
blockChainFactories["eth-testnet"] = eth.NewEthRPC
|
blockChainFactories["eth-testnet"] = eth.NewEthereumRPC
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewBlockChain creates bchain.BlockChain of type defined by parameter coin
|
// NewBlockChain creates bchain.BlockChain of type defined by parameter coin
|
||||||
|
|||||||
@ -6,17 +6,17 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
type EthParser struct {
|
type EthereumParser struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *EthParser) GetAddrIDFromVout(output *bchain.Vout) ([]byte, error) {
|
func (p *EthereumParser) GetAddrIDFromVout(output *bchain.Vout) ([]byte, error) {
|
||||||
if len(output.ScriptPubKey.Addresses) != 1 {
|
if len(output.ScriptPubKey.Addresses) != 1 {
|
||||||
return nil, bchain.ErrAddressMissing
|
return nil, bchain.ErrAddressMissing
|
||||||
}
|
}
|
||||||
return p.GetAddrIDFromAddress(output.ScriptPubKey.Addresses[0])
|
return p.GetAddrIDFromAddress(output.ScriptPubKey.Addresses[0])
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *EthParser) GetAddrIDFromAddress(address string) ([]byte, error) {
|
func (p *EthereumParser) GetAddrIDFromAddress(address string) ([]byte, error) {
|
||||||
// github.com/ethereum/go-ethereum/common.HexToAddress does not handle address errors, using own decoding
|
// github.com/ethereum/go-ethereum/common.HexToAddress does not handle address errors, using own decoding
|
||||||
if len(address) > 1 {
|
if len(address) > 1 {
|
||||||
if address[0:2] == "0x" || address[0:2] == "0X" {
|
if address[0:2] == "0x" || address[0:2] == "0X" {
|
||||||
@ -34,30 +34,30 @@ func (p *EthParser) GetAddrIDFromAddress(address string) ([]byte, error) {
|
|||||||
return hex.DecodeString(address)
|
return hex.DecodeString(address)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *EthParser) AddressToOutputScript(address string) ([]byte, error) {
|
func (p *EthereumParser) AddressToOutputScript(address string) ([]byte, error) {
|
||||||
return nil, errors.New("AddressToOutputScript: not implemented")
|
return nil, errors.New("AddressToOutputScript: not implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *EthParser) OutputScriptToAddresses(script []byte) ([]string, error) {
|
func (p *EthereumParser) OutputScriptToAddresses(script []byte) ([]string, error) {
|
||||||
return nil, errors.New("OutputScriptToAddresses: not implemented")
|
return nil, errors.New("OutputScriptToAddresses: not implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *EthParser) ParseTx(b []byte) (*bchain.Tx, error) {
|
func (p *EthereumParser) ParseTx(b []byte) (*bchain.Tx, error) {
|
||||||
return nil, errors.New("ParseTx: not implemented")
|
return nil, errors.New("ParseTx: not implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *EthParser) ParseBlock(b []byte) (*bchain.Block, error) {
|
func (p *EthereumParser) ParseBlock(b []byte) (*bchain.Block, error) {
|
||||||
return nil, errors.New("ParseBlock: not implemented")
|
return nil, errors.New("ParseBlock: not implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *EthParser) PackTx(tx *bchain.Tx, height uint32, blockTime int64) ([]byte, error) {
|
func (p *EthereumParser) PackTx(tx *bchain.Tx, height uint32, blockTime int64) ([]byte, error) {
|
||||||
return nil, errors.New("PackTx: not implemented")
|
return nil, errors.New("PackTx: not implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *EthParser) UnpackTx(buf []byte) (*bchain.Tx, uint32, error) {
|
func (p *EthereumParser) UnpackTx(buf []byte) (*bchain.Tx, uint32, error) {
|
||||||
return nil, 0, errors.New("UnpackTx: not implemented")
|
return nil, 0, errors.New("UnpackTx: not implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *EthParser) IsUTXOChain() bool {
|
func (p *EthereumParser) IsUTXOChain() bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
@ -46,7 +46,7 @@ func TestEthParser_GetAddrIDFromAddress(t *testing.T) {
|
|||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
p := &EthParser{}
|
p := &EthereumParser{}
|
||||||
got, err := p.GetAddrIDFromAddress(tt.args.address)
|
got, err := p.GetAddrIDFromAddress(tt.args.address)
|
||||||
if (err != nil) != tt.wantErr {
|
if (err != nil) != tt.wantErr {
|
||||||
t.Errorf("EthParser.GetAddrIDFromAddress() error = %v, wantErr %v", err, tt.wantErr)
|
t.Errorf("EthParser.GetAddrIDFromAddress() error = %v, wantErr %v", err, tt.wantErr)
|
||||||
|
|||||||
@ -21,20 +21,23 @@ import (
|
|||||||
"github.com/ethereum/go-ethereum/rpc"
|
"github.com/ethereum/go-ethereum/rpc"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// EthereumNet type specifies the type of ethereum network
|
||||||
type EthereumNet uint32
|
type EthereumNet uint32
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
// MainNet is production network
|
||||||
MainNet EthereumNet = 1
|
MainNet EthereumNet = 1
|
||||||
|
// TestNet is Ropsten test network
|
||||||
TestNet EthereumNet = 3
|
TestNet EthereumNet = 3
|
||||||
)
|
)
|
||||||
|
|
||||||
// EthRPC is an interface to JSON-RPC eth service.
|
// EthereumRPC is an interface to JSON-RPC eth service.
|
||||||
type EthRPC struct {
|
type EthereumRPC struct {
|
||||||
client *ethclient.Client
|
client *ethclient.Client
|
||||||
rpc *rpc.Client
|
rpc *rpc.Client
|
||||||
timeout time.Duration
|
timeout time.Duration
|
||||||
rpcURL string
|
rpcURL string
|
||||||
Parser *EthParser
|
Parser *EthereumParser
|
||||||
Testnet bool
|
Testnet bool
|
||||||
Network string
|
Network string
|
||||||
Mempool *bchain.NonUTXOMempool
|
Mempool *bchain.NonUTXOMempool
|
||||||
@ -51,8 +54,8 @@ type configuration struct {
|
|||||||
RPCTimeout int `json:"rpcTimeout"`
|
RPCTimeout int `json:"rpcTimeout"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewEthRPC returns new EthRPC instance.
|
// NewEthereumRPC returns new EthRPC instance.
|
||||||
func NewEthRPC(config json.RawMessage, pushHandler func(bchain.NotificationType)) (bchain.BlockChain, error) {
|
func NewEthereumRPC(config json.RawMessage, pushHandler func(bchain.NotificationType)) (bchain.BlockChain, error) {
|
||||||
var err error
|
var err error
|
||||||
var c configuration
|
var c configuration
|
||||||
err = json.Unmarshal(config, &c)
|
err = json.Unmarshal(config, &c)
|
||||||
@ -65,14 +68,14 @@ func NewEthRPC(config json.RawMessage, pushHandler func(bchain.NotificationType)
|
|||||||
}
|
}
|
||||||
ec := ethclient.NewClient(rc)
|
ec := ethclient.NewClient(rc)
|
||||||
|
|
||||||
s := &EthRPC{
|
s := &EthereumRPC{
|
||||||
client: ec,
|
client: ec,
|
||||||
rpc: rc,
|
rpc: rc,
|
||||||
rpcURL: c.RPCURL,
|
rpcURL: c.RPCURL,
|
||||||
}
|
}
|
||||||
|
|
||||||
// always create parser
|
// always create parser
|
||||||
s.Parser = &EthParser{}
|
s.Parser = &EthereumParser{}
|
||||||
s.timeout = time.Duration(c.RPCTimeout) * time.Second
|
s.timeout = time.Duration(c.RPCTimeout) * time.Second
|
||||||
|
|
||||||
// new blocks notifications handling
|
// new blocks notifications handling
|
||||||
@ -114,7 +117,7 @@ func NewEthRPC(config json.RawMessage, pushHandler func(bchain.NotificationType)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Initialize initializes ethereum rpc interface
|
// Initialize initializes ethereum rpc interface
|
||||||
func (b *EthRPC) Initialize() error {
|
func (b *EthereumRPC) Initialize() error {
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), b.timeout)
|
ctx, cancel := context.WithTimeout(context.Background(), b.timeout)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
@ -158,7 +161,7 @@ func (b *EthRPC) Initialize() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Shutdown cleans up rpc interface to ethereum
|
// Shutdown cleans up rpc interface to ethereum
|
||||||
func (b *EthRPC) Shutdown() error {
|
func (b *EthereumRPC) Shutdown() error {
|
||||||
if b.newBlockSubscription != nil {
|
if b.newBlockSubscription != nil {
|
||||||
b.newBlockSubscription.Unsubscribe()
|
b.newBlockSubscription.Unsubscribe()
|
||||||
}
|
}
|
||||||
@ -173,15 +176,15 @@ func (b *EthRPC) Shutdown() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthRPC) IsTestnet() bool {
|
func (b *EthereumRPC) IsTestnet() bool {
|
||||||
return b.Testnet
|
return b.Testnet
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthRPC) GetNetworkName() string {
|
func (b *EthereumRPC) GetNetworkName() string {
|
||||||
return b.Network
|
return b.Network
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthRPC) getBestHeader() (*ethtypes.Header, error) {
|
func (b *EthereumRPC) getBestHeader() (*ethtypes.Header, error) {
|
||||||
b.bestHeaderMu.Lock()
|
b.bestHeaderMu.Lock()
|
||||||
defer b.bestHeaderMu.Unlock()
|
defer b.bestHeaderMu.Unlock()
|
||||||
if b.bestHeader == nil {
|
if b.bestHeader == nil {
|
||||||
@ -200,7 +203,7 @@ func ethHashToHash(h ethcommon.Hash) string {
|
|||||||
return h.Hex()[2:]
|
return h.Hex()[2:]
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthRPC) GetBestBlockHash() (string, error) {
|
func (b *EthereumRPC) GetBestBlockHash() (string, error) {
|
||||||
h, err := b.getBestHeader()
|
h, err := b.getBestHeader()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
@ -208,7 +211,7 @@ func (b *EthRPC) GetBestBlockHash() (string, error) {
|
|||||||
return ethHashToHash(h.Hash()), nil
|
return ethHashToHash(h.Hash()), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthRPC) GetBestBlockHeight() (uint32, error) {
|
func (b *EthereumRPC) GetBestBlockHeight() (uint32, error) {
|
||||||
h, err := b.getBestHeader()
|
h, err := b.getBestHeader()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
@ -217,7 +220,7 @@ func (b *EthRPC) GetBestBlockHeight() (uint32, error) {
|
|||||||
return uint32(h.Number.Uint64()), nil
|
return uint32(h.Number.Uint64()), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthRPC) GetBlockHash(height uint32) (string, error) {
|
func (b *EthereumRPC) GetBlockHash(height uint32) (string, error) {
|
||||||
var n big.Int
|
var n big.Int
|
||||||
n.SetUint64(uint64(height))
|
n.SetUint64(uint64(height))
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), b.timeout)
|
ctx, cancel := context.WithTimeout(context.Background(), b.timeout)
|
||||||
@ -232,7 +235,7 @@ func (b *EthRPC) GetBlockHash(height uint32) (string, error) {
|
|||||||
return ethHashToHash(h.Hash()), nil
|
return ethHashToHash(h.Hash()), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthRPC) ethHeaderToBlockHeader(h *ethtypes.Header) (*bchain.BlockHeader, error) {
|
func (b *EthereumRPC) ethHeaderToBlockHeader(h *ethtypes.Header) (*bchain.BlockHeader, error) {
|
||||||
hn := h.Number.Uint64()
|
hn := h.Number.Uint64()
|
||||||
c, err := b.computeConfirmations(hn)
|
c, err := b.computeConfirmations(hn)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -248,7 +251,7 @@ func (b *EthRPC) ethHeaderToBlockHeader(h *ethtypes.Header) (*bchain.BlockHeader
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthRPC) GetBlockHeader(hash string) (*bchain.BlockHeader, error) {
|
func (b *EthereumRPC) GetBlockHeader(hash string) (*bchain.BlockHeader, error) {
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), b.timeout)
|
ctx, cancel := context.WithTimeout(context.Background(), b.timeout)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
h, err := b.client.HeaderByHash(ctx, ethcommon.HexToHash(hash))
|
h, err := b.client.HeaderByHash(ctx, ethcommon.HexToHash(hash))
|
||||||
@ -261,7 +264,7 @@ func (b *EthRPC) GetBlockHeader(hash string) (*bchain.BlockHeader, error) {
|
|||||||
return b.ethHeaderToBlockHeader(h)
|
return b.ethHeaderToBlockHeader(h)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthRPC) computeConfirmations(n uint64) (uint32, error) {
|
func (b *EthereumRPC) computeConfirmations(n uint64) (uint32, error) {
|
||||||
bh, err := b.getBestHeader()
|
bh, err := b.getBestHeader()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
@ -346,7 +349,7 @@ func ethTxToTx(tx *rpcTransaction, blocktime int64, confirmations uint32) (*bcha
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetBlock returns block with given hash or height, hash has precedence if both passed
|
// GetBlock returns block with given hash or height, hash has precedence if both passed
|
||||||
func (b *EthRPC) GetBlock(hash string, height uint32) (*bchain.Block, error) {
|
func (b *EthereumRPC) GetBlock(hash string, height uint32) (*bchain.Block, error) {
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), b.timeout)
|
ctx, cancel := context.WithTimeout(context.Background(), b.timeout)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
var raw json.RawMessage
|
var raw json.RawMessage
|
||||||
@ -404,7 +407,7 @@ func (b *EthRPC) GetBlock(hash string, height uint32) (*bchain.Block, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetTransaction returns a transaction by the transaction ID.
|
// GetTransaction returns a transaction by the transaction ID.
|
||||||
func (b *EthRPC) GetTransaction(txid string) (*bchain.Tx, error) {
|
func (b *EthereumRPC) GetTransaction(txid string) (*bchain.Tx, error) {
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), b.timeout)
|
ctx, cancel := context.WithTimeout(context.Background(), b.timeout)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
var tx *rpcTransaction
|
var tx *rpcTransaction
|
||||||
@ -449,7 +452,7 @@ type rpcMempoolBlock struct {
|
|||||||
Transactions []string `json:"transactions"`
|
Transactions []string `json:"transactions"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthRPC) GetMempool() ([]string, error) {
|
func (b *EthereumRPC) GetMempool() ([]string, error) {
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), b.timeout)
|
ctx, cancel := context.WithTimeout(context.Background(), b.timeout)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
var raw json.RawMessage
|
var raw json.RawMessage
|
||||||
@ -468,12 +471,12 @@ func (b *EthRPC) GetMempool() ([]string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// EstimateFee returns fee estimation.
|
// EstimateFee returns fee estimation.
|
||||||
func (b *EthRPC) EstimateFee(blocks int) (float64, error) {
|
func (b *EthereumRPC) EstimateFee(blocks int) (float64, error) {
|
||||||
return b.EstimateSmartFee(blocks, true)
|
return b.EstimateSmartFee(blocks, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
// EstimateSmartFee returns fee estimation.
|
// EstimateSmartFee returns fee estimation.
|
||||||
func (b *EthRPC) EstimateSmartFee(blocks int, conservative bool) (float64, error) {
|
func (b *EthereumRPC) EstimateSmartFee(blocks int, conservative bool) (float64, error) {
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), b.timeout)
|
ctx, cancel := context.WithTimeout(context.Background(), b.timeout)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
// TODO - what parameters of msg to use to get better estimate, maybe more data from the wallet are needed
|
// TODO - what parameters of msg to use to get better estimate, maybe more data from the wallet are needed
|
||||||
@ -489,26 +492,26 @@ func (b *EthRPC) EstimateSmartFee(blocks int, conservative bool) (float64, error
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SendRawTransaction sends raw transaction.
|
// SendRawTransaction sends raw transaction.
|
||||||
func (b *EthRPC) SendRawTransaction(tx string) (string, error) {
|
func (b *EthereumRPC) SendRawTransaction(tx string) (string, error) {
|
||||||
return "", errors.New("SendRawTransaction: not implemented")
|
return "", errors.New("SendRawTransaction: not implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthRPC) ResyncMempool(onNewTxAddr func(txid string, addr string)) error {
|
func (b *EthereumRPC) ResyncMempool(onNewTxAddr func(txid string, addr string)) error {
|
||||||
return b.Mempool.Resync(onNewTxAddr)
|
return b.Mempool.Resync(onNewTxAddr)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthRPC) GetMempoolTransactions(address string) ([]string, error) {
|
func (b *EthereumRPC) GetMempoolTransactions(address string) ([]string, error) {
|
||||||
return b.Mempool.GetTransactions(address)
|
return b.Mempool.GetTransactions(address)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthRPC) GetMempoolSpentOutput(outputTxid string, vout uint32) string {
|
func (b *EthereumRPC) GetMempoolSpentOutput(outputTxid string, vout uint32) string {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthRPC) GetMempoolEntry(txid string) (*bchain.MempoolEntry, error) {
|
func (b *EthereumRPC) GetMempoolEntry(txid string) (*bchain.MempoolEntry, error) {
|
||||||
return nil, errors.New("ResyncMempool: not implemented")
|
return nil, errors.New("GetMempoolEntry: not implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *EthRPC) GetChainParser() bchain.BlockChainParser {
|
func (b *EthereumRPC) GetChainParser() bchain.BlockChainParser {
|
||||||
return b.Parser
|
return b.Parser
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,7 @@ var rpcURL = "ws://10.34.3.4:18546"
|
|||||||
var ethClient *ethclient.Client
|
var ethClient *ethclient.Client
|
||||||
var ethRPCClient *rpc.Client
|
var ethRPCClient *rpc.Client
|
||||||
|
|
||||||
func setupEthRPC() *EthRPC {
|
func setupEthRPC() *EthereumRPC {
|
||||||
if ethClient == nil {
|
if ethClient == nil {
|
||||||
rc, err := rpc.Dial(rpcURL)
|
rc, err := rpc.Dial(rpcURL)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -25,7 +25,7 @@ func setupEthRPC() *EthRPC {
|
|||||||
ethRPCClient = rc
|
ethRPCClient = rc
|
||||||
ethClient = ec
|
ethClient = ec
|
||||||
}
|
}
|
||||||
return &EthRPC{
|
return &EthereumRPC{
|
||||||
client: ethClient,
|
client: ethClient,
|
||||||
rpc: ethRPCClient,
|
rpc: ethRPCClient,
|
||||||
timeout: time.Duration(25) * time.Second,
|
timeout: time.Duration(25) * time.Second,
|
||||||
@ -35,7 +35,7 @@ func setupEthRPC() *EthRPC {
|
|||||||
|
|
||||||
func TestEthRPC_getBestHeader(t *testing.T) {
|
func TestEthRPC_getBestHeader(t *testing.T) {
|
||||||
type fields struct {
|
type fields struct {
|
||||||
b *EthRPC
|
b *EthereumRPC
|
||||||
}
|
}
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
@ -64,7 +64,7 @@ func TestEthRPC_getBestHeader(t *testing.T) {
|
|||||||
|
|
||||||
func TestEthRPC_GetBestBlockHash(t *testing.T) {
|
func TestEthRPC_GetBestBlockHash(t *testing.T) {
|
||||||
type fields struct {
|
type fields struct {
|
||||||
b *EthRPC
|
b *EthereumRPC
|
||||||
}
|
}
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
@ -97,7 +97,7 @@ func TestEthRPC_GetBestBlockHash(t *testing.T) {
|
|||||||
|
|
||||||
func TestEthRPC_GetBestBlockHeight(t *testing.T) {
|
func TestEthRPC_GetBestBlockHeight(t *testing.T) {
|
||||||
type fields struct {
|
type fields struct {
|
||||||
b *EthRPC
|
b *EthereumRPC
|
||||||
}
|
}
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
@ -129,7 +129,7 @@ func TestEthRPC_GetBestBlockHeight(t *testing.T) {
|
|||||||
|
|
||||||
func TestEthRPC_GetBlockHash(t *testing.T) {
|
func TestEthRPC_GetBlockHash(t *testing.T) {
|
||||||
type fields struct {
|
type fields struct {
|
||||||
b *EthRPC
|
b *EthereumRPC
|
||||||
}
|
}
|
||||||
type args struct {
|
type args struct {
|
||||||
height uint32
|
height uint32
|
||||||
@ -193,7 +193,7 @@ func TestEthRPC_GetBlockHeader(t *testing.T) {
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
type fields struct {
|
type fields struct {
|
||||||
b *EthRPC
|
b *EthereumRPC
|
||||||
}
|
}
|
||||||
type args struct {
|
type args struct {
|
||||||
hash string
|
hash string
|
||||||
@ -250,7 +250,7 @@ func TestEthRPC_GetBlock(t *testing.T) {
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
type fields struct {
|
type fields struct {
|
||||||
b *EthRPC
|
b *EthereumRPC
|
||||||
}
|
}
|
||||||
type args struct {
|
type args struct {
|
||||||
hash string
|
hash string
|
||||||
@ -345,7 +345,7 @@ func TestEthRPC_GetTransaction(t *testing.T) {
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
type fields struct {
|
type fields struct {
|
||||||
b *EthRPC
|
b *EthereumRPC
|
||||||
}
|
}
|
||||||
type args struct {
|
type args struct {
|
||||||
txid string
|
txid string
|
||||||
@ -430,7 +430,7 @@ func TestEthRPC_GetTransaction(t *testing.T) {
|
|||||||
|
|
||||||
func TestEthRPC_EstimateFee(t *testing.T) {
|
func TestEthRPC_EstimateFee(t *testing.T) {
|
||||||
type fields struct {
|
type fields struct {
|
||||||
b *EthRPC
|
b *EthereumRPC
|
||||||
}
|
}
|
||||||
type args struct {
|
type args struct {
|
||||||
blocks int
|
blocks int
|
||||||
@ -469,7 +469,7 @@ func TestEthRPC_EstimateFee(t *testing.T) {
|
|||||||
|
|
||||||
func TestEthRPC_GetMempool(t *testing.T) {
|
func TestEthRPC_GetMempool(t *testing.T) {
|
||||||
type fields struct {
|
type fields struct {
|
||||||
b *EthRPC
|
b *EthereumRPC
|
||||||
}
|
}
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user