aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJhih-Ming Huang <jm@dexon.org>2019-04-10 22:29:35 +0800
committerJimmy Hu <jimmy.hu@dexon.org>2019-04-22 17:32:25 +0800
commitfffd645be95ab6137094faba020dc8879b3a7569 (patch)
tree3577bf8cbe0b8464884ea65e7ae72189fbed8dbd
parent96c5d8944bf5c03a4dc46ad9a1388494ce4d6285 (diff)
downloaddexon-fffd645be95ab6137094faba020dc8879b3a7569.tar
dexon-fffd645be95ab6137094faba020dc8879b3a7569.tar.gz
dexon-fffd645be95ab6137094faba020dc8879b3a7569.tar.bz2
dexon-fffd645be95ab6137094faba020dc8879b3a7569.tar.lz
dexon-fffd645be95ab6137094faba020dc8879b3a7569.tar.xz
dexon-fffd645be95ab6137094faba020dc8879b3a7569.tar.zst
dexon-fffd645be95ab6137094faba020dc8879b3a7569.zip
fixup! Change import go github.com/dexon-foundation/dexon
-rw-r--r--accounts/abi/bind/backend.go10
-rw-r--r--accounts/abi/bind/backends/simulated.go14
-rw-r--r--accounts/abi/bind/base.go8
-rw-r--r--build/testtool/testtool.go6
-rw-r--r--core/blockchain.go2
-rw-r--r--core/headerchain.go2
-rw-r--r--crypto/bn256/bn256_fast.go2
-rw-r--r--crypto/bn256/bn256_slow.go2
-rw-r--r--ethclient/ethclient.go32
-rw-r--r--ethclient/ethclient_test.go36
-rw-r--r--interfaces.go2
-rw-r--r--light/lightchain.go3
-rw-r--r--p2p/nat/nat.go3
-rw-r--r--p2p/nat/natpmp.go2
-rw-r--r--whisper/shhclient/client.go2
15 files changed, 64 insertions, 62 deletions
diff --git a/accounts/abi/bind/backend.go b/accounts/abi/bind/backend.go
index 099c0f9cc..54b9f808f 100644
--- a/accounts/abi/bind/backend.go
+++ b/accounts/abi/bind/backend.go
@@ -49,7 +49,7 @@ type ContractCaller interface {
CodeAt(ctx context.Context, contract common.Address, blockNumber *big.Int) ([]byte, error)
// ContractCall executes an Ethereum contract call with the specified data as the
// input.
- CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)
+ CallContract(ctx context.Context, call dexon.CallMsg, blockNumber *big.Int) ([]byte, error)
}
// PendingContractCaller defines methods to perform contract calls on the pending state.
@@ -59,7 +59,7 @@ type PendingContractCaller interface {
// PendingCodeAt returns the code of the given account in the pending state.
PendingCodeAt(ctx context.Context, contract common.Address) ([]byte, error)
// PendingCallContract executes an Ethereum contract call against the pending state.
- PendingCallContract(ctx context.Context, call ethereum.CallMsg) ([]byte, error)
+ PendingCallContract(ctx context.Context, call dexon.CallMsg) ([]byte, error)
}
// ContractTransactor defines the methods needed to allow operating with contract
@@ -79,7 +79,7 @@ type ContractTransactor interface {
// There is no guarantee that this is the true gas limit requirement as other
// transactions may be added or removed by miners, but it should provide a basis
// for setting a reasonable default.
- EstimateGas(ctx context.Context, call ethereum.CallMsg) (gas uint64, err error)
+ EstimateGas(ctx context.Context, call dexon.CallMsg) (gas uint64, err error)
// SendTransaction injects the transaction into the pending pool for execution.
SendTransaction(ctx context.Context, tx *types.Transaction) error
}
@@ -91,11 +91,11 @@ type ContractFilterer interface {
// returning all the results in one batch.
//
// TODO(karalabe): Deprecate when the subscription one can return past data too.
- FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error)
+ FilterLogs(ctx context.Context, query dexon.FilterQuery) ([]types.Log, error)
// SubscribeFilterLogs creates a background log filtering operation, returning
// a subscription immediately, which can be used to stream the found events.
- SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error)
+ SubscribeFilterLogs(ctx context.Context, query dexon.FilterQuery, ch chan<- types.Log) (dexon.Subscription, error)
}
// DeployBackend wraps the operations needed by WaitMined and WaitDeployed.
diff --git a/accounts/abi/bind/backends/simulated.go b/accounts/abi/bind/backends/simulated.go
index c4048b503..00e5cf482 100644
--- a/accounts/abi/bind/backends/simulated.go
+++ b/accounts/abi/bind/backends/simulated.go
@@ -173,7 +173,7 @@ func (b *SimulatedBackend) PendingCodeAt(ctx context.Context, contract common.Ad
}
// CallContract executes a contract call.
-func (b *SimulatedBackend) CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) {
+func (b *SimulatedBackend) CallContract(ctx context.Context, call dexon.CallMsg, blockNumber *big.Int) ([]byte, error) {
b.mu.Lock()
defer b.mu.Unlock()
@@ -189,7 +189,7 @@ func (b *SimulatedBackend) CallContract(ctx context.Context, call ethereum.CallM
}
// PendingCallContract executes a contract call on the pending state.
-func (b *SimulatedBackend) PendingCallContract(ctx context.Context, call ethereum.CallMsg) ([]byte, error) {
+func (b *SimulatedBackend) PendingCallContract(ctx context.Context, call dexon.CallMsg) ([]byte, error) {
b.mu.Lock()
defer b.mu.Unlock()
defer b.pendingState.RevertToSnapshot(b.pendingState.Snapshot())
@@ -215,7 +215,7 @@ func (b *SimulatedBackend) SuggestGasPrice(ctx context.Context) (*big.Int, error
// EstimateGas executes the requested code against the currently pending block/state and
// returns the used amount of gas.
-func (b *SimulatedBackend) EstimateGas(ctx context.Context, call ethereum.CallMsg) (uint64, error) {
+func (b *SimulatedBackend) EstimateGas(ctx context.Context, call dexon.CallMsg) (uint64, error) {
b.mu.Lock()
defer b.mu.Unlock()
@@ -265,7 +265,7 @@ func (b *SimulatedBackend) EstimateGas(ctx context.Context, call ethereum.CallMs
// callContract implements common code between normal and pending contract calls.
// state is modified during execution, make sure to copy it if necessary.
-func (b *SimulatedBackend) callContract(ctx context.Context, call ethereum.CallMsg, block *types.Block, statedb *state.StateDB) ([]byte, uint64, bool, error) {
+func (b *SimulatedBackend) callContract(ctx context.Context, call dexon.CallMsg, block *types.Block, statedb *state.StateDB) ([]byte, uint64, bool, error) {
// Ensure message is initialized properly.
if call.GasPrice == nil {
call.GasPrice = big.NewInt(1)
@@ -323,7 +323,7 @@ func (b *SimulatedBackend) SendTransaction(ctx context.Context, tx *types.Transa
// returning all the results in one batch.
//
// TODO(karalabe): Deprecate when the subscription one can return past data too.
-func (b *SimulatedBackend) FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error) {
+func (b *SimulatedBackend) FilterLogs(ctx context.Context, query dexon.FilterQuery) ([]types.Log, error) {
var filter *filters.Filter
if query.BlockHash != nil {
// Block filter requested, construct a single-shot filter
@@ -355,7 +355,7 @@ func (b *SimulatedBackend) FilterLogs(ctx context.Context, query ethereum.Filter
// SubscribeFilterLogs creates a background log filtering operation, returning a
// subscription immediately, which can be used to stream the found events.
-func (b *SimulatedBackend) SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error) {
+func (b *SimulatedBackend) SubscribeFilterLogs(ctx context.Context, query dexon.FilterQuery, ch chan<- types.Log) (dexon.Subscription, error) {
// Subscribe to contract events
sink := make(chan []*types.Log)
@@ -407,7 +407,7 @@ func (b *SimulatedBackend) AdjustTime(adjustment time.Duration) error {
// callmsg implements core.Message to allow passing it as a transaction simulator.
type callmsg struct {
- ethereum.CallMsg
+ dexon.CallMsg
}
func (m callmsg) From() common.Address { return m.CallMsg.From }
diff --git a/accounts/abi/bind/base.go b/accounts/abi/bind/base.go
index b88795aa8..8def0b621 100644
--- a/accounts/abi/bind/base.go
+++ b/accounts/abi/bind/base.go
@@ -128,7 +128,7 @@ func (c *BoundContract) Call(opts *CallOpts, result interface{}, method string,
return err
}
var (
- msg = ethereum.CallMsg{From: opts.From, To: &c.address, Data: input}
+ msg = dexon.CallMsg{From: opts.From, To: &c.address, Data: input}
ctx = ensureContext(opts.Context)
code []byte
output []byte
@@ -218,7 +218,7 @@ func (c *BoundContract) transact(opts *TransactOpts, contract *common.Address, i
}
}
// If the contract surely has code (or code is not needed), estimate the transaction
- msg := ethereum.CallMsg{From: opts.From, To: contract, Value: value, Data: input}
+ msg := dexon.CallMsg{From: opts.From, To: contract, Value: value, Data: input}
gasLimit, err = c.transactor.EstimateGas(ensureContext(opts.Context), msg)
if err != nil {
return nil, fmt.Errorf("failed to estimate gas needed: %v", err)
@@ -261,7 +261,7 @@ func (c *BoundContract) FilterLogs(opts *FilterOpts, name string, query ...[]int
// Start the background filtering
logs := make(chan types.Log, 128)
- config := ethereum.FilterQuery{
+ config := dexon.FilterQuery{
Addresses: []common.Address{c.address},
Topics: topics,
FromBlock: new(big.Int).SetUint64(opts.Start),
@@ -310,7 +310,7 @@ func (c *BoundContract) WatchLogs(opts *WatchOpts, name string, query ...[]inter
// Start the background filtering
logs := make(chan types.Log, 128)
- config := ethereum.FilterQuery{
+ config := dexon.FilterQuery{
Addresses: []common.Address{c.address},
Topics: topics,
}
diff --git a/build/testtool/testtool.go b/build/testtool/testtool.go
index a801cfbb3..f9d238695 100644
--- a/build/testtool/testtool.go
+++ b/build/testtool/testtool.go
@@ -56,7 +56,7 @@ func getBlockNumber(client *ethclient.Client, round int) *big.Int {
log.Fatalf("pack input fail: %v", err)
}
- result, err := client.CallContract(context.Background(), ethereum.CallMsg{
+ result, err := client.CallContract(context.Background(), dexon.CallMsg{
To: &vm.GovernanceContractAddress,
Data: input,
}, nil)
@@ -102,7 +102,7 @@ func doVerifyGovCRS(args []string) {
log.Fatalf("pack input fail: %v", err)
}
- result, err := client.CallContract(context.Background(), ethereum.CallMsg{
+ result, err := client.CallContract(context.Background(), dexon.CallMsg{
To: &vm.GovernanceContractAddress,
Data: input,
}, blockNumber)
@@ -152,7 +152,7 @@ func doVerifyGovMPK(args []string) {
log.Fatalf("pack input fail: %v", err)
}
- result, err := client.CallContract(context.Background(), ethereum.CallMsg{
+ result, err := client.CallContract(context.Background(), dexon.CallMsg{
To: &vm.GovernanceContractAddress,
Data: input,
}, blockNumber)
diff --git a/core/blockchain.go b/core/blockchain.go
index 3f0e7203e..feb61fee6 100644
--- a/core/blockchain.go
+++ b/core/blockchain.go
@@ -30,7 +30,7 @@ import (
dexCore "github.com/dexon-foundation/dexon-consensus/core"
coreTypes "github.com/dexon-foundation/dexon-consensus/core/types"
- "github.com/hashicorp/golang-lru"
+ lru "github.com/hashicorp/golang-lru"
"github.com/dexon-foundation/dexon/common"
"github.com/dexon-foundation/dexon/common/math"
diff --git a/core/headerchain.go b/core/headerchain.go
index 4eff41b26..c615cadd2 100644
--- a/core/headerchain.go
+++ b/core/headerchain.go
@@ -30,6 +30,7 @@ import (
dexCore "github.com/dexon-foundation/dexon-consensus/core"
coreCrypto "github.com/dexon-foundation/dexon-consensus/core/crypto"
coreTypes "github.com/dexon-foundation/dexon-consensus/core/types"
+ lru "github.com/hashicorp/golang-lru"
"github.com/dexon-foundation/dexon/common"
"github.com/dexon-foundation/dexon/consensus"
@@ -43,7 +44,6 @@ import (
"github.com/dexon-foundation/dexon/params"
"github.com/dexon-foundation/dexon/rlp"
"github.com/dexon-foundation/dexon/trie"
- "github.com/hashicorp/golang-lru"
)
const (
diff --git a/crypto/bn256/bn256_fast.go b/crypto/bn256/bn256_fast.go
index 702521c32..278d542e0 100644
--- a/crypto/bn256/bn256_fast.go
+++ b/crypto/bn256/bn256_fast.go
@@ -7,7 +7,7 @@
// Package bn256 implements the Optimal Ate pairing over a 256-bit Barreto-Naehrig curve.
package bn256
-import "github.com/dexon-foundation/dexon/crypto/bn256/cloudflare"
+import bn256 "github.com/dexon-foundation/dexon/crypto/bn256/cloudflare"
// G1 is an abstract cyclic group. The zero value is suitable for use as the
// output of an operation, but cannot be used as an input.
diff --git a/crypto/bn256/bn256_slow.go b/crypto/bn256/bn256_slow.go
index 56c6437c5..f360731de 100644
--- a/crypto/bn256/bn256_slow.go
+++ b/crypto/bn256/bn256_slow.go
@@ -7,7 +7,7 @@
// Package bn256 implements the Optimal Ate pairing over a 256-bit Barreto-Naehrig curve.
package bn256
-import "github.com/dexon-foundation/dexon/crypto/bn256/google"
+import bn256 "github.com/dexon-foundation/dexon/crypto/bn256/google"
// G1 is an abstract cyclic group. The zero value is suitable for use as the
// output of an operation, but cannot be used as an input.
diff --git a/ethclient/ethclient.go b/ethclient/ethclient.go
index c8a8e5eb5..ec2680188 100644
--- a/ethclient/ethclient.go
+++ b/ethclient/ethclient.go
@@ -90,7 +90,7 @@ func (ec *Client) getBlock(ctx context.Context, method string, args ...interface
if err != nil {
return nil, err
} else if len(raw) == 0 {
- return nil, ethereum.NotFound
+ return nil, dexon.NotFound
}
// Decode header and transactions.
var head *types.Header
@@ -154,7 +154,7 @@ func (ec *Client) HeaderByHash(ctx context.Context, hash common.Hash) (*types.He
var head *types.Header
err := ec.c.CallContext(ctx, &head, "eth_getBlockByHash", hash, false)
if err == nil && head == nil {
- err = ethereum.NotFound
+ err = dexon.NotFound
}
return head, err
}
@@ -165,7 +165,7 @@ func (ec *Client) HeaderByNumber(ctx context.Context, number *big.Int) (*types.H
var head *types.Header
err := ec.c.CallContext(ctx, &head, "eth_getBlockByNumber", toBlockNumArg(number), false)
if err == nil && head == nil {
- err = ethereum.NotFound
+ err = dexon.NotFound
}
return head, err
}
@@ -195,7 +195,7 @@ func (ec *Client) TransactionByHash(ctx context.Context, hash common.Hash) (tx *
if err != nil {
return nil, false, err
} else if json == nil {
- return nil, false, ethereum.NotFound
+ return nil, false, dexon.NotFound
} else if _, r, _ := json.tx.RawSignatureValues(); r == nil {
return nil, false, fmt.Errorf("server returned transaction without signature")
}
@@ -243,7 +243,7 @@ func (ec *Client) TransactionInBlock(ctx context.Context, blockHash common.Hash,
err := ec.c.CallContext(ctx, &json, "eth_getTransactionByBlockHashAndIndex", blockHash, hexutil.Uint64(index))
if err == nil {
if json == nil {
- return nil, ethereum.NotFound
+ return nil, dexon.NotFound
} else if _, r, _ := json.tx.RawSignatureValues(); r == nil {
return nil, fmt.Errorf("server returned transaction without signature")
}
@@ -261,7 +261,7 @@ func (ec *Client) TransactionReceipt(ctx context.Context, txHash common.Hash) (*
err := ec.c.CallContext(ctx, &r, "eth_getTransactionReceipt", txHash)
if err == nil {
if r == nil {
- return nil, ethereum.NotFound
+ return nil, dexon.NotFound
}
}
return r, err
@@ -284,7 +284,7 @@ type rpcProgress struct {
// SyncProgress retrieves the current progress of the sync algorithm. If there's
// no sync currently running, it returns nil.
-func (ec *Client) SyncProgress(ctx context.Context) (*ethereum.SyncProgress, error) {
+func (ec *Client) SyncProgress(ctx context.Context) (*dexon.SyncProgress, error) {
var raw json.RawMessage
if err := ec.c.CallContext(ctx, &raw, "eth_syncing"); err != nil {
return nil, err
@@ -298,7 +298,7 @@ func (ec *Client) SyncProgress(ctx context.Context) (*ethereum.SyncProgress, err
if err := json.Unmarshal(raw, &progress); err != nil {
return nil, err
}
- return &ethereum.SyncProgress{
+ return &dexon.SyncProgress{
StartingBlock: uint64(progress.StartingBlock),
CurrentBlock: uint64(progress.CurrentBlock),
HighestBlock: uint64(progress.HighestBlock),
@@ -309,7 +309,7 @@ func (ec *Client) SyncProgress(ctx context.Context) (*ethereum.SyncProgress, err
// SubscribeNewHead subscribes to notifications about the current blockchain head
// on the given channel.
-func (ec *Client) SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) (ethereum.Subscription, error) {
+func (ec *Client) SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) (dexon.Subscription, error) {
return ec.c.EthSubscribe(ctx, ch, "newHeads")
}
@@ -363,7 +363,7 @@ func (ec *Client) NonceAt(ctx context.Context, account common.Address, blockNumb
// Filters
// FilterLogs executes a filter query.
-func (ec *Client) FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error) {
+func (ec *Client) FilterLogs(ctx context.Context, q dexon.FilterQuery) ([]types.Log, error) {
var result []types.Log
arg, err := toFilterArg(q)
if err != nil {
@@ -374,7 +374,7 @@ func (ec *Client) FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]typ
}
// SubscribeFilterLogs subscribes to the results of a streaming filter query.
-func (ec *Client) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error) {
+func (ec *Client) SubscribeFilterLogs(ctx context.Context, q dexon.FilterQuery, ch chan<- types.Log) (dexon.Subscription, error) {
arg, err := toFilterArg(q)
if err != nil {
return nil, err
@@ -382,7 +382,7 @@ func (ec *Client) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuer
return ec.c.EthSubscribe(ctx, ch, "logs", arg)
}
-func toFilterArg(q ethereum.FilterQuery) (interface{}, error) {
+func toFilterArg(q dexon.FilterQuery) (interface{}, error) {
arg := map[string]interface{}{
"address": q.Addresses,
"topics": q.Topics,
@@ -451,7 +451,7 @@ func (ec *Client) PendingTransactionCount(ctx context.Context) (uint, error) {
// blockNumber selects the block height at which the call runs. It can be nil, in which
// case the code is taken from the latest known block. Note that state from very old
// blocks might not be available.
-func (ec *Client) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) {
+func (ec *Client) CallContract(ctx context.Context, msg dexon.CallMsg, blockNumber *big.Int) ([]byte, error) {
var hex hexutil.Bytes
err := ec.c.CallContext(ctx, &hex, "eth_call", toCallArg(msg), toBlockNumArg(blockNumber))
if err != nil {
@@ -462,7 +462,7 @@ func (ec *Client) CallContract(ctx context.Context, msg ethereum.CallMsg, blockN
// PendingCallContract executes a message call transaction using the EVM.
// The state seen by the contract call is the pending state.
-func (ec *Client) PendingCallContract(ctx context.Context, msg ethereum.CallMsg) ([]byte, error) {
+func (ec *Client) PendingCallContract(ctx context.Context, msg dexon.CallMsg) ([]byte, error) {
var hex hexutil.Bytes
err := ec.c.CallContext(ctx, &hex, "eth_call", toCallArg(msg), "pending")
if err != nil {
@@ -485,7 +485,7 @@ func (ec *Client) SuggestGasPrice(ctx context.Context) (*big.Int, error) {
// the current pending state of the backend blockchain. There is no guarantee that this is
// the true gas limit requirement as other transactions may be added or removed by miners,
// but it should provide a basis for setting a reasonable default.
-func (ec *Client) EstimateGas(ctx context.Context, msg ethereum.CallMsg) (uint64, error) {
+func (ec *Client) EstimateGas(ctx context.Context, msg dexon.CallMsg) (uint64, error) {
var hex hexutil.Uint64
err := ec.c.CallContext(ctx, &hex, "eth_estimateGas", toCallArg(msg))
if err != nil {
@@ -522,7 +522,7 @@ func (ec *Client) SendTransactions(ctx context.Context, txs []*types.Transaction
return ec.c.CallContext(ctx, nil, "eth_sendRawTransactions", txData)
}
-func toCallArg(msg ethereum.CallMsg) interface{} {
+func toCallArg(msg dexon.CallMsg) interface{} {
arg := map[string]interface{}{
"from": msg.From,
"to": msg.To,
diff --git a/ethclient/ethclient_test.go b/ethclient/ethclient_test.go
index 46acf0dc0..b57d2505c 100644
--- a/ethclient/ethclient_test.go
+++ b/ethclient/ethclient_test.go
@@ -28,17 +28,17 @@ import (
// Verify that Client implements the ethereum interfaces.
var (
- _ = ethereum.ChainReader(&Client{})
- _ = ethereum.TransactionReader(&Client{})
- _ = ethereum.ChainStateReader(&Client{})
- _ = ethereum.ChainSyncReader(&Client{})
- _ = ethereum.ContractCaller(&Client{})
- _ = ethereum.GasEstimator(&Client{})
- _ = ethereum.GasPricer(&Client{})
- _ = ethereum.LogFilterer(&Client{})
- _ = ethereum.PendingStateReader(&Client{})
- // _ = ethereum.PendingStateEventer(&Client{})
- _ = ethereum.PendingContractCaller(&Client{})
+ _ = dexon.ChainReader(&Client{})
+ _ = dexon.TransactionReader(&Client{})
+ _ = dexon.ChainStateReader(&Client{})
+ _ = dexon.ChainSyncReader(&Client{})
+ _ = dexon.ContractCaller(&Client{})
+ _ = dexon.GasEstimator(&Client{})
+ _ = dexon.GasPricer(&Client{})
+ _ = dexon.LogFilterer(&Client{})
+ _ = dexon.PendingStateReader(&Client{})
+ // _ = dexon.PendingStateEventer(&Client{})
+ _ = dexon.PendingContractCaller(&Client{})
)
func TestToFilterArg(t *testing.T) {
@@ -52,13 +52,13 @@ func TestToFilterArg(t *testing.T) {
for _, testCase := range []struct {
name string
- input ethereum.FilterQuery
+ input dexon.FilterQuery
output interface{}
err error
}{
{
"without BlockHash",
- ethereum.FilterQuery{
+ dexon.FilterQuery{
Addresses: addresses,
FromBlock: big.NewInt(1),
ToBlock: big.NewInt(2),
@@ -74,7 +74,7 @@ func TestToFilterArg(t *testing.T) {
},
{
"with nil fromBlock and nil toBlock",
- ethereum.FilterQuery{
+ dexon.FilterQuery{
Addresses: addresses,
Topics: [][]common.Hash{},
},
@@ -88,7 +88,7 @@ func TestToFilterArg(t *testing.T) {
},
{
"with blockhash",
- ethereum.FilterQuery{
+ dexon.FilterQuery{
Addresses: addresses,
BlockHash: &blockHash,
Topics: [][]common.Hash{},
@@ -102,7 +102,7 @@ func TestToFilterArg(t *testing.T) {
},
{
"with blockhash and from block",
- ethereum.FilterQuery{
+ dexon.FilterQuery{
Addresses: addresses,
BlockHash: &blockHash,
FromBlock: big.NewInt(1),
@@ -113,7 +113,7 @@ func TestToFilterArg(t *testing.T) {
},
{
"with blockhash and to block",
- ethereum.FilterQuery{
+ dexon.FilterQuery{
Addresses: addresses,
BlockHash: &blockHash,
ToBlock: big.NewInt(1),
@@ -124,7 +124,7 @@ func TestToFilterArg(t *testing.T) {
},
{
"with blockhash and both from / to block",
- ethereum.FilterQuery{
+ dexon.FilterQuery{
Addresses: addresses,
BlockHash: &blockHash,
FromBlock: big.NewInt(1),
diff --git a/interfaces.go b/interfaces.go
index d99324968..1aa9c2a9a 100644
--- a/interfaces.go
+++ b/interfaces.go
@@ -15,7 +15,7 @@
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
// Package ethereum defines interfaces for interacting with Ethereum.
-package ethereum
+package dexon
import (
"context"
diff --git a/light/lightchain.go b/light/lightchain.go
index 7528ef5f8..016733c99 100644
--- a/light/lightchain.go
+++ b/light/lightchain.go
@@ -24,6 +24,8 @@ import (
"sync/atomic"
"time"
+ lru "github.com/hashicorp/golang-lru"
+
"github.com/dexon-foundation/dexon/common"
"github.com/dexon-foundation/dexon/consensus"
"github.com/dexon-foundation/dexon/core"
@@ -35,7 +37,6 @@ import (
"github.com/dexon-foundation/dexon/log"
"github.com/dexon-foundation/dexon/params"
"github.com/dexon-foundation/dexon/rlp"
- "github.com/hashicorp/golang-lru"
)
var (
diff --git a/p2p/nat/nat.go b/p2p/nat/nat.go
index 27cb82ad4..cafe81733 100644
--- a/p2p/nat/nat.go
+++ b/p2p/nat/nat.go
@@ -25,8 +25,9 @@ import (
"sync"
"time"
+ natpmp "github.com/jackpal/go-nat-pmp"
+
"github.com/dexon-foundation/dexon/log"
- "github.com/jackpal/go-nat-pmp"
)
// An implementation of nat.Interface can map local ports to ports
diff --git a/p2p/nat/natpmp.go b/p2p/nat/natpmp.go
index 8ba971472..7f85543f8 100644
--- a/p2p/nat/natpmp.go
+++ b/p2p/nat/natpmp.go
@@ -22,7 +22,7 @@ import (
"strings"
"time"
- "github.com/jackpal/go-nat-pmp"
+ natpmp "github.com/jackpal/go-nat-pmp"
)
// natPMPClient adapts the NAT-PMP protocol implementation so it conforms to
diff --git a/whisper/shhclient/client.go b/whisper/shhclient/client.go
index 921115d00..6b46f415d 100644
--- a/whisper/shhclient/client.go
+++ b/whisper/shhclient/client.go
@@ -167,7 +167,7 @@ func (sc *Client) Post(ctx context.Context, message whisper.NewMessage) (string,
// SubscribeMessages subscribes to messages that match the given criteria. This method
// is only supported on bi-directional connections such as websockets and IPC.
// NewMessageFilter uses polling and is supported over HTTP.
-func (sc *Client) SubscribeMessages(ctx context.Context, criteria whisper.Criteria, ch chan<- *whisper.Message) (ethereum.Subscription, error) {
+func (sc *Client) SubscribeMessages(ctx context.Context, criteria whisper.Criteria, ch chan<- *whisper.Message) (dexon.Subscription, error) {
return sc.c.ShhSubscribe(ctx, ch, "messages", criteria)
}