From 1139f7c23dce5329ca032d1ae3fe6cb217830a25 Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Thu, 19 Oct 2023 14:22:12 +0800 Subject: [PATCH] chore: pkg import only once Signed-off-by: guoguangwu --- core/store/ledgerstore/ledger_store.go | 3 +-- http/ethrpc/eth/api.go | 3 +-- p2pserver/mock/discovery_test.go | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/core/store/ledgerstore/ledger_store.go b/core/store/ledgerstore/ledger_store.go index 33c583e9a7..a2fdaede7c 100644 --- a/core/store/ledgerstore/ledger_store.go +++ b/core/store/ledgerstore/ledger_store.go @@ -36,7 +36,6 @@ import ( "github.com/ontio/ontology-crypto/keypair" "github.com/ontio/ontology/common" "github.com/ontio/ontology/common/config" - sysconfig "github.com/ontio/ontology/common/config" "github.com/ontio/ontology/common/log" vconfig "github.com/ontio/ontology/consensus/vbft/config" "github.com/ontio/ontology/core/payload" @@ -1462,7 +1461,7 @@ func (this *LedgerStoreImp) PreExecuteEip155Tx(msg types3.Message) (*types5.Exec Height: height, Timestamp: blockTime, } - config := params.GetChainConfig(sysconfig.DefConfig.P2PNode.EVMChainId) + config := params.GetChainConfig(config.DefConfig.P2PNode.EVMChainId) txContext := evm.NewEVMTxContext(msg) blockContext := evm.NewEVMBlockContext(height, blockTime, this) cache := this.GetCacheDB() diff --git a/http/ethrpc/eth/api.go b/http/ethrpc/eth/api.go index ddbd1c43eb..753f546d2a 100644 --- a/http/ethrpc/eth/api.go +++ b/http/ethrpc/eth/api.go @@ -35,7 +35,6 @@ import ( "github.com/ontio/ontology/common/constants" "github.com/ontio/ontology/common/log" "github.com/ontio/ontology/core/states" - common2 "github.com/ontio/ontology/core/store/common" sCom "github.com/ontio/ontology/core/store/common" otypes "github.com/ontio/ontology/core/types" ontErrors "github.com/ontio/ontology/errors" @@ -443,7 +442,7 @@ func (api *EthereumAPI) GetTransactionByHash(hash common.Hash) (*types2.Transact log.Debugf("eth_getTransactionByHash hash %v", hash.Hex()) height, tx, err := bactor.GetTxnWithHeightByTxHash(oComm.Uint256(hash)) if err != nil { - if err == common2.ErrNotFound { + if err == sCom.ErrNotFound { return nil, nil } return nil, err diff --git a/p2pserver/mock/discovery_test.go b/p2pserver/mock/discovery_test.go index 8727f25a3e..dbe246e3c4 100644 --- a/p2pserver/mock/discovery_test.go +++ b/p2pserver/mock/discovery_test.go @@ -24,7 +24,6 @@ import ( "github.com/ontio/ontology/common/log" "github.com/ontio/ontology/p2pserver/common" - "github.com/ontio/ontology/p2pserver/message/types" msgTypes "github.com/ontio/ontology/p2pserver/message/types" "github.com/ontio/ontology/p2pserver/net/netserver" p2p "github.com/ontio/ontology/p2pserver/net/protocol" @@ -82,7 +81,7 @@ func (self *DiscoveryProtocol) HandleSystemMessage(net p2p.P2P, msg p2p.SystemMe func (self *DiscoveryProtocol) HandlePeerMessage(ctx *p2p.Context, msg msgTypes.Message) { log.Trace("[p2p]receive message", ctx.Sender().GetAddr(), ctx.Sender().GetID()) switch m := msg.(type) { - case *types.AddrReq: + case *msgTypes.AddrReq: self.discovery.AddrReqHandle(ctx) case *msgTypes.FindNodeResp: self.discovery.FindNodeResponseHandle(ctx, m)