From cd938f67442a076679f10120d8dbb04bc846a91c Mon Sep 17 00:00:00 2001 From: kch Date: Mon, 17 Jul 2023 04:38:44 +0000 Subject: [PATCH 1/8] replace panic to logger.Panic print cause and explaination when an panic occurs --- chain/chaindb.go | 13 ++++++++----- chain/chaindbForRaft.go | 8 +++----- chain/chainservice.go | 26 +++++++++++--------------- chain/common.go | 3 +-- consensus/impl/dpos/bp/cluster.go | 2 +- consensus/impl/dpos/lib.go | 3 +-- consensus/impl/dpos/lib_test.go | 2 +- consensus/impl/dpos/status.go | 2 +- consensus/impl/raftv2/cluster.go | 4 ++-- consensus/impl/raftv2/config.go | 2 +- consensus/impl/raftv2/raftserver.go | 6 +++--- consensus/impl/raftv2/snapshot.go | 2 +- consensus/impl/raftv2/waldb.go | 7 ++++--- consensus/raftCommon.go | 2 +- 14 files changed, 39 insertions(+), 43 deletions(-) diff --git a/chain/chaindb.go b/chain/chaindb.go index 6ccb9e882..811876fb2 100644 --- a/chain/chaindb.go +++ b/chain/chaindb.go @@ -386,7 +386,7 @@ func (cdb *ChainDB) connectToChain(dbtx db.Transaction, block *types.Block, skip // Save the last consensus status. if cdb.cc != nil { if err := cdb.cc.Save(dbtx); err != nil { - logger.Error().Err(err).Msg("failed to save DPoS status") + logger.Error().Err(err).Uint64("blockNo", blockNo).Msg("failed to save DPoS status") } } @@ -571,11 +571,14 @@ func (cdb *ChainDB) dropBlock(dropNo types.BlockNo) error { } func (cdb *ChainDB) getBestBlockNo() (latestNo types.BlockNo) { + var ok bool + aopv := cdb.latest.Load() - if aopv != nil { - latestNo = aopv.(types.BlockNo) - } else { - panic("ChainDB:latest is nil") + if aopv == nil { + logger.Panic().Msg("ChainService: latest is nil") + } + if latestNo, ok = aopv.(types.BlockNo); !ok { + logger.Panic().Msg("ChainService: latest is not types.BlockNo") } return latestNo } diff --git a/chain/chaindbForRaft.go b/chain/chaindbForRaft.go index 037abc5ca..6cb7831e7 100644 --- a/chain/chaindbForRaft.go +++ b/chain/chaindbForRaft.go @@ -46,7 +46,7 @@ func (cdb *ChainDB) ResetWAL(hardStateInfo *types.HardStateInfo) error { snapData := consensus.NewSnapshotData(nil, nil, snapBlock) if snapData == nil { - panic("new snap failed") + logger.Panic().Uint64("SnapBlockNo", snapBlock.BlockNo()).Msg("new snap failed") } data, err := snapData.Encode() @@ -129,7 +129,6 @@ func (cdb *ChainDB) WriteHardState(hardstate *raftpb.HardState) error { if data, err = proto.Marshal(hardstate); err != nil { logger.Panic().Msg("failed to marshal raft state") - return err } dbTx.Set(raftStateKey, data) dbTx.Commit() @@ -147,7 +146,6 @@ func (cdb *ChainDB) GetHardState() (*raftpb.HardState, error) { state := &raftpb.HardState{} if err := proto.Unmarshal(data, state); err != nil { logger.Panic().Msg("failed to unmarshal raft state") - return nil, ErrInvalidHardState } logger.Info().Uint64("term", state.Term).Str("vote", types.Uint64ToHexaString(state.Vote)).Uint64("commit", state.Commit).Msg("load hard state") @@ -199,14 +197,14 @@ func (cdb *ChainDB) WriteRaftEntry(ents []*consensus.WalEntry, blocks []*types.B if entry.Type == consensus.EntryBlock { if err := cdb.addBlock(dbTx, blocks[i]); err != nil { - panic("add block entry") + logger.Panic().Err(err).Uint64("BlockNo", blocks[i].BlockNo()).Msg("failed to add block entry") } targetNo = blocks[i].BlockNo() } if data, err = entry.ToBytes(); err != nil { - panic("failed to convert entry to bytes") + logger.Panic().Err(err).Uint64("BlockNo", blocks[i].BlockNo()).Uint64("index", entry.Index).Msg("failed to convert entry to bytes") } lastIdx = entry.Index diff --git a/chain/chainservice.go b/chain/chainservice.go index 7d7363b88..79f5efd56 100644 --- a/chain/chainservice.go +++ b/chain/chainservice.go @@ -228,8 +228,7 @@ func NewChainService(cfg *cfg.Config) *ChainService { var err error if cs.Core, err = NewCore(cfg.DbType, cfg.DataDir, cfg.EnableTestmode, types.BlockNo(cfg.Blockchain.ForceResetHeight)); err != nil { - logger.Fatal().Err(err).Msg("failed to initialize DB") - panic(err) + logger.Panic().Err(err).Msg("failed to initialize DB") } if err = Init(cfg.Blockchain.MaxBlockSize, @@ -237,8 +236,7 @@ func NewChainService(cfg *cfg.Config) *ChainService { cfg.Consensus.EnableBp, cfg.Blockchain.MaxAnchorCount, cfg.Blockchain.VerifierCount); err != nil { - logger.Error().Err(err).Msg("failed to init chainservice") - panic("invalid config: blockchain") + logger.Panic().Err(err).Msg("failed to init chainservice | invalid config: blockchain") } var verifyMode = cs.cfg.Blockchain.VerifyOnly || cs.cfg.Blockchain.VerifyBlock != 0 @@ -263,14 +261,11 @@ func NewChainService(cfg *cfg.Config) *ChainService { // init genesis block if _, err := cs.initGenesis(nil, !cfg.UseTestnet, cfg.EnableTestmode); err != nil { - logger.Fatal().Err(err).Msg("failed to create a genesis block") - panic("failed to init genesis block") + logger.Panic().Err(err).Msg("failed to create a genesis block") } if err := cs.checkHardfork(); err != nil { - msg := "check the hardfork compatibility" - logger.Fatal().Err(err).Msg(msg) - panic(msg) + logger.Panic().Err(err).Msg("check the hardfork compatibility") } if ConsensusName() == consensus.ConsensusName[consensus.ConsensusDPOS] { @@ -302,7 +297,7 @@ func NewChainService(cfg *cfg.Config) *ChainService { //reset parameter of aergo.system systemState, err := cs.SDB().GetSystemAccountState() if err != nil { - panic("failed to read aergo.system state") + logger.Panic().Err(err).Msg("failed to read aergo.system state") } system.InitSystemParams(systemState, len(cs.GetGenesisInfo().BPs)) @@ -404,12 +399,13 @@ func (cs *ChainService) setRecovered(val bool) { } func (cs *ChainService) isRecovered() bool { - var val bool + var val, ok bool aopv := cs.recovered.Load() - if aopv != nil { - val = aopv.(bool) - } else { - panic("ChainService: recovered is nil") + if aopv == nil { + logger.Panic().Msg("ChainService: recovered is nil") + } + if val, ok = aopv.(bool); !ok { + logger.Panic().Msg("ChainService: recovered is not bool") } return val } diff --git a/chain/common.go b/chain/common.go index 2de255366..9f1ebe596 100644 --- a/chain/common.go +++ b/chain/common.go @@ -7,7 +7,6 @@ package chain import ( "errors" - "fmt" "github.com/aergoio/aergo/consensus" "github.com/aergoio/aergo/internal/enc" @@ -96,7 +95,7 @@ func MaxBlockSize() uint32 { func setMaxBlockBodySize(size uint32) { if size > types.BlockSizeHardLimit() { - panic(fmt.Errorf("too large block size (%v), hard limit = 8MiB", size)) + logger.Panic().Uint32("block size", size).Msg("too large block size, hard limit = 8MiB") } maxBlockBodySize = size } diff --git a/consensus/impl/dpos/bp/cluster.go b/consensus/impl/dpos/bp/cluster.go index 5ed351bac..4002b5599 100644 --- a/consensus/impl/dpos/bp/cluster.go +++ b/consensus/impl/dpos/bp/cluster.go @@ -333,7 +333,7 @@ func NewSnapshots(c ClusterMember, cdb consensus.ChainDB, sdb *state.ChainStateD if block, err := cdb.GetBestBlock(); err == nil { snap.UpdateCluster(block.BlockNo()) } else { - panic(err.Error()) + logger.Panic().Err(err).Msg("Failed to get the best block") } return snap diff --git a/consensus/impl/dpos/lib.go b/consensus/impl/dpos/lib.go index 2a1b6161d..d27ee11ed 100644 --- a/consensus/impl/dpos/lib.go +++ b/consensus/impl/dpos/lib.go @@ -401,9 +401,8 @@ func (bs *bootLoader) decodeStatus(key []byte, dst interface{}) error { err := common.GobDecode(value, dst) if err != nil { - logger.Debug().Err(err).Str("key", string(key)). + logger.Panic().Err(err).Str("key", string(key)). Msg("failed to decode DPoS status") - panic(err) } return nil } diff --git a/consensus/impl/dpos/lib_test.go b/consensus/impl/dpos/lib_test.go index ce8a36831..022edb355 100644 --- a/consensus/impl/dpos/lib_test.go +++ b/consensus/impl/dpos/lib_test.go @@ -66,7 +66,7 @@ func newTestChain(clusterSize uint16) (*testChain, error) { func (tc *testChain) setGenesis(block *types.Block) { if block.BlockNo() != 0 { - panic("invalid genesis block: non-zero block no") + logger.Panic().Msg("invalid genesis block: non-zero block no") } tc.status.libState.genesisInfo = &blockInfo{BlockHash: block.ID(), BlockNo: 0} tc.status.bestBlock = block diff --git a/consensus/impl/dpos/status.go b/consensus/impl/dpos/status.go index 2b1dd4473..d1160cbb8 100644 --- a/consensus/impl/dpos/status.go +++ b/consensus/impl/dpos/status.go @@ -224,7 +224,7 @@ func (s *Status) init(cdb consensus.ChainDB, resetHeight types.BlockNo) { genesis, err := cdb.GetBlockByNo(0) if err != nil { - panic(err) + logger.Panic().Err(err).Msg("failed to get genesis block") } best, err := cdb.GetBestBlock() diff --git a/consensus/impl/raftv2/cluster.go b/consensus/impl/raftv2/cluster.go index 4ef364160..ac334c7e3 100644 --- a/consensus/impl/raftv2/cluster.go +++ b/consensus/impl/raftv2/cluster.go @@ -433,7 +433,7 @@ func (cl *Cluster) addMember(member *consensus.Member, applied bool) error { // notify to p2p TODO temporary code peerID, err := types.IDFromBytes(member.PeerID) if err != nil { - panic("invalid member peerid " + enc.ToString(member.PeerID)) + logger.Panic().Err(err).Str("peerid", enc.ToString(member.PeerID)).Msg("invalid member peerid") } if cl.notifyFn != nil { @@ -466,7 +466,7 @@ func (cl *Cluster) removeMember(member *consensus.Member) error { // notify to p2p TODO temporary code peerID, err := types.IDFromBytes(member.PeerID) if err != nil { - panic("invalid member peerid " + enc.ToString(member.PeerID)) + logger.Panic().Err(err).Str("peerid", enc.ToString(member.PeerID)).Msg("invalid member peerid") } if cl.notifyFn != nil { diff --git a/consensus/impl/raftv2/config.go b/consensus/impl/raftv2/config.go index 5d9877f04..c81d56bb9 100644 --- a/consensus/impl/raftv2/config.go +++ b/consensus/impl/raftv2/config.go @@ -102,7 +102,7 @@ func (bf *BlockFactory) InitCluster(cfg *config.Config) error { raftConfig := cfg.Consensus.Raft if raftConfig == nil { - panic("raftconfig is not set. please set raftName, raftBPs.") + logger.Panic().Msg("raft config is not set. please set raftName, raftBPs.") } chainID, err := genesis.ID.Bytes() diff --git a/consensus/impl/raftv2/raftserver.go b/consensus/impl/raftv2/raftserver.go index be6f84631..541372bf2 100644 --- a/consensus/impl/raftv2/raftserver.go +++ b/consensus/impl/raftv2/raftserver.go @@ -550,7 +550,7 @@ func (rs *raftServer) createAergoP2PTransporter() Transporter { future := rs.RequestFuture(message.P2PSvc, message.GetRaftTransport{Cluster: rs.cluster}, time.Second<<4, "getbackend") result, err := future.Result() if err != nil { - panic(err.Error()) + logger.Panic().Err(err).Msg("failed to get backend") } return result.(Transporter) } @@ -674,7 +674,7 @@ func (rs *raftServer) serveChannels() { snapshot, err := rs.raftStorage.Snapshot() if err != nil { - panic(err) + logger.Panic().Err(err).Msg("failed to get snapshot") } rs.setConfState(&snapshot.Metadata.ConfState) rs.setSnapshotIndex(snapshot.Metadata.Index) @@ -969,7 +969,7 @@ func (rs *raftServer) triggerSnapshot() { if err == raftlib.ErrCompacted { return } - panic(err) + logger.Fatal().Err(err).Uint64("index", compactIndex).Msg("failed to compact raft log") } logger.Info().Uint64("index", compactIndex).Msg("compacted raftLog.at index") diff --git a/consensus/impl/raftv2/snapshot.go b/consensus/impl/raftv2/snapshot.go index 7d3a74758..e5a05a03c 100644 --- a/consensus/impl/raftv2/snapshot.go +++ b/consensus/impl/raftv2/snapshot.go @@ -100,7 +100,7 @@ func (chainsnap *ChainSnapshotter) createSnapshotData(cluster *Cluster, snapBloc snap := consensus.NewSnapshotData(members, removedMembers, snapBlock) if snap == nil { - panic("new snap failed") + logger.Panic().Msg("new snap failed") } return snap, nil diff --git a/consensus/impl/raftv2/waldb.go b/consensus/impl/raftv2/waldb.go index db8797b45..97b93802a 100644 --- a/consensus/impl/raftv2/waldb.go +++ b/consensus/impl/raftv2/waldb.go @@ -59,7 +59,8 @@ func (wal *WalDB) convertFromRaft(entries []raftpb.Entry) ([]*consensus.WalEntry case raftpb.EntryConfChange: return consensus.EntryConfChange default: - panic("not support raftpb entrytype") + logger.Panic().Str("entry", types.RaftEntryToString(entry)).Msg("invalid entry type") + panic("invalid entry type") } } @@ -100,11 +101,11 @@ func (wal *WalDB) convertFromRaft(entries []raftpb.Entry) ([]*consensus.WalEntry ) for i, entry := range entries { if blocks[i], data, err = getWalData(&entry); err != nil { - panic("entry unmarshalEntryData error") + logger.Panic().Err(err).Str("entry", types.RaftEntryToString(&entry)).Msg("entry unmarshalEntryData error") } if confChanges[i], err = getConfChange(&entry); err != nil { - panic("entry unmarshalEntryConfChange error") + logger.Panic().Err(err).Str("entry", types.RaftEntryToString(&entry)).Msg("entry unmarshalEntryConfChange error") } walents[i] = &consensus.WalEntry{ diff --git a/consensus/raftCommon.go b/consensus/raftCommon.go index 96ad44d1b..e9080a1ab 100644 --- a/consensus/raftCommon.go +++ b/consensus/raftCommon.go @@ -62,7 +62,7 @@ func (we *WalEntry) ToBytes() ([]byte, error) { var val bytes.Buffer encoder := gob.NewEncoder(&val) if err := encoder.Encode(we); err != nil { - panic("raft entry to bytes error") + logger.Panic().Err(err).Msg("raft entry to bytes error") } return val.Bytes(), nil From f0d024347304e296f223d039f8cbf5b7ca65f70d Mon Sep 17 00:00:00 2001 From: Bernardo Ramos Date: Tue, 18 Jul 2023 03:04:34 +0000 Subject: [PATCH 2/8] remove mutex from Lua states --- contract/lstate_factory.go | 42 +++++++++++++---------------------- contract/vm.c | 8 ++----- contract/vm.go | 27 +++++----------------- contract/vm.h | 2 +- contract/vm_dummy/vm_dummy.go | 6 ++--- libtool/src/luajit | 2 +- 6 files changed, 26 insertions(+), 61 deletions(-) diff --git a/contract/lstate_factory.go b/contract/lstate_factory.go index 1cf6314cf..130a39329 100644 --- a/contract/lstate_factory.go +++ b/contract/lstate_factory.go @@ -5,34 +5,25 @@ package contract #include "bignum_module.h" #include "vm.h" */ -import "C" + import ( + "C" "sync" ) -const ( - LStateDefault = iota - LStateVer3 - LStateMax -) - -var getCh [LStateMax]chan *LState -var freeCh [LStateMax]chan *LState +var getCh chan *LState +var freeCh chan *LState var once sync.Once func StartLStateFactory(num, numClosers, numCloseLimit int) { once.Do(func() { C.init_bignum() C.initViewFunction() - for i := 0; i < LStateMax; i++ { - getCh[i] = make(chan *LState, num) - freeCh[i] = make(chan *LState, num) - } + getCh = make(chan *LState, num) + freeCh = make(chan *LState, num) for i := 0; i < num; i++ { - for j := 0; j < LStateMax; j++ { - getCh[j] <- newLState(j) - } + getCh <- newLState(j) } for i := 0; i < numClosers; i++ { @@ -46,25 +37,22 @@ func statePool(numCloseLimit int) { for { select { - case state := <-freeCh[LStateDefault]: - s.append(state) - getCh[LStateDefault] <- newLState(LStateDefault) - case state := <-freeCh[LStateVer3]: + case state := <-freeCh: s.append(state) - getCh[LStateVer3] <- newLState(LStateVer3) + getCh <- newLState() } } } -func GetLState(lsType int) *LState { - state := <-getCh[lsType] - ctrLgr.Debug().Int("type", lsType).Msg("LState acquired") +func GetLState() *LState { + state := <-getCh + ctrLgr.Debug().Msg("LState acquired") return state } -func FreeLState(state *LState, lsType int) { +func FreeLState(state *LState) { if state != nil { - freeCh[lsType] <- state - ctrLgr.Debug().Int("type", lsType).Msg("LState released") + freeCh <- state + ctrLgr.Debug().Msg("LState released") } } diff --git a/contract/vm.c b/contract/vm.c index 3ed801eaf..4b5ae252c 100644 --- a/contract/vm.c +++ b/contract/vm.c @@ -67,13 +67,9 @@ static int loadLibs(lua_State *L) { return 0; } -lua_State *vm_newstate(uint8_t use_lock) { - lua_State *L = NULL; - if (use_lock) - L = luaL_newstate_lock(); - else - L = luaL_newstate(); +lua_State *vm_newstate() { int status; + lua_State *L = luaL_newstate_lock(); if (L == NULL) return NULL; status = lua_cpcall(L, loadLibs, NULL); diff --git a/contract/vm.go b/contract/vm.go index a48e44476..cfdc30bfd 100644 --- a/contract/vm.go +++ b/contract/vm.go @@ -260,14 +260,9 @@ func (s *vmContext) usedGas() uint64 { return s.gasLimit - s.remainedGas } -func newLState(lsType int) *LState { - ctrLgr.Debug().Int("type", lsType).Msg("LState created") - switch lsType { - case LStateVer3: - return C.vm_newstate(C.uchar(1)) - default: - return C.vm_newstate(C.uchar(0)) - } +func newLState() *LState { + ctrLgr.Debug().Msg("LState created") + return C.vm_newstate() } func (L *LState) close() { @@ -348,17 +343,9 @@ func newExecutor( } ctx.callDepth++ - var lState *LState - if ctx.blockInfo.ForkVersion < 3 { - lState = GetLState(LStateDefault) - } else { - // To fix intermittent consensus failure by gas consumption mismatch, - // use mutex to access total gas after chain version 3. - lState = GetLState(LStateVer3) - } ce := &executor{ code: contract, - L: lState, + L: GetLState(), ctx: ctx, } if ce.L == nil { @@ -775,11 +762,7 @@ func (ce *executor) close() { } } if ce.L != nil { - lsType := LStateDefault - if ce.ctx.blockInfo.ForkVersion >= 3 { - lsType = LStateVer3 - } - FreeLState(ce.L, lsType) + FreeLState(ce.L) } } } diff --git a/contract/vm.h b/contract/vm.h index 4c2d45039..2f5b4272c 100644 --- a/contract/vm.h +++ b/contract/vm.h @@ -13,7 +13,7 @@ extern const char *construct_name; #define FORK_V2 "_FORK_V2" #define ERR_BF_TIMEOUT "contract timeout" -lua_State *vm_newstate(uint8_t use_lock); +lua_State *vm_newstate(); void vm_closestates(lua_State *s[], int count); int vm_autoload(lua_State *L, char *func_name); void vm_remove_constructor(lua_State *L); diff --git a/contract/vm_dummy/vm_dummy.go b/contract/vm_dummy/vm_dummy.go index 4c23a339f..9960eb4b4 100644 --- a/contract/vm_dummy/vm_dummy.go +++ b/contract/vm_dummy/vm_dummy.go @@ -78,10 +78,8 @@ func SetPubNet() DummyChainOptions { // them when moving to and from public chain. flushLState := func() { for i := 0; i <= lStateMaxSize; i++ { - s := contract.GetLState(contract.LStateDefault) - contract.FreeLState(s, contract.LStateDefault) - s = contract.GetLState(contract.LStateVer3) - contract.FreeLState(s, contract.LStateVer3) + s = contract.GetLState() + contract.FreeLState(s) } } diff --git a/libtool/src/luajit b/libtool/src/luajit index c631845f3..918203102 160000 --- a/libtool/src/luajit +++ b/libtool/src/luajit @@ -1 +1 @@ -Subproject commit c631845f3a5d841395460c2b082c3db6f8214fe9 +Subproject commit 91820310225af47bdf52e7acb278b78db69ab5a5 From 770106e7ac1d61e78ac44f981b8f4dae05ebd6f2 Mon Sep 17 00:00:00 2001 From: Bernardo Ramos Date: Tue, 18 Jul 2023 03:18:05 +0000 Subject: [PATCH 3/8] fix build --- contract/lstate_factory.go | 5 ++--- contract/vm.c | 2 +- contract/vm_dummy/vm_dummy.go | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/contract/lstate_factory.go b/contract/lstate_factory.go index 130a39329..8d84c357a 100644 --- a/contract/lstate_factory.go +++ b/contract/lstate_factory.go @@ -5,9 +5,8 @@ package contract #include "bignum_module.h" #include "vm.h" */ - +import "C" import ( - "C" "sync" ) @@ -23,7 +22,7 @@ func StartLStateFactory(num, numClosers, numCloseLimit int) { freeCh = make(chan *LState, num) for i := 0; i < num; i++ { - getCh <- newLState(j) + getCh <- newLState() } for i := 0; i < numClosers; i++ { diff --git a/contract/vm.c b/contract/vm.c index 4b5ae252c..449c9a6b8 100644 --- a/contract/vm.c +++ b/contract/vm.c @@ -69,7 +69,7 @@ static int loadLibs(lua_State *L) { lua_State *vm_newstate() { int status; - lua_State *L = luaL_newstate_lock(); + lua_State *L = luaL_newstate(); if (L == NULL) return NULL; status = lua_cpcall(L, loadLibs, NULL); diff --git a/contract/vm_dummy/vm_dummy.go b/contract/vm_dummy/vm_dummy.go index 9960eb4b4..7280954aa 100644 --- a/contract/vm_dummy/vm_dummy.go +++ b/contract/vm_dummy/vm_dummy.go @@ -78,7 +78,7 @@ func SetPubNet() DummyChainOptions { // them when moving to and from public chain. flushLState := func() { for i := 0; i <= lStateMaxSize; i++ { - s = contract.GetLState() + s := contract.GetLState() contract.FreeLState(s) } } From ba241bb8076001f6d6d7cbf0778d4e2d0a3a2f36 Mon Sep 17 00:00:00 2001 From: Bernardo Ramos Date: Tue, 18 Jul 2023 03:47:10 +0000 Subject: [PATCH 4/8] fix gas on BF test --- contract/vm_dummy/vm_dummy_test.go | 2 +- tests/test-gas-bf.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contract/vm_dummy/vm_dummy_test.go b/contract/vm_dummy/vm_dummy_test.go index ec7ad7cf3..3cf3b2deb 100644 --- a/contract/vm_dummy/vm_dummy_test.go +++ b/contract/vm_dummy/vm_dummy_test.go @@ -3060,7 +3060,7 @@ func TestGasBF(t *testing.T) { err = expectGas(string(code), 0, `"main"`, ``, 47456244, SetHardForkVersion(2)) assert.NoError(t, err) - err = expectGas(string(code), 0, `"main"`, ``, 47456046, SetHardForkVersion(3)) + err = expectGas(string(code), 0, `"main"`, ``, 47456460, SetHardForkVersion(3)) assert.NoError(t, err) } diff --git a/tests/test-gas-bf.sh b/tests/test-gas-bf.sh index ef16ba16c..02b62b889 100755 --- a/tests/test-gas-bf.sh +++ b/tests/test-gas-bf.sh @@ -36,7 +36,7 @@ assert_equals "$status" "SUCCESS" #assert_equals "$ret" "{}" if [ "$fork_version" -eq "3" ]; then - assert_equals "$gasUsed" "47456046" + assert_equals "$gasUsed" "47456460" else assert_equals "$gasUsed" "47456244" fi From 03dfc5d00e7ce1c534f74a77aa29757a802a2872 Mon Sep 17 00:00:00 2001 From: Bernardo Ramos Date: Thu, 27 Jul 2023 04:29:30 +0000 Subject: [PATCH 5/8] load lua state according to hardfork version --- contract/lstate_factory.go | 10 ++++++++++ contract/vm.c | 4 ++-- contract/vm.go | 10 +++++++++- contract/vm.h | 2 +- contract/vm_dummy/vm_dummy.go | 10 ++-------- contract/vm_dummy/vm_dummy_test.go | 2 +- libtool/src/luajit | 2 +- tests/test-gas-bf.sh | 2 +- 8 files changed, 27 insertions(+), 15 deletions(-) diff --git a/contract/lstate_factory.go b/contract/lstate_factory.go index 8d84c357a..880efafb4 100644 --- a/contract/lstate_factory.go +++ b/contract/lstate_factory.go @@ -10,6 +10,7 @@ import ( "sync" ) +var maxLStates int var getCh chan *LState var freeCh chan *LState var once sync.Once @@ -18,6 +19,8 @@ func StartLStateFactory(num, numClosers, numCloseLimit int) { once.Do(func() { C.init_bignum() C.initViewFunction() + + maxLStates = num getCh = make(chan *LState, num) freeCh = make(chan *LState, num) @@ -55,3 +58,10 @@ func FreeLState(state *LState) { ctrLgr.Debug().Msg("LState released") } } + +func FlushLStates() { + for i := 0; i < maxLStates; i++ { + s := GetLState() + FreeLState(s) + } +} diff --git a/contract/vm.c b/contract/vm.c index 449c9a6b8..b46296b5d 100644 --- a/contract/vm.c +++ b/contract/vm.c @@ -67,9 +67,9 @@ static int loadLibs(lua_State *L) { return 0; } -lua_State *vm_newstate() { +lua_State *vm_newstate(int hardfork_version) { int status; - lua_State *L = luaL_newstate(); + lua_State *L = luaL_newstate(hardfork_version); if (L == NULL) return NULL; status = lua_cpcall(L, loadLibs, NULL); diff --git a/contract/vm.go b/contract/vm.go index cfdc30bfd..68ad5ec35 100644 --- a/contract/vm.go +++ b/contract/vm.go @@ -60,6 +60,7 @@ var ( contexts []*vmContext lastQueryIndex int querySync sync.Mutex + currentForkVersion int32 ) type ChainAccessor interface { @@ -262,7 +263,7 @@ func (s *vmContext) usedGas() uint64 { func newLState() *LState { ctrLgr.Debug().Msg("LState created") - return C.vm_newstate() + return C.vm_newstate(C.int(currentForkVersion)) } func (L *LState) close() { @@ -333,6 +334,13 @@ func newExecutor( ctrState *state.ContractState, ) *executor { + if ctx.blockInfo.ForkVersion != currentForkVersion { + // make the StatePool generate new LStates + // this global variable is used by the pool goroutines + currentForkVersion = ctx.blockInfo.ForkVersion + FlushLStates() + } + if ctx.callDepth > MaxCallDepth(ctx.blockInfo.ForkVersion) { ce := &executor{ code: contract, diff --git a/contract/vm.h b/contract/vm.h index 2f5b4272c..e32341a68 100644 --- a/contract/vm.h +++ b/contract/vm.h @@ -13,7 +13,7 @@ extern const char *construct_name; #define FORK_V2 "_FORK_V2" #define ERR_BF_TIMEOUT "contract timeout" -lua_State *vm_newstate(); +lua_State *vm_newstate(int hardfork_version); void vm_closestates(lua_State *s[], int count); int vm_autoload(lua_State *L, char *func_name); void vm_remove_constructor(lua_State *L); diff --git a/contract/vm_dummy/vm_dummy.go b/contract/vm_dummy/vm_dummy.go index 7280954aa..e29790402 100644 --- a/contract/vm_dummy/vm_dummy.go +++ b/contract/vm_dummy/vm_dummy.go @@ -76,21 +76,15 @@ func SetPubNet() DummyChainOptions { // private chains have the db module and public ones don't. // this is why we need to flush all Lua states and recreate // them when moving to and from public chain. - flushLState := func() { - for i := 0; i <= lStateMaxSize; i++ { - s := contract.GetLState() - contract.FreeLState(s) - } - } contract.PubNet = true fee.DisableZeroFee() - flushLState() + contract.FlushLStates() dc.clearLState = func() { contract.PubNet = false fee.EnableZeroFee() - flushLState() + contract.FlushLStates() } } } diff --git a/contract/vm_dummy/vm_dummy_test.go b/contract/vm_dummy/vm_dummy_test.go index 3cf3b2deb..ec7ad7cf3 100644 --- a/contract/vm_dummy/vm_dummy_test.go +++ b/contract/vm_dummy/vm_dummy_test.go @@ -3060,7 +3060,7 @@ func TestGasBF(t *testing.T) { err = expectGas(string(code), 0, `"main"`, ``, 47456244, SetHardForkVersion(2)) assert.NoError(t, err) - err = expectGas(string(code), 0, `"main"`, ``, 47456460, SetHardForkVersion(3)) + err = expectGas(string(code), 0, `"main"`, ``, 47456046, SetHardForkVersion(3)) assert.NoError(t, err) } diff --git a/libtool/src/luajit b/libtool/src/luajit index 918203102..530c749d5 160000 --- a/libtool/src/luajit +++ b/libtool/src/luajit @@ -1 +1 @@ -Subproject commit 91820310225af47bdf52e7acb278b78db69ab5a5 +Subproject commit 530c749d5403a3f453c47803d45996406d29d33b diff --git a/tests/test-gas-bf.sh b/tests/test-gas-bf.sh index 02b62b889..ef16ba16c 100755 --- a/tests/test-gas-bf.sh +++ b/tests/test-gas-bf.sh @@ -36,7 +36,7 @@ assert_equals "$status" "SUCCESS" #assert_equals "$ret" "{}" if [ "$fork_version" -eq "3" ]; then - assert_equals "$gasUsed" "47456460" + assert_equals "$gasUsed" "47456046" else assert_equals "$gasUsed" "47456244" fi From b98769a13737f39dcc2c59ae20342b457a713d6b Mon Sep 17 00:00:00 2001 From: Bernardo Ramos Date: Thu, 27 Jul 2023 04:40:16 +0000 Subject: [PATCH 6/8] fix build aergoluac --- cmd/aergoluac/util/compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/aergoluac/util/compile.c b/cmd/aergoluac/util/compile.c index b70b66668..0f645b0b0 100644 --- a/cmd/aergoluac/util/compile.c +++ b/cmd/aergoluac/util/compile.c @@ -8,7 +8,7 @@ #include "_cgo_export.h" lua_State *luac_vm_newstate() { - lua_State *L = luaL_newstate(); + lua_State *L = luaL_newstate(3); if (L == NULL) { return NULL; } From c94e4b668e1fbbd0fcc9b954e2548a31358baa34 Mon Sep 17 00:00:00 2001 From: Bernardo Ramos Date: Thu, 27 Jul 2023 04:55:06 +0000 Subject: [PATCH 7/8] rename variable [skip ci] --- contract/lstate_factory.go | 10 +++++----- contract/vm.go | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/contract/lstate_factory.go b/contract/lstate_factory.go index 880efafb4..c26a16811 100644 --- a/contract/lstate_factory.go +++ b/contract/lstate_factory.go @@ -15,16 +15,16 @@ var getCh chan *LState var freeCh chan *LState var once sync.Once -func StartLStateFactory(num, numClosers, numCloseLimit int) { +func StartLStateFactory(numLStates, numClosers, numCloseLimit int) { once.Do(func() { C.init_bignum() C.initViewFunction() - maxLStates = num - getCh = make(chan *LState, num) - freeCh = make(chan *LState, num) + maxLStates = numLStates + getCh = make(chan *LState, numLStates) + freeCh = make(chan *LState, numLStates) - for i := 0; i < num; i++ { + for i := 0; i < numLStates; i++ { getCh <- newLState() } diff --git a/contract/vm.go b/contract/vm.go index 68ad5ec35..02a51b405 100644 --- a/contract/vm.go +++ b/contract/vm.go @@ -335,8 +335,8 @@ func newExecutor( ) *executor { if ctx.blockInfo.ForkVersion != currentForkVersion { - // make the StatePool generate new LStates - // this global variable is used by the pool goroutines + // force the StatePool to regenerate the LStates + // using the new hardfork version currentForkVersion = ctx.blockInfo.ForkVersion FlushLStates() } From f28617aec367e4c9baae5a5353a07082cb43536a Mon Sep 17 00:00:00 2001 From: Hayarobi Park Date: Tue, 11 Jul 2023 16:35:08 +0900 Subject: [PATCH 8/8] Change package path to follow versionng policy of go module --- CMakeLists.txt | 6 +- account/accountservice.go | 14 +- account/accountservice_test.go | 6 +- account/key/aergo_storage.go | 4 +- account/key/aergo_storage_test.go | 2 +- account/key/badgerdb.go | 2 +- account/key/badgerdb_test.go | 2 +- account/key/crypto/address.go | 2 +- account/key/crypto/address_test.go | 2 +- account/key/crypto/v1strategy.go | 2 +- account/key/sign.go | 2 +- account/key/store.go | 4 +- account/key/store_test.go | 4 +- account/signer.go | 4 +- aergo-protobuf | 2 +- chain/blockvalidator.go | 8 +- chain/chainanchor.go | 4 +- chain/chaindb.go | 10 +- chain/chaindbForRaft.go | 4 +- chain/chainhandle.go | 16 +- chain/chainhandle_test.go | 12 +- chain/chainservice.go | 26 +- chain/chainservice_test.go | 8 +- chain/chainverifier.go | 8 +- chain/common.go | 6 +- chain/governance.go | 14 +- chain/orphanpool.go | 4 +- chain/orphanpool_test.go | 2 +- chain/recover.go | 4 +- chain/reorg.go | 12 +- chain/signVerifier.go | 14 +- chain/signverifier_test.go | 6 +- chain/stat.go | 2 +- chain/stat_test.go | 2 +- chain/stubchain.go | 4 +- chain/subcomponent.go | 2 +- cmd/aergocli/aergocli.go | 2 +- cmd/aergocli/cmd/accounts.go | 4 +- cmd/aergocli/cmd/accounts_test.go | 2 +- cmd/aergocli/cmd/blockchain.go | 4 +- cmd/aergocli/cmd/blockchain_test.go | 4 +- cmd/aergocli/cmd/chaininfo.go | 4 +- cmd/aergocli/cmd/chainstat.go | 2 +- cmd/aergocli/cmd/committx.go | 4 +- cmd/aergocli/cmd/committx_test.go | 4 +- cmd/aergocli/cmd/contract.go | 24 +- cmd/aergocli/cmd/enterprise.go | 10 +- cmd/aergocli/cmd/enterprise_test.go | 2 +- cmd/aergocli/cmd/event.go | 4 +- cmd/aergocli/cmd/getblock.go | 4 +- cmd/aergocli/cmd/getconsensusinfo.go | 2 +- cmd/aergocli/cmd/getpeers.go | 4 +- cmd/aergocli/cmd/getstate.go | 4 +- cmd/aergocli/cmd/gettx.go | 4 +- cmd/aergocli/cmd/keygen.go | 8 +- cmd/aergocli/cmd/listblocks.go | 4 +- cmd/aergocli/cmd/mempool.go | 4 +- cmd/aergocli/cmd/metric.go | 4 +- cmd/aergocli/cmd/mock_types/mock_types.go | 4 +- cmd/aergocli/cmd/name.go | 4 +- cmd/aergocli/cmd/nodestate.go | 2 +- cmd/aergocli/cmd/receipt.go | 4 +- cmd/aergocli/cmd/root.go | 4 +- cmd/aergocli/cmd/root_test.go | 4 +- cmd/aergocli/cmd/sendtx.go | 4 +- cmd/aergocli/cmd/sendtx_test.go | 4 +- cmd/aergocli/cmd/serverinfo.go | 2 +- cmd/aergocli/cmd/signtx.go | 8 +- cmd/aergocli/cmd/signtx_test.go | 6 +- cmd/aergocli/cmd/stake.go | 4 +- cmd/aergocli/cmd/vote.go | 4 +- cmd/aergocli/util/base58addr.go | 4 +- cmd/aergocli/util/base58addr_test.go | 2 +- cmd/aergocli/util/base64ToHex.go | 2 +- cmd/aergocli/util/convChaininfo.go | 4 +- cmd/aergocli/util/convTx.go | 2 +- cmd/aergocli/util/convTx_test.go | 2 +- cmd/aergocli/util/grpccommon.go | 4 +- cmd/aergocli/util/unit_test.go | 2 +- cmd/aergoluac/main.go | 2 +- cmd/aergoluac/util/luac_util.go | 2 +- cmd/aergosvr/aergosvr.go | 26 +- cmd/aergosvr/dumper.go | 8 +- cmd/aergosvr/init.go | 8 +- cmd/brick/brick.go | 4 +- cmd/brick/context/context.go | 2 +- cmd/brick/exec/batch.go | 4 +- cmd/brick/exec/callContract.go | 6 +- cmd/brick/exec/debug.go | 6 +- cmd/brick/exec/deployContract.go | 6 +- cmd/brick/exec/exec.go | 4 +- cmd/brick/exec/exit.go | 2 +- cmd/brick/exec/forward.go | 4 +- cmd/brick/exec/getstateAccount.go | 6 +- cmd/brick/exec/hardfork.go | 4 +- cmd/brick/exec/help.go | 4 +- cmd/brick/exec/injectAccount.go | 6 +- cmd/brick/exec/queryContract.go | 4 +- cmd/brick/exec/resetChain.go | 4 +- cmd/brick/exec/search.go | 2 +- cmd/brick/exec/sendCoin.go | 6 +- cmd/brick/exec/timestamp.go | 4 +- cmd/brick/exec/undoCommit.go | 4 +- cmd/colaris/cmd/blacklist.go | 4 +- cmd/colaris/cmd/common.go | 4 +- cmd/colaris/cmd/config.go | 2 +- cmd/colaris/cmd/current.go | 4 +- cmd/colaris/cmd/metric.go | 4 +- cmd/colaris/cmd/nodestate.go | 2 +- cmd/colaris/colaris.go | 2 +- cmd/polaris/polaris.go | 12 +- cmd/polaris/polaris_test.go | 4 +- config/config.go | 2 +- config/hardfork.go | 2 +- config/hardfork_gen.go | 2 +- config/hardfork_gen/main.go | 4 +- consensus/chain/block.go | 14 +- consensus/chain/gathertx_test.go | 4 +- consensus/chain/tx.go | 14 +- consensus/consensus.go | 2 +- consensus/impl/dpos/blockfactory.go | 20 +- consensus/impl/dpos/bp/cluster.go | 10 +- consensus/impl/dpos/dpos.go | 20 +- consensus/impl/dpos/dpos_test.go | 4 +- consensus/impl/dpos/lib.go | 8 +- consensus/impl/dpos/lib_test.go | 4 +- consensus/impl/dpos/slot/slot.go | 2 +- consensus/impl/dpos/status.go | 8 +- consensus/impl/impl.go | 22 +- consensus/impl/raftv2/blockfactory.go | 24 +- consensus/impl/raftv2/cluster.go | 12 +- consensus/impl/raftv2/cluster_test.go | 6 +- consensus/impl/raftv2/config.go | 12 +- consensus/impl/raftv2/p2p.go | 6 +- consensus/impl/raftv2/raftserver.go | 12 +- consensus/impl/raftv2/snapshot.go | 14 +- consensus/impl/raftv2/transport.go | 2 +- consensus/impl/raftv2/waldb.go | 4 +- consensus/impl/sbp/sbp.go | 20 +- consensus/raftCommon.go | 4 +- contract/contract.go | 6 +- contract/enterprise/admin.go | 4 +- contract/enterprise/changecluster.go | 2 +- contract/enterprise/config.go | 4 +- contract/enterprise/config_test.go | 4 +- contract/enterprise/execute.go | 6 +- contract/enterprise/execute_test.go | 6 +- contract/enterprise/validate.go | 6 +- contract/hook_dbg.go | 2 +- contract/measure/main.go | 4 +- contract/name/execute.go | 6 +- contract/name/execute_test.go | 4 +- contract/name/name.go | 4 +- contract/name/name_test.go | 4 +- contract/statesql.go | 6 +- contract/system/execute.go | 4 +- contract/system/execute_test.go | 4 +- contract/system/param.go | 4 +- contract/system/proposal.go | 2 +- contract/system/proposal_test.go | 6 +- contract/system/staking.go | 4 +- contract/system/staking_test.go | 2 +- contract/system/validation.go | 4 +- contract/system/vote.go | 6 +- contract/system/vote_test.go | 4 +- contract/system/voteresult.go | 6 +- contract/system/vprt.go | 6 +- contract/system/vprt_test.go | 6 +- contract/vm.go | 10 +- contract/vm_callback.go | 14 +- contract/vm_dummy/vm_dummy.go | 26 +- contract/vm_dummy/vm_dummy_dbg.go | 4 +- contract/vm_dummy/vm_dummy_release.go | 4 +- contract/vm_dummy/vm_dummy_test.go | 476 ++++++++++---------- docs/ReleaseNotes.md | 17 + examples/component/main.go | 8 +- examples/component/server/server.go | 4 +- examples/component/service/service.go | 4 +- go.mod | 2 +- mempool/mempool.go | 26 +- mempool/mempool2_test.go | 2 +- mempool/mempool_test.go | 8 +- mempool/stub.go | 2 +- mempool/txlist.go | 4 +- mempool/txlist_test.go | 6 +- mempool/txverifier.go | 6 +- message/accountmsg.go | 2 +- message/blockchainmsg.go | 2 +- message/mempoolmsg.go | 2 +- message/messagemock/helper.go | 2 +- message/msghelper.go | 2 +- message/p2pmsg.go | 2 +- message/pmapmsg.go | 2 +- message/restmsg.go | 2 +- message/syncermsg.go | 2 +- p2p/actorwork.go | 10 +- p2p/actorwork_test.go | 10 +- p2p/ancestorreceiver.go | 6 +- p2p/ancestorreceiver_test.go | 8 +- p2p/blkreceiver.go | 8 +- p2p/blkreceiver_test.go | 10 +- p2p/certmanager.go | 10 +- p2p/certmanager_test.go | 10 +- p2p/const_test.go | 8 +- p2p/handshakev2.go | 6 +- p2p/handshakev2_test.go | 6 +- p2p/hashbynoreceiver.go | 6 +- p2p/hashbynoreceiver_test.go | 8 +- p2p/hashreceiver.go | 6 +- p2p/hashreceiver_test.go | 12 +- p2p/list/dummymanager.go | 4 +- p2p/list/listmanager.go | 8 +- p2p/list/listmanager_test.go | 8 +- p2p/metric/exponentmetric.go | 2 +- p2p/metric/metricsman.go | 4 +- p2p/metric/metricsman_test.go | 4 +- p2p/metric/peermetric.go | 4 +- p2p/metric/peermetric_test.go | 2 +- p2p/mofactory.go | 6 +- p2p/mofactory_test.go | 4 +- p2p/msgorder.go | 12 +- p2p/msgorder_test.go | 6 +- p2p/p2p.go | 30 +- p2p/p2p_test.go | 12 +- p2p/p2pcommon/actorservice.go | 2 +- p2p/p2pcommon/certificate.go | 4 +- p2p/p2pcommon/consts.go | 2 +- p2p/p2pcommon/handshake.go | 2 +- p2p/p2pcommon/internalmsg.go | 2 +- p2p/p2pcommon/internalservice.go | 4 +- p2p/p2pcommon/listmanager.go | 2 +- p2p/p2pcommon/message.go | 2 +- p2p/p2pcommon/others.go | 4 +- p2p/p2pcommon/peermanager.go | 4 +- p2p/p2pcommon/peermeta.go | 2 +- p2p/p2pcommon/peermeta_test.go | 4 +- p2p/p2pcommon/peerrole.go | 2 +- p2p/p2pcommon/pool.go | 2 +- p2p/p2pcommon/remoteinfo.go | 2 +- p2p/p2pcommon/remotepeer.go | 2 +- p2p/p2pcommon/temptype.go | 6 +- p2p/p2pcommon/transport.go | 4 +- p2p/p2pkey/nodekey.go | 10 +- p2p/p2pmock/mock_actorservice.go | 2 +- p2p/p2pmock/mock_certificate.go | 4 +- p2p/p2pmock/mock_chainaccessor.go | 4 +- p2p/p2pmock/mock_consensus.go | 6 +- p2p/p2pmock/mock_handshake.go | 4 +- p2p/p2pmock/mock_internalservice.go | 6 +- p2p/p2pmock/mock_listmanager.go | 2 +- p2p/p2pmock/mock_message.go | 4 +- p2p/p2pmock/mock_metricsman.go | 4 +- p2p/p2pmock/mock_msgio.go | 2 +- p2p/p2pmock/mock_msgorder.go | 4 +- p2p/p2pmock/mock_networktransport.go | 6 +- p2p/p2pmock/mock_peerfinder.go | 4 +- p2p/p2pmock/mock_peermanager.go | 6 +- p2p/p2pmock/mock_peerrole.go | 4 +- p2p/p2pmock/mock_protobuf.go | 4 +- p2p/p2pmock/mock_remotepeer.go | 4 +- p2p/p2pmock/mock_syncmanager.go | 6 +- p2p/p2pmock/mock_txnotice.go | 2 +- p2p/p2pmock/readme.txt | 8 +- p2p/p2putil/certificate.go | 6 +- p2p/p2putil/certificate_test.go | 6 +- p2p/p2putil/chan_test.go | 4 +- p2p/p2putil/libp2putil.go | 4 +- p2p/p2putil/libp2putil_test.go | 6 +- p2p/p2putil/loggingutil.go | 4 +- p2p/p2putil/loggingutil_test.go | 4 +- p2p/p2putil/peerutil.go | 4 +- p2p/p2putil/peerutil_test.go | 4 +- p2p/p2putil/protobuf.go | 2 +- p2p/p2putil/protobuf_test.go | 4 +- p2p/p2putil/util.go | 6 +- p2p/p2putil/util_test.go | 4 +- p2p/peerfinder.go | 8 +- p2p/peerfinder_test.go | 8 +- p2p/peermanager.go | 14 +- p2p/peermanager_test.go | 14 +- p2p/pi.go | 12 +- p2p/pi_test.go | 10 +- p2p/raftsupport/clusterreceiver.go | 6 +- p2p/raftsupport/clusterreceiver_test.go | 8 +- p2p/raftsupport/concclusterreceiver.go | 8 +- p2p/raftsupport/concclusterreceiver_test.go | 10 +- p2p/raftsupport/logutil.go | 2 +- p2p/raftsupport/rafttransport.go | 10 +- p2p/raftsupport/rafttransport_test.go | 10 +- p2p/raftsupport/snapshot.go | 2 +- p2p/raftsupport/snapshotreceiver.go | 8 +- p2p/raftsupport/snapshotreceiver_test.go | 2 +- p2p/raftsupport/snapshotsender.go | 8 +- p2p/raftsupport/snapshotsender_test.go | 6 +- p2p/raftsupport/status.go | 4 +- p2p/raftsupport/status_test.go | 2 +- p2p/remotepeer.go | 8 +- p2p/remotepeer_test.go | 8 +- p2p/rolemanager.go | 8 +- p2p/rolemanager_test.go | 8 +- p2p/signature.go | 4 +- p2p/signature_test.go | 4 +- p2p/subproto/addrs.go | 8 +- p2p/subproto/addrs_test.go | 6 +- p2p/subproto/advice.go | 4 +- p2p/subproto/base.go | 2 +- p2p/subproto/block.go | 10 +- p2p/subproto/blockhash.go | 6 +- p2p/subproto/blockhash_test.go | 10 +- p2p/subproto/bp.go | 10 +- p2p/subproto/bp_test.go | 10 +- p2p/subproto/cert.go | 6 +- p2p/subproto/cert_test.go | 8 +- p2p/subproto/getblock.go | 8 +- p2p/subproto/getblock_test.go | 10 +- p2p/subproto/getcluster.go | 8 +- p2p/subproto/ping.go | 6 +- p2p/subproto/ping_test.go | 8 +- p2p/subproto/raftstub.go | 8 +- p2p/subproto/raftwrap.go | 8 +- p2p/subproto/tx.go | 10 +- p2p/subproto/tx_test.go | 8 +- p2p/syncmanager.go | 12 +- p2p/syncmanager_test.go | 10 +- p2p/synctx.go | 10 +- p2p/synctx_test.go | 12 +- p2p/testhelper_test.go | 4 +- p2p/transport/networktransport.go | 12 +- p2p/transport/networktransport_test.go | 14 +- p2p/txreceiver.go | 10 +- p2p/txreceiver_test.go | 8 +- p2p/v030/v030handshake.go | 8 +- p2p/v030/v030handshake_test.go | 12 +- p2p/v030/v030io.go | 2 +- p2p/v030/v030io_test.go | 6 +- p2p/v030/v032handshake.go | 8 +- p2p/v030/v032handshake_test.go | 8 +- p2p/v030/v033handshake.go | 10 +- p2p/v030/v033handshake_test.go | 8 +- p2p/v200/v200handshake.go | 14 +- p2p/v200/v200handshake_test.go | 12 +- p2p/versionmanager.go | 10 +- p2p/versionmanager_test.go | 8 +- p2p/waitpeermanager.go | 6 +- p2p/waitpeermanager_test.go | 12 +- pkg/trie/trie_test.go | 2 +- polaris/client/polarisconnect.go | 18 +- polaris/client/polarisconnect_test.go | 14 +- polaris/common/consts.go | 2 +- polaris/common/message.go | 2 +- polaris/common/polarisprotocol.go | 2 +- polaris/server/genesisreader.go | 2 +- polaris/server/genesisreader_test.go | 2 +- polaris/server/healthcheck.go | 4 +- polaris/server/healthcheck_test.go | 2 +- polaris/server/listmanager.go | 4 +- polaris/server/listmanager_test.go | 4 +- polaris/server/litentcontainer.go | 20 +- polaris/server/mapservice.go | 16 +- polaris/server/mapservice_test.go | 14 +- polaris/server/peerstate.go | 10 +- polaris/server/peerstate_test.go | 10 +- polaris/server/prpc.go | 10 +- rpc/ActorService_test.go | 2 +- rpc/Helper_test.go | 2 +- rpc/actor_test.go | 2 +- rpc/admin.go | 8 +- rpc/authentication.go | 2 +- rpc/grpcserver.go | 16 +- rpc/grpcserver_test.go | 14 +- rpc/rpc.go | 20 +- rpc/rpcstream.go | 2 +- rpc/rpcstream_test.go | 4 +- rpc/txputter.go | 8 +- rpc/txputter_test.go | 8 +- state/blockstate.go | 4 +- state/chainstatedb.go | 6 +- state/contract.go | 4 +- state/contract_test.go | 2 +- state/statebuffer.go | 6 +- state/statebuffer_test.go | 2 +- state/statedata.go | 2 +- state/statedb.go | 8 +- state/statedb_test.go | 2 +- state/storage.go | 8 +- state/storage_test.go | 2 +- syncer/blockfetcher.go | 10 +- syncer/blockfetcher_test.go | 4 +- syncer/blockprocessor.go | 12 +- syncer/finder.go | 12 +- syncer/finder_test.go | 4 +- syncer/hashfetcher.go | 8 +- syncer/hashfetcher_test.go | 6 +- syncer/stubsyncer.go | 10 +- syncer/stubsyncerchain.go | 6 +- syncer/syncerservice.go | 12 +- syncer/syncerservice_test.go | 4 +- tools/genesisdump/main.go | 2 +- tools/mpdumpdiag/main.go | 4 +- types/blockchain.go | 6 +- types/genesis.go | 2 +- types/genesis_test.go | 2 +- types/logging.go | 2 +- types/p2p_test.go | 2 +- types/p2plogging.go | 2 +- types/p2ptypes.go | 2 +- types/p2ptypes_test.go | 2 +- types/receipt.go | 4 +- types/state.go | 4 +- types/transaction.go | 2 +- 410 files changed, 1506 insertions(+), 1489 deletions(-) create mode 100644 docs/ReleaseNotes.md diff --git a/CMakeLists.txt b/CMakeLists.txt index 062afc64e..e8002c02e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,7 @@ endif() add_custom_target(build ALL DEPENDS aergocli aergosvr aergoluac brick) -add_custom_target(aergocli GO111MODULE=on GOBIN=${BIN_DIR} go install ${GCFLAGS} -ldflags \"-X github.com/aergoio/aergo/cmd/aergocli/cmd.githash=`git describe --tags`\" ./cmd/aergocli/... +add_custom_target(aergocli GO111MODULE=on GOBIN=${BIN_DIR} go install ${GCFLAGS} -ldflags \"-X github.com/aergoio/aergo/v2/cmd/aergocli/cmd.githash=`git describe --tags`\" ./cmd/aergocli/... WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} DEPENDS libtool) @@ -28,14 +28,14 @@ add_custom_target(aergosvr GO111MODULE=on GOBIN=${BIN_DIR} go install ${GCFLAGS} add_custom_target(polaris GO111MODULE=on GOBIN=${BIN_DIR} go install ${GCFLAGS} -ldflags \"-X main.githash=`git describe --tags`\" ./cmd/polaris/... WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) -add_custom_target(colaris GO111MODULE=on GOBIN=${BIN_DIR} go install ${GCFLAGS} -ldflags \"-X github.com/aergoio/aergo/cmd/colaris/cmd.githash=`git describe --tags`\" ./cmd/colaris/... +add_custom_target(colaris GO111MODULE=on GOBIN=${BIN_DIR} go install ${GCFLAGS} -ldflags \"-X github.com/aergoio/aergo/v2/cmd/colaris/cmd.githash=`git describe --tags`\" ./cmd/colaris/... WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) add_custom_target(aergoluac GO111MODULE=on GOBIN=${BIN_DIR} go install ${GCFLAGS} -ldflags \"-X main.githash=`git describe --tags`\" ./cmd/aergoluac/... WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} DEPENDS libtool) -add_custom_target(brick GO111MODULE=on GOBIN=${BIN_DIR} go install ${GCFLAGS} ${GFLAG} -ldflags \"-X 'github.com/aergoio/aergo/cmd/brick/context.GitHash=`git describe --tags`' +add_custom_target(brick GO111MODULE=on GOBIN=${BIN_DIR} go install ${GCFLAGS} ${GFLAG} -ldflags \"-X 'github.com/aergoio/aergo/v2/cmd/brick/context.GitHash=`git describe --tags`' -X 'github.com/aergoio/aergo-lib/log.defaultConfStr=`cat ./cmd/brick/arglog.toml`'\" ./cmd/brick/... WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} DEPENDS libtool) diff --git a/account/accountservice.go b/account/accountservice.go index 0de718808..c0c7feff7 100644 --- a/account/accountservice.go +++ b/account/accountservice.go @@ -5,13 +5,13 @@ import ( "github.com/aergoio/aergo-actor/actor" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/account/key" - cfg "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/contract/name" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/account/key" + cfg "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/contract/name" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" ) type AccountService struct { diff --git a/account/accountservice_test.go b/account/accountservice_test.go index 25ec18549..a5d78cbf6 100644 --- a/account/accountservice_test.go +++ b/account/accountservice_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/aergoio/aergo-lib/db" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" "github.com/stretchr/testify/assert" ) diff --git a/account/key/aergo_storage.go b/account/key/aergo_storage.go index c6a967227..e17336f6e 100644 --- a/account/key/aergo_storage.go +++ b/account/key/aergo_storage.go @@ -15,8 +15,8 @@ import ( "strings" "sync" - crypto "github.com/aergoio/aergo/account/key/crypto" - "github.com/aergoio/aergo/types" + crypto "github.com/aergoio/aergo/v2/account/key/crypto" + "github.com/aergoio/aergo/v2/types" ) var ( diff --git a/account/key/aergo_storage_test.go b/account/key/aergo_storage_test.go index 764c00f47..c4e0b2792 100644 --- a/account/key/aergo_storage_test.go +++ b/account/key/aergo_storage_test.go @@ -11,7 +11,7 @@ import ( "reflect" "testing" - crypto "github.com/aergoio/aergo/account/key/crypto" + crypto "github.com/aergoio/aergo/v2/account/key/crypto" "github.com/btcsuite/btcd/btcec" "github.com/stretchr/testify/assert" ) diff --git a/account/key/badgerdb.go b/account/key/badgerdb.go index 2d3aa0f99..5256fe44b 100644 --- a/account/key/badgerdb.go +++ b/account/key/badgerdb.go @@ -13,7 +13,7 @@ import ( "sync" "github.com/aergoio/aergo-lib/db" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" "github.com/btcsuite/btcd/btcec" ) diff --git a/account/key/badgerdb_test.go b/account/key/badgerdb_test.go index 448b21be5..6ca49925f 100644 --- a/account/key/badgerdb_test.go +++ b/account/key/badgerdb_test.go @@ -11,7 +11,7 @@ import ( "reflect" "testing" - crypto "github.com/aergoio/aergo/account/key/crypto" + crypto "github.com/aergoio/aergo/v2/account/key/crypto" "github.com/btcsuite/btcd/btcec" "github.com/stretchr/testify/assert" ) diff --git a/account/key/crypto/address.go b/account/key/crypto/address.go index 9b38bfe86..28d23e641 100644 --- a/account/key/crypto/address.go +++ b/account/key/crypto/address.go @@ -10,7 +10,7 @@ import ( "crypto/ecdsa" "encoding/binary" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" ) // GenerateAddress calculates the raw (not-encoded) address for a private key. diff --git a/account/key/crypto/address_test.go b/account/key/crypto/address_test.go index 71432e3d6..6cce535f4 100644 --- a/account/key/crypto/address_test.go +++ b/account/key/crypto/address_test.go @@ -8,7 +8,7 @@ package key import ( "testing" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" "github.com/btcsuite/btcd/btcec" "github.com/stretchr/testify/assert" ) diff --git a/account/key/crypto/v1strategy.go b/account/key/crypto/v1strategy.go index 36cd7bb3a..6e6c2d9e4 100644 --- a/account/key/crypto/v1strategy.go +++ b/account/key/crypto/v1strategy.go @@ -16,7 +16,7 @@ import ( "io" "reflect" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" "github.com/btcsuite/btcd/btcec" "golang.org/x/crypto/scrypt" ) diff --git a/account/key/sign.go b/account/key/sign.go index 74366c608..42bcdd9c8 100644 --- a/account/key/sign.go +++ b/account/key/sign.go @@ -8,7 +8,7 @@ package key import ( "encoding/binary" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" "github.com/btcsuite/btcd/btcec" sha256 "github.com/minio/sha256-simd" ) diff --git a/account/key/store.go b/account/key/store.go index c7eea20e7..bfd554d22 100644 --- a/account/key/store.go +++ b/account/key/store.go @@ -9,8 +9,8 @@ import ( "sync" "time" - crypto "github.com/aergoio/aergo/account/key/crypto" - "github.com/aergoio/aergo/types" + crypto "github.com/aergoio/aergo/v2/account/key/crypto" + "github.com/aergoio/aergo/v2/types" "github.com/btcsuite/btcd/btcec" ) diff --git a/account/key/store_test.go b/account/key/store_test.go index 41ca804b9..bb3801410 100644 --- a/account/key/store_test.go +++ b/account/key/store_test.go @@ -11,8 +11,8 @@ import ( "sync" "testing" - crypto "github.com/aergoio/aergo/account/key/crypto" - "github.com/aergoio/aergo/types" + crypto "github.com/aergoio/aergo/v2/account/key/crypto" + "github.com/aergoio/aergo/v2/types" "github.com/btcsuite/btcd/btcec" "github.com/stretchr/testify/assert" ) diff --git a/account/signer.go b/account/signer.go index ceccdc581..d65f17442 100644 --- a/account/signer.go +++ b/account/signer.go @@ -2,8 +2,8 @@ package account import ( "github.com/aergoio/aergo-actor/actor" - "github.com/aergoio/aergo/account/key" - "github.com/aergoio/aergo/message" + "github.com/aergoio/aergo/v2/account/key" + "github.com/aergoio/aergo/v2/message" ) type Signer struct { diff --git a/aergo-protobuf b/aergo-protobuf index 9cbb5167c..6047c704f 160000 --- a/aergo-protobuf +++ b/aergo-protobuf @@ -1 +1 @@ -Subproject commit 9cbb5167c325a9adea21364522a353a12e0be789 +Subproject commit 6047c704fd3815466157bd70139ad656480bc745 diff --git a/chain/blockvalidator.go b/chain/blockvalidator.go index 2828d82c4..3fa07fb91 100644 --- a/chain/blockvalidator.go +++ b/chain/blockvalidator.go @@ -10,10 +10,10 @@ import ( "errors" "fmt" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" ) type BlockValidator struct { diff --git a/chain/chainanchor.go b/chain/chainanchor.go index 270a3185d..a29455879 100644 --- a/chain/chainanchor.go +++ b/chain/chainanchor.go @@ -6,8 +6,8 @@ package chain import ( - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/types" ) type ChainAnchor []([]byte) diff --git a/chain/chaindb.go b/chain/chaindb.go index 811876fb2..efd4e36b7 100644 --- a/chain/chaindb.go +++ b/chain/chaindb.go @@ -15,11 +15,11 @@ import ( "sync/atomic" "github.com/aergoio/aergo-lib/db" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/internal/common" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/internal/common" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/types" "github.com/golang/protobuf/proto" ) diff --git a/chain/chaindbForRaft.go b/chain/chaindbForRaft.go index 6cb7831e7..a43949745 100644 --- a/chain/chaindbForRaft.go +++ b/chain/chaindbForRaft.go @@ -7,8 +7,8 @@ import ( "errors" "github.com/aergoio/aergo-lib/db" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/types" "github.com/aergoio/etcd/raft/raftpb" "github.com/golang/protobuf/proto" ) diff --git a/chain/chainhandle.go b/chain/chainhandle.go index 1316ff414..14be24121 100644 --- a/chain/chainhandle.go +++ b/chain/chainhandle.go @@ -13,14 +13,14 @@ import ( "fmt" "math/big" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/contract" - "github.com/aergoio/aergo/contract/name" - "github.com/aergoio/aergo/contract/system" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/contract" + "github.com/aergoio/aergo/v2/contract/name" + "github.com/aergoio/aergo/v2/contract/system" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" "github.com/golang/protobuf/proto" ) diff --git a/chain/chainhandle_test.go b/chain/chainhandle_test.go index eb4543b40..531d59ded 100644 --- a/chain/chainhandle_test.go +++ b/chain/chainhandle_test.go @@ -11,12 +11,12 @@ import ( "testing" "github.com/aergoio/aergo-lib/db" - "github.com/aergoio/aergo/account/key" - "github.com/aergoio/aergo/contract" - "github.com/aergoio/aergo/contract/system" - "github.com/aergoio/aergo/internal/common" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/account/key" + "github.com/aergoio/aergo/v2/contract" + "github.com/aergoio/aergo/v2/contract/system" + "github.com/aergoio/aergo/v2/internal/common" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" "github.com/stretchr/testify/assert" ) diff --git a/chain/chainservice.go b/chain/chainservice.go index 79f5efd56..bdca76d7c 100644 --- a/chain/chainservice.go +++ b/chain/chainservice.go @@ -17,19 +17,19 @@ import ( "github.com/aergoio/aergo-actor/actor" "github.com/aergoio/aergo-lib/log" - cfg "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/contract" - "github.com/aergoio/aergo/contract/enterprise" - "github.com/aergoio/aergo/contract/name" - "github.com/aergoio/aergo/contract/system" - "github.com/aergoio/aergo/fee" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + cfg "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/contract" + "github.com/aergoio/aergo/v2/contract/enterprise" + "github.com/aergoio/aergo/v2/contract/name" + "github.com/aergoio/aergo/v2/contract/system" + "github.com/aergoio/aergo/v2/fee" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" lru "github.com/hashicorp/golang-lru" ) diff --git a/chain/chainservice_test.go b/chain/chainservice_test.go index 967b754fa..ec87b5b9a 100644 --- a/chain/chainservice_test.go +++ b/chain/chainservice_test.go @@ -5,10 +5,10 @@ import ( "fmt" "testing" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" "github.com/stretchr/testify/assert" ) diff --git a/chain/chainverifier.go b/chain/chainverifier.go index ffd7e0272..bd5bc4fc2 100644 --- a/chain/chainverifier.go +++ b/chain/chainverifier.go @@ -6,10 +6,10 @@ import ( "time" "github.com/aergoio/aergo-actor/actor" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/types" ) type ChainVerifier struct { diff --git a/chain/common.go b/chain/common.go index 9f1ebe596..fccd0ec9c 100644 --- a/chain/common.go +++ b/chain/common.go @@ -8,9 +8,9 @@ package chain import ( "errors" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/types" ) const pubNetMaxBlockBodySize = 4000000 diff --git a/chain/governance.go b/chain/governance.go index e12fa553e..06ad3ce17 100644 --- a/chain/governance.go +++ b/chain/governance.go @@ -8,13 +8,13 @@ package chain import ( "math/big" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/contract" - "github.com/aergoio/aergo/contract/enterprise" - "github.com/aergoio/aergo/contract/name" - "github.com/aergoio/aergo/contract/system" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/contract" + "github.com/aergoio/aergo/v2/contract/enterprise" + "github.com/aergoio/aergo/v2/contract/name" + "github.com/aergoio/aergo/v2/contract/system" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" ) func executeGovernanceTx(ccc consensus.ChainConsensusCluster, bs *state.BlockState, txBody *types.TxBody, sender, receiver *state.V, diff --git a/chain/orphanpool.go b/chain/orphanpool.go index 562a9711e..1e254fcb7 100644 --- a/chain/orphanpool.go +++ b/chain/orphanpool.go @@ -9,8 +9,8 @@ import ( "errors" "sync" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/types" "github.com/hashicorp/golang-lru/simplelru" ) diff --git a/chain/orphanpool_test.go b/chain/orphanpool_test.go index 6c6609ecd..23322fd6a 100644 --- a/chain/orphanpool_test.go +++ b/chain/orphanpool_test.go @@ -3,7 +3,7 @@ package chain import ( "testing" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" "github.com/stretchr/testify/assert" ) diff --git a/chain/recover.go b/chain/recover.go index 8f15f5e6d..922786741 100644 --- a/chain/recover.go +++ b/chain/recover.go @@ -9,8 +9,8 @@ import ( "runtime" "runtime/debug" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/types" ) var ( diff --git a/chain/reorg.go b/chain/reorg.go index 73882b2e6..5691c5ed3 100644 --- a/chain/reorg.go +++ b/chain/reorg.go @@ -6,12 +6,12 @@ import ( "fmt" "time" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/contract/system" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/contract/system" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" ) const ( diff --git a/chain/signVerifier.go b/chain/signVerifier.go index 8cd703b80..69583b28f 100644 --- a/chain/signVerifier.go +++ b/chain/signVerifier.go @@ -5,13 +5,13 @@ import ( "time" "github.com/aergoio/aergo-actor/actor" - "github.com/aergoio/aergo/account/key" - "github.com/aergoio/aergo/contract/name" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/account/key" + "github.com/aergoio/aergo/v2/contract/name" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" ) type SignVerifier struct { diff --git a/chain/signverifier_test.go b/chain/signverifier_test.go index 8643afb89..4fc5bf950 100644 --- a/chain/signverifier_test.go +++ b/chain/signverifier_test.go @@ -5,9 +5,9 @@ import ( "math/big" "testing" - "github.com/aergoio/aergo/account/key" - crypto "github.com/aergoio/aergo/account/key/crypto" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/account/key" + crypto "github.com/aergoio/aergo/v2/account/key/crypto" + "github.com/aergoio/aergo/v2/types" "github.com/btcsuite/btcd/btcec" "github.com/stretchr/testify/assert" ) diff --git a/chain/stat.go b/chain/stat.go index e1a89e97b..607d1b0f4 100644 --- a/chain/stat.go +++ b/chain/stat.go @@ -5,7 +5,7 @@ import ( "sync" "time" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" ) //go:generate stringer -type=statIndex diff --git a/chain/stat_test.go b/chain/stat_test.go index 9c3e9734d..8b3d431c5 100644 --- a/chain/stat_test.go +++ b/chain/stat_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" "github.com/stretchr/testify/assert" ) diff --git a/chain/stubchain.go b/chain/stubchain.go index e226b21c4..5f5904768 100644 --- a/chain/stubchain.go +++ b/chain/stubchain.go @@ -6,8 +6,8 @@ import ( "math/big" "time" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/types" ) // StubSyncer receive Syncer, P2P, Chain Service actor message diff --git a/chain/subcomponent.go b/chain/subcomponent.go index 87ad83877..9d22b4d1f 100644 --- a/chain/subcomponent.go +++ b/chain/subcomponent.go @@ -5,7 +5,7 @@ import ( "github.com/aergoio/aergo-actor/actor" "github.com/aergoio/aergo-actor/router" - "github.com/aergoio/aergo/pkg/component" + "github.com/aergoio/aergo/v2/pkg/component" ) // SubComponent handles message with Receive(), and requests to other actor services with IComponentRequester diff --git a/cmd/aergocli/aergocli.go b/cmd/aergocli/aergocli.go index 769f7e1f7..0650ce8a7 100644 --- a/cmd/aergocli/aergocli.go +++ b/cmd/aergocli/aergocli.go @@ -5,7 +5,7 @@ package main import ( - "github.com/aergoio/aergo/cmd/aergocli/cmd" + "github.com/aergoio/aergo/v2/cmd/aergocli/cmd" ) // rootCmd is the entry point for this binary diff --git a/cmd/aergocli/cmd/accounts.go b/cmd/aergocli/cmd/accounts.go index 6bf7d8e91..69fe50e0c 100644 --- a/cmd/aergocli/cmd/accounts.go +++ b/cmd/aergocli/cmd/accounts.go @@ -11,8 +11,8 @@ import ( "path/filepath" "syscall" - "github.com/aergoio/aergo/account/key" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/account/key" + "github.com/aergoio/aergo/v2/types" "github.com/spf13/cobra" "golang.org/x/crypto/ssh/terminal" ) diff --git a/cmd/aergocli/cmd/accounts_test.go b/cmd/aergocli/cmd/accounts_test.go index 2753ff16a..fbcfeda17 100644 --- a/cmd/aergocli/cmd/accounts_test.go +++ b/cmd/aergocli/cmd/accounts_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" "github.com/stretchr/testify/assert" ) diff --git a/cmd/aergocli/cmd/blockchain.go b/cmd/aergocli/cmd/blockchain.go index 9cc641918..0e5b4a579 100644 --- a/cmd/aergocli/cmd/blockchain.go +++ b/cmd/aergocli/cmd/blockchain.go @@ -8,8 +8,8 @@ package cmd import ( "context" - "github.com/aergoio/aergo/cmd/aergocli/util" - aergorpc "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/aergocli/util" + aergorpc "github.com/aergoio/aergo/v2/types" "github.com/spf13/cobra" ) diff --git a/cmd/aergocli/cmd/blockchain_test.go b/cmd/aergocli/cmd/blockchain_test.go index 2bb439b06..112fb0dc2 100644 --- a/cmd/aergocli/cmd/blockchain_test.go +++ b/cmd/aergocli/cmd/blockchain_test.go @@ -4,8 +4,8 @@ import ( "encoding/hex" "testing" - "github.com/aergoio/aergo/cmd/aergocli/util/encoding/json" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/aergocli/util/encoding/json" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" "github.com/mr-tron/base58/base58" "github.com/stretchr/testify/assert" diff --git a/cmd/aergocli/cmd/chaininfo.go b/cmd/aergocli/cmd/chaininfo.go index 91851a373..fce5e3b90 100644 --- a/cmd/aergocli/cmd/chaininfo.go +++ b/cmd/aergocli/cmd/chaininfo.go @@ -3,8 +3,8 @@ package cmd import ( "context" - "github.com/aergoio/aergo/cmd/aergocli/util" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/aergocli/util" + "github.com/aergoio/aergo/v2/types" "github.com/spf13/cobra" ) diff --git a/cmd/aergocli/cmd/chainstat.go b/cmd/aergocli/cmd/chainstat.go index b94f25ff7..e573404e3 100644 --- a/cmd/aergocli/cmd/chainstat.go +++ b/cmd/aergocli/cmd/chainstat.go @@ -7,7 +7,7 @@ package cmd import ( "context" - aergorpc "github.com/aergoio/aergo/types" + aergorpc "github.com/aergoio/aergo/v2/types" "github.com/spf13/cobra" ) diff --git a/cmd/aergocli/cmd/committx.go b/cmd/aergocli/cmd/committx.go index 601ae48e2..9dbdfd8a2 100644 --- a/cmd/aergocli/cmd/committx.go +++ b/cmd/aergocli/cmd/committx.go @@ -10,8 +10,8 @@ import ( "errors" "io/ioutil" - "github.com/aergoio/aergo/cmd/aergocli/util" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/aergocli/util" + "github.com/aergoio/aergo/v2/types" "github.com/spf13/cobra" ) diff --git a/cmd/aergocli/cmd/committx_test.go b/cmd/aergocli/cmd/committx_test.go index 70d0415ef..27f3de136 100644 --- a/cmd/aergocli/cmd/committx_test.go +++ b/cmd/aergocli/cmd/committx_test.go @@ -3,8 +3,8 @@ package cmd import ( "testing" - "github.com/aergoio/aergo/cmd/aergocli/util/encoding/json" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/aergocli/util/encoding/json" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" "github.com/mr-tron/base58/base58" "github.com/stretchr/testify/assert" diff --git a/cmd/aergocli/cmd/contract.go b/cmd/aergocli/cmd/contract.go index 5bb20efe4..0e8bbb2aa 100644 --- a/cmd/aergocli/cmd/contract.go +++ b/cmd/aergocli/cmd/contract.go @@ -3,19 +3,19 @@ package cmd import ( "bytes" "context" - "encoding/json" "encoding/hex" + "encoding/json" "errors" "fmt" "io/ioutil" "strconv" - "github.com/aergoio/aergo/cmd/aergocli/util" - luacEncoding "github.com/aergoio/aergo/cmd/aergoluac/encoding" - luac "github.com/aergoio/aergo/cmd/aergoluac/util" - "github.com/aergoio/aergo/internal/common" - "github.com/aergoio/aergo/types" - aergorpc "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/aergocli/util" + luacEncoding "github.com/aergoio/aergo/v2/cmd/aergoluac/encoding" + luac "github.com/aergoio/aergo/v2/cmd/aergoluac/util" + "github.com/aergoio/aergo/v2/internal/common" + "github.com/aergoio/aergo/v2/types" + aergorpc "github.com/aergoio/aergo/v2/types" "github.com/mr-tron/base58/base58" "github.com/spf13/cobra" ) @@ -131,11 +131,11 @@ func init() { } func isHexString(s string) bool { - // check is the input has even number of characters - if len(s)%2 != 0 { - return false - } - // check if the input contains only hex characters + // check is the input has even number of characters + if len(s)%2 != 0 { + return false + } + // check if the input contains only hex characters for _, c := range s { if !((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F')) { return false diff --git a/cmd/aergocli/cmd/enterprise.go b/cmd/aergocli/cmd/enterprise.go index b4a16b513..ad24bfd40 100644 --- a/cmd/aergocli/cmd/enterprise.go +++ b/cmd/aergocli/cmd/enterprise.go @@ -13,11 +13,11 @@ import ( "strings" "time" - "github.com/aergoio/aergo/cmd/aergocli/util" - "github.com/aergoio/aergo/cmd/aergocli/util/encoding/json" - "github.com/aergoio/aergo/contract/enterprise" - "github.com/aergoio/aergo/types" - aergorpc "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/aergocli/util" + "github.com/aergoio/aergo/v2/cmd/aergocli/util/encoding/json" + "github.com/aergoio/aergo/v2/contract/enterprise" + "github.com/aergoio/aergo/v2/types" + aergorpc "github.com/aergoio/aergo/v2/types" "github.com/mr-tron/base58/base58" "github.com/spf13/cobra" ) diff --git a/cmd/aergocli/cmd/enterprise_test.go b/cmd/aergocli/cmd/enterprise_test.go index 53124bd18..09737e07b 100644 --- a/cmd/aergocli/cmd/enterprise_test.go +++ b/cmd/aergocli/cmd/enterprise_test.go @@ -5,7 +5,7 @@ import ( "errors" "testing" - aergorpc "github.com/aergoio/aergo/types" + aergorpc "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" "github.com/mr-tron/base58/base58" "github.com/stretchr/testify/assert" diff --git a/cmd/aergocli/cmd/event.go b/cmd/aergocli/cmd/event.go index 5c6cc5329..41d8dc2dd 100644 --- a/cmd/aergocli/cmd/event.go +++ b/cmd/aergocli/cmd/event.go @@ -9,8 +9,8 @@ import ( "context" "log" - "github.com/aergoio/aergo/cmd/aergocli/util" - aergorpc "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/aergocli/util" + aergorpc "github.com/aergoio/aergo/v2/types" "github.com/spf13/cobra" ) diff --git a/cmd/aergocli/cmd/getblock.go b/cmd/aergocli/cmd/getblock.go index 7acb242ae..6f29340b0 100644 --- a/cmd/aergocli/cmd/getblock.go +++ b/cmd/aergocli/cmd/getblock.go @@ -11,8 +11,8 @@ import ( "errors" "fmt" - "github.com/aergoio/aergo/cmd/aergocli/util" - aergorpc "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/aergocli/util" + aergorpc "github.com/aergoio/aergo/v2/types" "github.com/mr-tron/base58/base58" "github.com/spf13/cobra" ) diff --git a/cmd/aergocli/cmd/getconsensusinfo.go b/cmd/aergocli/cmd/getconsensusinfo.go index 44d51ce71..b93246dbf 100644 --- a/cmd/aergocli/cmd/getconsensusinfo.go +++ b/cmd/aergocli/cmd/getconsensusinfo.go @@ -10,7 +10,7 @@ import ( "encoding/json" "fmt" - aergorpc "github.com/aergoio/aergo/types" + aergorpc "github.com/aergoio/aergo/v2/types" "github.com/spf13/cobra" ) diff --git a/cmd/aergocli/cmd/getpeers.go b/cmd/aergocli/cmd/getpeers.go index b85afdd5e..571313eac 100644 --- a/cmd/aergocli/cmd/getpeers.go +++ b/cmd/aergocli/cmd/getpeers.go @@ -12,8 +12,8 @@ import ( "sort" "strings" - "github.com/aergoio/aergo/cmd/aergocli/util" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/aergocli/util" + "github.com/aergoio/aergo/v2/types" "github.com/spf13/cobra" ) diff --git a/cmd/aergocli/cmd/getstate.go b/cmd/aergocli/cmd/getstate.go index 245ff4362..a2b02c3eb 100644 --- a/cmd/aergocli/cmd/getstate.go +++ b/cmd/aergocli/cmd/getstate.go @@ -8,8 +8,8 @@ package cmd import ( "context" - "github.com/aergoio/aergo/cmd/aergocli/util" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/aergocli/util" + "github.com/aergoio/aergo/v2/types" "github.com/mr-tron/base58/base58" "github.com/spf13/cobra" ) diff --git a/cmd/aergocli/cmd/gettx.go b/cmd/aergocli/cmd/gettx.go index c7ff4c910..a9f7f8d8e 100644 --- a/cmd/aergocli/cmd/gettx.go +++ b/cmd/aergocli/cmd/gettx.go @@ -8,8 +8,8 @@ package cmd import ( "context" - "github.com/aergoio/aergo/cmd/aergocli/util" - aergorpc "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/aergocli/util" + aergorpc "github.com/aergoio/aergo/v2/types" "github.com/mr-tron/base58/base58" "github.com/spf13/cobra" ) diff --git a/cmd/aergocli/cmd/keygen.go b/cmd/aergocli/cmd/keygen.go index f57e1f4e8..8d6a323e9 100644 --- a/cmd/aergocli/cmd/keygen.go +++ b/cmd/aergocli/cmd/keygen.go @@ -8,10 +8,10 @@ import ( "path/filepath" "strings" - "github.com/aergoio/aergo/account/key" - keycrypto "github.com/aergoio/aergo/account/key/crypto" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/account/key" + keycrypto "github.com/aergoio/aergo/v2/account/key/crypto" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" "github.com/btcsuite/btcd/btcec" "github.com/libp2p/go-libp2p-core/crypto" "github.com/spf13/cobra" diff --git a/cmd/aergocli/cmd/listblocks.go b/cmd/aergocli/cmd/listblocks.go index 53ff96886..d20a32385 100644 --- a/cmd/aergocli/cmd/listblocks.go +++ b/cmd/aergocli/cmd/listblocks.go @@ -8,8 +8,8 @@ package cmd import ( "context" - "github.com/aergoio/aergo/cmd/aergocli/util" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/aergocli/util" + "github.com/aergoio/aergo/v2/types" "github.com/mr-tron/base58/base58" "github.com/spf13/cobra" ) diff --git a/cmd/aergocli/cmd/mempool.go b/cmd/aergocli/cmd/mempool.go index ae69d7ae3..846d80a79 100644 --- a/cmd/aergocli/cmd/mempool.go +++ b/cmd/aergocli/cmd/mempool.go @@ -6,8 +6,8 @@ import ( "log" "strings" - "github.com/aergoio/aergo/cmd/aergocli/util" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/aergocli/util" + "github.com/aergoio/aergo/v2/types" "github.com/spf13/cobra" "google.golang.org/grpc" ) diff --git a/cmd/aergocli/cmd/metric.go b/cmd/aergocli/cmd/metric.go index 8e2fd78b1..a18268a12 100644 --- a/cmd/aergocli/cmd/metric.go +++ b/cmd/aergocli/cmd/metric.go @@ -8,8 +8,8 @@ package cmd import ( "context" - "github.com/aergoio/aergo/cmd/aergocli/util" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/aergocli/util" + "github.com/aergoio/aergo/v2/types" "github.com/spf13/cobra" ) diff --git a/cmd/aergocli/cmd/mock_types/mock_types.go b/cmd/aergocli/cmd/mock_types/mock_types.go index be7a19fad..0aeefc753 100644 --- a/cmd/aergocli/cmd/mock_types/mock_types.go +++ b/cmd/aergocli/cmd/mock_types/mock_types.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/aergoio/aergo/types (interfaces: AergoRPCServiceClient) +// Source: github.com/aergoio/aergo/v2/types (interfaces: AergoRPCServiceClient) // Package mock_types is a generated GoMock package. package mock_types @@ -8,7 +8,7 @@ import ( context "context" reflect "reflect" - types "github.com/aergoio/aergo/types" + types "github.com/aergoio/aergo/v2/types" gomock "github.com/golang/mock/gomock" grpc "google.golang.org/grpc" ) diff --git a/cmd/aergocli/cmd/name.go b/cmd/aergocli/cmd/name.go index 214546a9c..68b065ef1 100644 --- a/cmd/aergocli/cmd/name.go +++ b/cmd/aergocli/cmd/name.go @@ -13,8 +13,8 @@ import ( "log" "math/big" - "github.com/aergoio/aergo/cmd/aergocli/util" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/aergocli/util" + "github.com/aergoio/aergo/v2/types" "github.com/spf13/cobra" ) diff --git a/cmd/aergocli/cmd/nodestate.go b/cmd/aergocli/cmd/nodestate.go index 3abd4a1b2..11bd30cb6 100644 --- a/cmd/aergocli/cmd/nodestate.go +++ b/cmd/aergocli/cmd/nodestate.go @@ -9,7 +9,7 @@ import ( "context" "encoding/binary" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" "github.com/spf13/cobra" ) diff --git a/cmd/aergocli/cmd/receipt.go b/cmd/aergocli/cmd/receipt.go index 228cba8c8..fc7d8fefe 100644 --- a/cmd/aergocli/cmd/receipt.go +++ b/cmd/aergocli/cmd/receipt.go @@ -9,8 +9,8 @@ import ( "context" "log" - "github.com/aergoio/aergo/cmd/aergocli/util" - aergorpc "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/aergocli/util" + aergorpc "github.com/aergoio/aergo/v2/types" "github.com/mr-tron/base58/base58" "github.com/spf13/cobra" ) diff --git a/cmd/aergocli/cmd/root.go b/cmd/aergocli/cmd/root.go index 153435529..53d496d95 100644 --- a/cmd/aergocli/cmd/root.go +++ b/cmd/aergocli/cmd/root.go @@ -13,8 +13,8 @@ import ( "log" "os" - "github.com/aergoio/aergo/cmd/aergocli/util" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/aergocli/util" + "github.com/aergoio/aergo/v2/types" "github.com/rs/zerolog" "github.com/spf13/cobra" "google.golang.org/grpc" diff --git a/cmd/aergocli/cmd/root_test.go b/cmd/aergocli/cmd/root_test.go index 6d3811063..1e4af6798 100644 --- a/cmd/aergocli/cmd/root_test.go +++ b/cmd/aergocli/cmd/root_test.go @@ -4,8 +4,8 @@ import ( "bytes" "testing" - "github.com/aergoio/aergo/cmd/aergocli/cmd/mock_types" - "github.com/aergoio/aergo/cmd/aergocli/util" + "github.com/aergoio/aergo/v2/cmd/aergocli/cmd/mock_types" + "github.com/aergoio/aergo/v2/cmd/aergocli/util" "github.com/golang/mock/gomock" "github.com/spf13/cobra" ) diff --git a/cmd/aergocli/cmd/sendtx.go b/cmd/aergocli/cmd/sendtx.go index 1944cbb76..f76923ba7 100644 --- a/cmd/aergocli/cmd/sendtx.go +++ b/cmd/aergocli/cmd/sendtx.go @@ -9,8 +9,8 @@ import ( "context" "errors" - "github.com/aergoio/aergo/cmd/aergocli/util" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/aergocli/util" + "github.com/aergoio/aergo/v2/types" "github.com/mr-tron/base58" "github.com/spf13/cobra" ) diff --git a/cmd/aergocli/cmd/sendtx_test.go b/cmd/aergocli/cmd/sendtx_test.go index e4c3016b9..5cb101dac 100644 --- a/cmd/aergocli/cmd/sendtx_test.go +++ b/cmd/aergocli/cmd/sendtx_test.go @@ -3,8 +3,8 @@ package cmd import ( "testing" - "github.com/aergoio/aergo/cmd/aergocli/util/encoding/json" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/aergocli/util/encoding/json" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" "github.com/mr-tron/base58/base58" "github.com/stretchr/testify/assert" diff --git a/cmd/aergocli/cmd/serverinfo.go b/cmd/aergocli/cmd/serverinfo.go index addc21124..89128210a 100644 --- a/cmd/aergocli/cmd/serverinfo.go +++ b/cmd/aergocli/cmd/serverinfo.go @@ -10,7 +10,7 @@ import ( "encoding/binary" "encoding/json" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" "github.com/spf13/cobra" ) diff --git a/cmd/aergocli/cmd/signtx.go b/cmd/aergocli/cmd/signtx.go index 9df92b18b..d4e8b48db 100644 --- a/cmd/aergocli/cmd/signtx.go +++ b/cmd/aergocli/cmd/signtx.go @@ -5,10 +5,10 @@ import ( "fmt" "os" - "github.com/aergoio/aergo/account/key" - crypto "github.com/aergoio/aergo/account/key/crypto" - "github.com/aergoio/aergo/cmd/aergocli/util" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/account/key" + crypto "github.com/aergoio/aergo/v2/account/key/crypto" + "github.com/aergoio/aergo/v2/cmd/aergocli/util" + "github.com/aergoio/aergo/v2/types" "github.com/btcsuite/btcd/btcec" "github.com/mr-tron/base58/base58" "github.com/spf13/cobra" diff --git a/cmd/aergocli/cmd/signtx_test.go b/cmd/aergocli/cmd/signtx_test.go index bd1d56d28..e76a37b52 100644 --- a/cmd/aergocli/cmd/signtx_test.go +++ b/cmd/aergocli/cmd/signtx_test.go @@ -6,9 +6,9 @@ import ( "strings" "testing" - "github.com/aergoio/aergo/cmd/aergocli/util" - "github.com/aergoio/aergo/cmd/aergocli/util/encoding/json" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/aergocli/util" + "github.com/aergoio/aergo/v2/cmd/aergocli/util/encoding/json" + "github.com/aergoio/aergo/v2/types" "github.com/mr-tron/base58/base58" "github.com/stretchr/testify/assert" ) diff --git a/cmd/aergocli/cmd/stake.go b/cmd/aergocli/cmd/stake.go index 98f57834a..b4bc18038 100644 --- a/cmd/aergocli/cmd/stake.go +++ b/cmd/aergocli/cmd/stake.go @@ -9,8 +9,8 @@ import ( "encoding/json" "errors" - "github.com/aergoio/aergo/cmd/aergocli/util" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/aergocli/util" + "github.com/aergoio/aergo/v2/types" "github.com/spf13/cobra" ) diff --git a/cmd/aergocli/cmd/vote.go b/cmd/aergocli/cmd/vote.go index f5d110534..880980b9c 100644 --- a/cmd/aergocli/cmd/vote.go +++ b/cmd/aergocli/cmd/vote.go @@ -12,8 +12,8 @@ import ( "os" "strings" - "github.com/aergoio/aergo/cmd/aergocli/util" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/aergocli/util" + "github.com/aergoio/aergo/v2/types" "github.com/mr-tron/base58/base58" "github.com/spf13/cobra" ) diff --git a/cmd/aergocli/util/base58addr.go b/cmd/aergocli/util/base58addr.go index f07dcb576..90993c03a 100644 --- a/cmd/aergocli/util/base58addr.go +++ b/cmd/aergocli/util/base58addr.go @@ -8,8 +8,8 @@ import ( "strconv" "time" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" "github.com/mr-tron/base58/base58" ) diff --git a/cmd/aergocli/util/base58addr_test.go b/cmd/aergocli/util/base58addr_test.go index b0a517e95..a3f962b98 100644 --- a/cmd/aergocli/util/base58addr_test.go +++ b/cmd/aergocli/util/base58addr_test.go @@ -3,7 +3,7 @@ package util import ( "testing" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" "github.com/mr-tron/base58/base58" "github.com/stretchr/testify/assert" ) diff --git a/cmd/aergocli/util/base64ToHex.go b/cmd/aergocli/util/base64ToHex.go index 810974911..0df49c088 100644 --- a/cmd/aergocli/util/base64ToHex.go +++ b/cmd/aergocli/util/base64ToHex.go @@ -4,7 +4,7 @@ import ( "encoding/hex" "encoding/json" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" ) type InOutBlockchainStatus struct { diff --git a/cmd/aergocli/util/convChaininfo.go b/cmd/aergocli/util/convChaininfo.go index 86fb9afad..0efa70662 100644 --- a/cmd/aergocli/util/convChaininfo.go +++ b/cmd/aergocli/util/convChaininfo.go @@ -4,8 +4,8 @@ import ( "encoding/json" "math/big" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/types" ) type InOutChainId struct { diff --git a/cmd/aergocli/util/convTx.go b/cmd/aergocli/util/convTx.go index 064313066..a3392d258 100644 --- a/cmd/aergocli/util/convTx.go +++ b/cmd/aergocli/util/convTx.go @@ -1,6 +1,6 @@ package util -import "github.com/aergoio/aergo/types" +import "github.com/aergoio/aergo/v2/types" type EncodingType int diff --git a/cmd/aergocli/util/convTx_test.go b/cmd/aergocli/util/convTx_test.go index 01ed6a476..536c9950c 100644 --- a/cmd/aergocli/util/convTx_test.go +++ b/cmd/aergocli/util/convTx_test.go @@ -3,7 +3,7 @@ package util import ( "testing" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" "github.com/stretchr/testify/assert" ) diff --git a/cmd/aergocli/util/grpccommon.go b/cmd/aergocli/util/grpccommon.go index 605b07615..e21af7fba 100644 --- a/cmd/aergocli/util/grpccommon.go +++ b/cmd/aergocli/util/grpccommon.go @@ -8,8 +8,8 @@ package util import ( "fmt" - "github.com/aergoio/aergo/cmd/aergocli/util/encoding/json" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/aergocli/util/encoding/json" + "github.com/aergoio/aergo/v2/types" protobuf "github.com/golang/protobuf/proto" "google.golang.org/grpc" ) diff --git a/cmd/aergocli/util/unit_test.go b/cmd/aergocli/util/unit_test.go index 33658b757..42bcb5b99 100644 --- a/cmd/aergocli/util/unit_test.go +++ b/cmd/aergocli/util/unit_test.go @@ -4,7 +4,7 @@ import ( "math/big" "testing" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" "github.com/stretchr/testify/assert" ) diff --git a/cmd/aergoluac/main.go b/cmd/aergoluac/main.go index 604a6a85b..d305fd093 100644 --- a/cmd/aergoluac/main.go +++ b/cmd/aergoluac/main.go @@ -9,7 +9,7 @@ import ( "errors" "os" - "github.com/aergoio/aergo/cmd/aergoluac/util" + "github.com/aergoio/aergo/v2/cmd/aergoluac/util" "github.com/spf13/cobra" ) diff --git a/cmd/aergoluac/util/luac_util.go b/cmd/aergoluac/util/luac_util.go index 9010d23de..20b038260 100644 --- a/cmd/aergoluac/util/luac_util.go +++ b/cmd/aergoluac/util/luac_util.go @@ -20,7 +20,7 @@ import ( "runtime" "unsafe" - "github.com/aergoio/aergo/cmd/aergoluac/encoding" + "github.com/aergoio/aergo/v2/cmd/aergoluac/encoding" ) func NewLState() *C.lua_State { diff --git a/cmd/aergosvr/aergosvr.go b/cmd/aergosvr/aergosvr.go index 220d637ef..1ede78845 100644 --- a/cmd/aergosvr/aergosvr.go +++ b/cmd/aergosvr/aergosvr.go @@ -11,19 +11,19 @@ import ( "os" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/account" - "github.com/aergoio/aergo/chain" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/consensus/impl" - "github.com/aergoio/aergo/internal/common" - "github.com/aergoio/aergo/mempool" - "github.com/aergoio/aergo/p2p" - "github.com/aergoio/aergo/p2p/p2pkey" - "github.com/aergoio/aergo/pkg/component" - polarisclient "github.com/aergoio/aergo/polaris/client" - "github.com/aergoio/aergo/rpc" - "github.com/aergoio/aergo/syncer" + "github.com/aergoio/aergo/v2/account" + "github.com/aergoio/aergo/v2/chain" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/consensus/impl" + "github.com/aergoio/aergo/v2/internal/common" + "github.com/aergoio/aergo/v2/mempool" + "github.com/aergoio/aergo/v2/p2p" + "github.com/aergoio/aergo/v2/p2p/p2pkey" + "github.com/aergoio/aergo/v2/pkg/component" + polarisclient "github.com/aergoio/aergo/v2/polaris/client" + "github.com/aergoio/aergo/v2/rpc" + "github.com/aergoio/aergo/v2/syncer" "github.com/spf13/cobra" ) diff --git a/cmd/aergosvr/dumper.go b/cmd/aergosvr/dumper.go index fb4d1a5f9..631db513d 100644 --- a/cmd/aergosvr/dumper.go +++ b/cmd/aergosvr/dumper.go @@ -7,10 +7,10 @@ import ( "net/http" "strconv" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/consensus/chain" - "github.com/aergoio/aergo/contract/system" - "github.com/aergoio/aergo/pkg/component" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/consensus/chain" + "github.com/aergoio/aergo/v2/contract/system" + "github.com/aergoio/aergo/v2/pkg/component" ) type dumper struct { diff --git a/cmd/aergosvr/init.go b/cmd/aergosvr/init.go index 7fd5681b8..b88a9c0a4 100644 --- a/cmd/aergosvr/init.go +++ b/cmd/aergosvr/init.go @@ -5,10 +5,10 @@ import ( "fmt" "os" - "github.com/aergoio/aergo/chain" - "github.com/aergoio/aergo/consensus/impl" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/chain" + "github.com/aergoio/aergo/v2/consensus/impl" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/types" "github.com/spf13/cobra" ) diff --git a/cmd/brick/brick.go b/cmd/brick/brick.go index 33976cfd6..ed7c915e9 100644 --- a/cmd/brick/brick.go +++ b/cmd/brick/brick.go @@ -8,8 +8,8 @@ import ( "strings" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/cmd/brick/context" - "github.com/aergoio/aergo/cmd/brick/exec" + "github.com/aergoio/aergo/v2/cmd/brick/context" + "github.com/aergoio/aergo/v2/cmd/brick/exec" prompt "github.com/c-bata/go-prompt" ) diff --git a/cmd/brick/context/context.go b/cmd/brick/context/context.go index d7c8b36f3..9f2bc330f 100644 --- a/cmd/brick/context/context.go +++ b/cmd/brick/context/context.go @@ -12,7 +12,7 @@ import ( "log" "strconv" - "github.com/aergoio/aergo/contract/vm_dummy" + "github.com/aergoio/aergo/v2/contract/vm_dummy" ) var ( diff --git a/cmd/brick/exec/batch.go b/cmd/brick/exec/batch.go index c0f82084f..d8d73ace4 100644 --- a/cmd/brick/exec/batch.go +++ b/cmd/brick/exec/batch.go @@ -8,8 +8,8 @@ import ( "path/filepath" "strings" - "github.com/aergoio/aergo/cmd/brick/context" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/brick/context" + "github.com/aergoio/aergo/v2/types" "github.com/fsnotify/fsnotify" "github.com/mattn/go-colorable" "github.com/rs/zerolog" diff --git a/cmd/brick/exec/callContract.go b/cmd/brick/exec/callContract.go index 17d99fed0..b44ce1ee3 100644 --- a/cmd/brick/exec/callContract.go +++ b/cmd/brick/exec/callContract.go @@ -4,9 +4,9 @@ import ( "fmt" "math/big" - "github.com/aergoio/aergo/cmd/brick/context" - "github.com/aergoio/aergo/contract/vm_dummy" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/brick/context" + "github.com/aergoio/aergo/v2/contract/vm_dummy" + "github.com/aergoio/aergo/v2/types" "github.com/rs/zerolog" ) diff --git a/cmd/brick/exec/debug.go b/cmd/brick/exec/debug.go index 9ad9dcb06..b7b9c2537 100644 --- a/cmd/brick/exec/debug.go +++ b/cmd/brick/exec/debug.go @@ -7,9 +7,9 @@ import ( "fmt" "strconv" - "github.com/aergoio/aergo/cmd/brick/context" - "github.com/aergoio/aergo/contract" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/brick/context" + "github.com/aergoio/aergo/v2/contract" + "github.com/aergoio/aergo/v2/types" ) func init() { diff --git a/cmd/brick/exec/deployContract.go b/cmd/brick/exec/deployContract.go index b8bb73a58..014f2a73e 100644 --- a/cmd/brick/exec/deployContract.go +++ b/cmd/brick/exec/deployContract.go @@ -9,9 +9,9 @@ import ( "path/filepath" "strings" - "github.com/aergoio/aergo/cmd/brick/context" - "github.com/aergoio/aergo/contract/vm_dummy" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/brick/context" + "github.com/aergoio/aergo/v2/contract/vm_dummy" + "github.com/aergoio/aergo/v2/types" ) func init() { diff --git a/cmd/brick/exec/exec.go b/cmd/brick/exec/exec.go index 88c8e059c..0aa601532 100644 --- a/cmd/brick/exec/exec.go +++ b/cmd/brick/exec/exec.go @@ -7,8 +7,8 @@ import ( "strings" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/cmd/brick/context" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/brick/context" + "github.com/aergoio/aergo/v2/types" "github.com/rs/zerolog" ) diff --git a/cmd/brick/exec/exit.go b/cmd/brick/exec/exit.go index 40efbce96..41c0163b5 100644 --- a/cmd/brick/exec/exit.go +++ b/cmd/brick/exec/exit.go @@ -3,7 +3,7 @@ package exec import ( "runtime" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" ) func init() { diff --git a/cmd/brick/exec/forward.go b/cmd/brick/exec/forward.go index 44daf2272..7127f40f1 100644 --- a/cmd/brick/exec/forward.go +++ b/cmd/brick/exec/forward.go @@ -4,8 +4,8 @@ import ( "fmt" "strconv" - "github.com/aergoio/aergo/cmd/brick/context" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/brick/context" + "github.com/aergoio/aergo/v2/types" ) func init() { diff --git a/cmd/brick/exec/getstateAccount.go b/cmd/brick/exec/getstateAccount.go index 233e3de5c..216f0c592 100644 --- a/cmd/brick/exec/getstateAccount.go +++ b/cmd/brick/exec/getstateAccount.go @@ -4,9 +4,9 @@ import ( "fmt" "math/big" - "github.com/aergoio/aergo/cmd/brick/context" - "github.com/aergoio/aergo/contract/vm_dummy" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/brick/context" + "github.com/aergoio/aergo/v2/contract/vm_dummy" + "github.com/aergoio/aergo/v2/types" ) func init() { diff --git a/cmd/brick/exec/hardfork.go b/cmd/brick/exec/hardfork.go index 3840bd1bc..cd23473c5 100644 --- a/cmd/brick/exec/hardfork.go +++ b/cmd/brick/exec/hardfork.go @@ -4,8 +4,8 @@ import ( "fmt" "strconv" - "github.com/aergoio/aergo/cmd/brick/context" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/brick/context" + "github.com/aergoio/aergo/v2/types" ) func init() { diff --git a/cmd/brick/exec/help.go b/cmd/brick/exec/help.go index 5a2503808..b62443c86 100644 --- a/cmd/brick/exec/help.go +++ b/cmd/brick/exec/help.go @@ -4,8 +4,8 @@ import ( "fmt" "strings" - "github.com/aergoio/aergo/cmd/brick/context" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/brick/context" + "github.com/aergoio/aergo/v2/types" ) func init() { diff --git a/cmd/brick/exec/injectAccount.go b/cmd/brick/exec/injectAccount.go index 628f4e5e5..f5938341f 100644 --- a/cmd/brick/exec/injectAccount.go +++ b/cmd/brick/exec/injectAccount.go @@ -4,9 +4,9 @@ import ( "fmt" "math/big" - "github.com/aergoio/aergo/cmd/brick/context" - "github.com/aergoio/aergo/contract/vm_dummy" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/brick/context" + "github.com/aergoio/aergo/v2/contract/vm_dummy" + "github.com/aergoio/aergo/v2/types" ) func init() { diff --git a/cmd/brick/exec/queryContract.go b/cmd/brick/exec/queryContract.go index a846ed668..c16ac15c4 100644 --- a/cmd/brick/exec/queryContract.go +++ b/cmd/brick/exec/queryContract.go @@ -3,8 +3,8 @@ package exec import ( "fmt" - "github.com/aergoio/aergo/cmd/brick/context" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/brick/context" + "github.com/aergoio/aergo/v2/types" ) func init() { diff --git a/cmd/brick/exec/resetChain.go b/cmd/brick/exec/resetChain.go index 4e6582a6b..9e2385779 100644 --- a/cmd/brick/exec/resetChain.go +++ b/cmd/brick/exec/resetChain.go @@ -1,8 +1,8 @@ package exec import ( - "github.com/aergoio/aergo/cmd/brick/context" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/brick/context" + "github.com/aergoio/aergo/v2/types" ) func init() { diff --git a/cmd/brick/exec/search.go b/cmd/brick/exec/search.go index 5b2955436..6822985f7 100644 --- a/cmd/brick/exec/search.go +++ b/cmd/brick/exec/search.go @@ -7,7 +7,7 @@ import ( "path/filepath" "strings" - "github.com/aergoio/aergo/cmd/brick/context" + "github.com/aergoio/aergo/v2/cmd/brick/context" ) var index = make(map[string]map[string]string) diff --git a/cmd/brick/exec/sendCoin.go b/cmd/brick/exec/sendCoin.go index c04ff096c..e7c93dc5a 100644 --- a/cmd/brick/exec/sendCoin.go +++ b/cmd/brick/exec/sendCoin.go @@ -5,9 +5,9 @@ import ( "math/big" "strings" - "github.com/aergoio/aergo/cmd/brick/context" - "github.com/aergoio/aergo/contract/vm_dummy" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/brick/context" + "github.com/aergoio/aergo/v2/contract/vm_dummy" + "github.com/aergoio/aergo/v2/types" ) func init() { diff --git a/cmd/brick/exec/timestamp.go b/cmd/brick/exec/timestamp.go index bbe72aa91..f0690722b 100644 --- a/cmd/brick/exec/timestamp.go +++ b/cmd/brick/exec/timestamp.go @@ -4,8 +4,8 @@ import ( "fmt" "strconv" - "github.com/aergoio/aergo/cmd/brick/context" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/brick/context" + "github.com/aergoio/aergo/v2/types" ) func init() { diff --git a/cmd/brick/exec/undoCommit.go b/cmd/brick/exec/undoCommit.go index 5f7fb2f40..5c094e4a3 100644 --- a/cmd/brick/exec/undoCommit.go +++ b/cmd/brick/exec/undoCommit.go @@ -3,8 +3,8 @@ package exec import ( "fmt" - "github.com/aergoio/aergo/cmd/brick/context" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/brick/context" + "github.com/aergoio/aergo/v2/types" ) func init() { diff --git a/cmd/colaris/cmd/blacklist.go b/cmd/colaris/cmd/blacklist.go index cf58b5e25..3452ea547 100644 --- a/cmd/colaris/cmd/blacklist.go +++ b/cmd/colaris/cmd/blacklist.go @@ -9,8 +9,8 @@ import ( "context" "strconv" - "github.com/aergoio/aergo/cmd/aergocli/util" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/aergocli/util" + "github.com/aergoio/aergo/v2/types" "github.com/spf13/cobra" ) diff --git a/cmd/colaris/cmd/common.go b/cmd/colaris/cmd/common.go index dbe44f8fd..848e30338 100644 --- a/cmd/colaris/cmd/common.go +++ b/cmd/colaris/cmd/common.go @@ -8,8 +8,8 @@ package cmd import ( "fmt" - "github.com/aergoio/aergo/cmd/aergocli/util/encoding/json" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/aergocli/util/encoding/json" + "github.com/aergoio/aergo/v2/types" "github.com/golang/protobuf/proto" "google.golang.org/grpc" ) diff --git a/cmd/colaris/cmd/config.go b/cmd/colaris/cmd/config.go index 636edefc8..75750f28e 100644 --- a/cmd/colaris/cmd/config.go +++ b/cmd/colaris/cmd/config.go @@ -7,7 +7,7 @@ package cmd import ( "github.com/aergoio/aergo-lib/config" - "github.com/aergoio/aergo/polaris/common" + "github.com/aergoio/aergo/v2/polaris/common" ) const ( diff --git a/cmd/colaris/cmd/current.go b/cmd/colaris/cmd/current.go index dc9f6d2bd..4d971f197 100644 --- a/cmd/colaris/cmd/current.go +++ b/cmd/colaris/cmd/current.go @@ -9,11 +9,11 @@ import ( "context" "time" - "github.com/aergoio/aergo/cmd/aergocli/util" + "github.com/aergoio/aergo/v2/cmd/aergocli/util" "github.com/mr-tron/base58/base58" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" "github.com/spf13/cobra" ) diff --git a/cmd/colaris/cmd/metric.go b/cmd/colaris/cmd/metric.go index 63f804743..9b6e2145b 100644 --- a/cmd/colaris/cmd/metric.go +++ b/cmd/colaris/cmd/metric.go @@ -8,8 +8,8 @@ package cmd import ( "context" - "github.com/aergoio/aergo/cmd/aergocli/util" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/aergocli/util" + "github.com/aergoio/aergo/v2/types" "github.com/spf13/cobra" ) diff --git a/cmd/colaris/cmd/nodestate.go b/cmd/colaris/cmd/nodestate.go index 711d9bf0e..08b082109 100644 --- a/cmd/colaris/cmd/nodestate.go +++ b/cmd/colaris/cmd/nodestate.go @@ -9,7 +9,7 @@ import ( "context" "encoding/binary" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" "github.com/spf13/cobra" ) diff --git a/cmd/colaris/colaris.go b/cmd/colaris/colaris.go index 55104acc4..e3a8914b6 100644 --- a/cmd/colaris/colaris.go +++ b/cmd/colaris/colaris.go @@ -5,7 +5,7 @@ package main import ( - "github.com/aergoio/aergo/cmd/colaris/cmd" + "github.com/aergoio/aergo/v2/cmd/colaris/cmd" ) // rootCmd is the entry point for this binary diff --git a/cmd/polaris/polaris.go b/cmd/polaris/polaris.go index 27f8477b8..d18183dd6 100644 --- a/cmd/polaris/polaris.go +++ b/cmd/polaris/polaris.go @@ -12,12 +12,12 @@ import ( "github.com/aergoio/aergo-actor/actor" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/internal/common" - "github.com/aergoio/aergo/p2p/p2pkey" - "github.com/aergoio/aergo/pkg/component" - common2 "github.com/aergoio/aergo/polaris/common" - "github.com/aergoio/aergo/polaris/server" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/internal/common" + "github.com/aergoio/aergo/v2/p2p/p2pkey" + "github.com/aergoio/aergo/v2/pkg/component" + common2 "github.com/aergoio/aergo/v2/polaris/common" + "github.com/aergoio/aergo/v2/polaris/server" "github.com/spf13/cobra" ) diff --git a/cmd/polaris/polaris_test.go b/cmd/polaris/polaris_test.go index 90d0fc2e0..1817096b7 100644 --- a/cmd/polaris/polaris_test.go +++ b/cmd/polaris/polaris_test.go @@ -4,8 +4,8 @@ import ( _ "net/http/pprof" "testing" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/polaris/common" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/polaris/common" ) func Test_arrangeDefaultCfgForPolaris(t *testing.T) { diff --git a/config/config.go b/config/config.go index 09bf386b9..d0dec82e8 100644 --- a/config/config.go +++ b/config/config.go @@ -9,7 +9,7 @@ import ( "runtime" "github.com/aergoio/aergo-lib/config" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" ) const defaultDumpPort = 7070 diff --git a/config/hardfork.go b/config/hardfork.go index 0d72ddff3..beb7d3275 100644 --- a/config/hardfork.go +++ b/config/hardfork.go @@ -11,7 +11,7 @@ import ( "fmt" "strconv" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" ) type forkError struct { diff --git a/config/hardfork_gen.go b/config/hardfork_gen.go index b657c3eae..9d68c5f32 100644 --- a/config/hardfork_gen.go +++ b/config/hardfork_gen.go @@ -6,7 +6,7 @@ import ( "fmt" "reflect" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" ) var ( diff --git a/config/hardfork_gen/main.go b/config/hardfork_gen/main.go index 3d2687c64..5f7c8e07e 100644 --- a/config/hardfork_gen/main.go +++ b/config/hardfork_gen/main.go @@ -12,7 +12,7 @@ import ( "os" "text/template" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" ) var tpl = `// Code generated by go run main.go {{.Input}} {{.Output}}; DO NOT EDIT. @@ -23,7 +23,7 @@ import ( "fmt" "reflect" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" ) var ( diff --git a/consensus/chain/block.go b/consensus/chain/block.go index 298860a91..cbde03dfb 100644 --- a/consensus/chain/block.go +++ b/consensus/chain/block.go @@ -5,13 +5,13 @@ import ( "fmt" "time" - "github.com/aergoio/aergo/chain" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/chain" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" ) var ( diff --git a/consensus/chain/gathertx_test.go b/consensus/chain/gathertx_test.go index 27c18076a..f01412d8e 100644 --- a/consensus/chain/gathertx_test.go +++ b/consensus/chain/gathertx_test.go @@ -5,8 +5,8 @@ import ( "fmt" "testing" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" "github.com/stretchr/testify/assert" ) diff --git a/consensus/chain/tx.go b/consensus/chain/tx.go index 8f4731efd..ebdfd3501 100644 --- a/consensus/chain/tx.go +++ b/consensus/chain/tx.go @@ -10,13 +10,13 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/chain" - "github.com/aergoio/aergo/contract" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/chain" + "github.com/aergoio/aergo/v2/contract" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" "github.com/golang/protobuf/proto" ) diff --git a/consensus/consensus.go b/consensus/consensus.go index 1172b5c63..656c446cc 100644 --- a/consensus/consensus.go +++ b/consensus/consensus.go @@ -16,7 +16,7 @@ import ( "github.com/aergoio/aergo-lib/db" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" "github.com/aergoio/etcd/raft" "github.com/aergoio/etcd/raft/raftpb" ) diff --git a/consensus/impl/dpos/blockfactory.go b/consensus/impl/dpos/blockfactory.go index 89cd1a107..10dfb9d41 100644 --- a/consensus/impl/dpos/blockfactory.go +++ b/consensus/impl/dpos/blockfactory.go @@ -13,16 +13,16 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - bc "github.com/aergoio/aergo/chain" - "github.com/aergoio/aergo/consensus/chain" - "github.com/aergoio/aergo/consensus/impl/dpos/slot" - "github.com/aergoio/aergo/contract" - "github.com/aergoio/aergo/contract/system" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/p2p/p2pkey" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + bc "github.com/aergoio/aergo/v2/chain" + "github.com/aergoio/aergo/v2/consensus/chain" + "github.com/aergoio/aergo/v2/consensus/impl/dpos/slot" + "github.com/aergoio/aergo/v2/contract" + "github.com/aergoio/aergo/v2/contract/system" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/p2p/p2pkey" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" "github.com/davecgh/go-spew/spew" "github.com/libp2p/go-libp2p-core/crypto" ) diff --git a/consensus/impl/dpos/bp/cluster.go b/consensus/impl/dpos/bp/cluster.go index 4002b5599..00447e060 100644 --- a/consensus/impl/dpos/bp/cluster.go +++ b/consensus/impl/dpos/bp/cluster.go @@ -14,11 +14,11 @@ import ( "sync" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/contract/system" - "github.com/aergoio/aergo/internal/common" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/contract/system" + "github.com/aergoio/aergo/v2/internal/common" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" "github.com/davecgh/go-spew/spew" ) diff --git a/consensus/impl/dpos/dpos.go b/consensus/impl/dpos/dpos.go index 6168de7b3..e98e0035e 100644 --- a/consensus/impl/dpos/dpos.go +++ b/consensus/impl/dpos/dpos.go @@ -13,16 +13,16 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/chain" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/consensus/impl/dpos/bp" - "github.com/aergoio/aergo/consensus/impl/dpos/slot" - "github.com/aergoio/aergo/contract/system" - "github.com/aergoio/aergo/p2p/p2pkey" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/chain" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/consensus/impl/dpos/bp" + "github.com/aergoio/aergo/v2/consensus/impl/dpos/slot" + "github.com/aergoio/aergo/v2/contract/system" + "github.com/aergoio/aergo/v2/p2p/p2pkey" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" ) var ( diff --git a/consensus/impl/dpos/dpos_test.go b/consensus/impl/dpos/dpos_test.go index 250eb43ed..42f5557dd 100644 --- a/consensus/impl/dpos/dpos_test.go +++ b/consensus/impl/dpos/dpos_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" - "github.com/aergoio/aergo/consensus/impl/dpos/slot" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/consensus/impl/dpos/slot" + "github.com/aergoio/aergo/v2/types" "github.com/stretchr/testify/assert" ) diff --git a/consensus/impl/dpos/lib.go b/consensus/impl/dpos/lib.go index d27ee11ed..e6c825196 100644 --- a/consensus/impl/dpos/lib.go +++ b/consensus/impl/dpos/lib.go @@ -6,10 +6,10 @@ import ( "sort" "github.com/aergoio/aergo-lib/db" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/internal/common" - "github.com/aergoio/aergo/p2p/p2pkey" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/internal/common" + "github.com/aergoio/aergo/v2/p2p/p2pkey" + "github.com/aergoio/aergo/v2/types" "github.com/davecgh/go-spew/spew" ) diff --git a/consensus/impl/dpos/lib_test.go b/consensus/impl/dpos/lib_test.go index 022edb355..d8fa41427 100644 --- a/consensus/impl/dpos/lib_test.go +++ b/consensus/impl/dpos/lib_test.go @@ -4,8 +4,8 @@ import ( "fmt" "testing" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/types" "github.com/libp2p/go-libp2p-core/crypto" "github.com/stretchr/testify/assert" ) diff --git a/consensus/impl/dpos/slot/slot.go b/consensus/impl/dpos/slot/slot.go index 675789ba8..b56cc1060 100644 --- a/consensus/impl/dpos/slot/slot.go +++ b/consensus/impl/dpos/slot/slot.go @@ -3,7 +3,7 @@ package slot import ( "time" - "github.com/aergoio/aergo/consensus/impl/dpos/bp" + "github.com/aergoio/aergo/v2/consensus/impl/dpos/bp" ) var ( diff --git a/consensus/impl/dpos/status.go b/consensus/impl/dpos/status.go index d1160cbb8..8fa303a02 100644 --- a/consensus/impl/dpos/status.go +++ b/consensus/impl/dpos/status.go @@ -4,10 +4,10 @@ import ( "encoding/json" "sync" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/consensus/impl/dpos/bp" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/consensus/impl/dpos/bp" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" ) var bsLoader *bootLoader diff --git a/consensus/impl/impl.go b/consensus/impl/impl.go index 2853bee22..0512768d1 100644 --- a/consensus/impl/impl.go +++ b/consensus/impl/impl.go @@ -8,17 +8,17 @@ package impl import ( "strings" - "github.com/aergoio/aergo/chain" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/consensus/impl/dpos" - "github.com/aergoio/aergo/consensus/impl/raftv2" - "github.com/aergoio/aergo/consensus/impl/sbp" - "github.com/aergoio/aergo/p2p" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/rpc" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/chain" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/consensus/impl/dpos" + "github.com/aergoio/aergo/v2/consensus/impl/raftv2" + "github.com/aergoio/aergo/v2/consensus/impl/sbp" + "github.com/aergoio/aergo/v2/p2p" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/rpc" + "github.com/aergoio/aergo/v2/types" ) // New returns consensus.Consensus based on the configuration parameters. diff --git a/consensus/impl/raftv2/blockfactory.go b/consensus/impl/raftv2/blockfactory.go index 148746967..dc9afb111 100644 --- a/consensus/impl/raftv2/blockfactory.go +++ b/consensus/impl/raftv2/blockfactory.go @@ -12,18 +12,18 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - bc "github.com/aergoio/aergo/chain" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/consensus/chain" - "github.com/aergoio/aergo/contract" - "github.com/aergoio/aergo/contract/system" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pkey" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + bc "github.com/aergoio/aergo/v2/chain" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/consensus/chain" + "github.com/aergoio/aergo/v2/contract" + "github.com/aergoio/aergo/v2/contract/system" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pkey" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" "github.com/libp2p/go-libp2p-core/crypto" ) diff --git a/consensus/impl/raftv2/cluster.go b/consensus/impl/raftv2/cluster.go index ac334c7e3..8c8662aae 100644 --- a/consensus/impl/raftv2/cluster.go +++ b/consensus/impl/raftv2/cluster.go @@ -12,12 +12,12 @@ import ( "sync" "time" - "github.com/aergoio/aergo/cmd/aergocli/util" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/aergocli/util" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/types" raftlib "github.com/aergoio/etcd/raft" "github.com/aergoio/etcd/raft/raftpb" ) diff --git a/consensus/impl/raftv2/cluster_test.go b/consensus/impl/raftv2/cluster_test.go index 57fdfa82e..85d6e0c89 100644 --- a/consensus/impl/raftv2/cluster_test.go +++ b/consensus/impl/raftv2/cluster_test.go @@ -4,9 +4,9 @@ import ( "encoding/json" "testing" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/types" "github.com/stretchr/testify/assert" ) diff --git a/consensus/impl/raftv2/config.go b/consensus/impl/raftv2/config.go index c81d56bb9..0d807e716 100644 --- a/consensus/impl/raftv2/config.go +++ b/consensus/impl/raftv2/config.go @@ -6,12 +6,12 @@ import ( "strings" "time" - "github.com/aergoio/aergo/chain" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pkey" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/chain" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pkey" + "github.com/aergoio/aergo/v2/types" ) var ( diff --git a/consensus/impl/raftv2/p2p.go b/consensus/impl/raftv2/p2p.go index 1fba73dc0..1bad4f8ea 100644 --- a/consensus/impl/raftv2/p2p.go +++ b/consensus/impl/raftv2/p2p.go @@ -4,9 +4,9 @@ import ( "errors" "time" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/types" ) var ( diff --git a/consensus/impl/raftv2/raftserver.go b/consensus/impl/raftv2/raftserver.go index 541372bf2..33307fa20 100644 --- a/consensus/impl/raftv2/raftserver.go +++ b/consensus/impl/raftv2/raftserver.go @@ -28,12 +28,12 @@ import ( "sync" "time" - "github.com/aergoio/aergo/chain" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/chain" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/types" "github.com/aergoio/etcd/etcdserver/stats" etcdtypes "github.com/aergoio/etcd/pkg/types" raftlib "github.com/aergoio/etcd/raft" diff --git a/consensus/impl/raftv2/snapshot.go b/consensus/impl/raftv2/snapshot.go index e5a05a03c..fd4a95d40 100644 --- a/consensus/impl/raftv2/snapshot.go +++ b/consensus/impl/raftv2/snapshot.go @@ -6,13 +6,13 @@ import ( "sync" "time" - chainsvc "github.com/aergoio/aergo/chain" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/consensus/chain" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/types" + chainsvc "github.com/aergoio/aergo/v2/chain" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/consensus/chain" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/types" "github.com/aergoio/etcd/raft/raftpb" ) diff --git a/consensus/impl/raftv2/transport.go b/consensus/impl/raftv2/transport.go index ead7822b0..fa8839b04 100644 --- a/consensus/impl/raftv2/transport.go +++ b/consensus/impl/raftv2/transport.go @@ -9,7 +9,7 @@ import ( "net/http" "time" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" rtypes "github.com/aergoio/etcd/pkg/types" "github.com/aergoio/etcd/raft/raftpb" "github.com/aergoio/etcd/rafthttp" diff --git a/consensus/impl/raftv2/waldb.go b/consensus/impl/raftv2/waldb.go index 97b93802a..e5ea39335 100644 --- a/consensus/impl/raftv2/waldb.go +++ b/consensus/impl/raftv2/waldb.go @@ -3,8 +3,8 @@ package raftv2 import ( "errors" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/types" "github.com/aergoio/etcd/raft" "github.com/aergoio/etcd/raft/raftpb" ) diff --git a/consensus/impl/sbp/sbp.go b/consensus/impl/sbp/sbp.go index 2160d1788..48e6b5994 100644 --- a/consensus/impl/sbp/sbp.go +++ b/consensus/impl/sbp/sbp.go @@ -5,16 +5,16 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - bc "github.com/aergoio/aergo/chain" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/consensus/chain" - "github.com/aergoio/aergo/contract" - "github.com/aergoio/aergo/contract/system" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + bc "github.com/aergoio/aergo/v2/chain" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/consensus/chain" + "github.com/aergoio/aergo/v2/contract" + "github.com/aergoio/aergo/v2/contract/system" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" ) const ( diff --git a/consensus/raftCommon.go b/consensus/raftCommon.go index e9080a1ab..4bcbd42f4 100644 --- a/consensus/raftCommon.go +++ b/consensus/raftCommon.go @@ -11,8 +11,8 @@ import ( "fmt" "io" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/types" "github.com/aergoio/etcd/raft" "github.com/aergoio/etcd/raft/raftpb" ) diff --git a/contract/contract.go b/contract/contract.go index 8aed7449d..f77b0bd5f 100644 --- a/contract/contract.go +++ b/contract/contract.go @@ -8,9 +8,9 @@ import ( "regexp" "strconv" - "github.com/aergoio/aergo/fee" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/fee" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" "github.com/minio/sha256-simd" ) diff --git a/contract/enterprise/admin.go b/contract/enterprise/admin.go index caede6efb..f9874a929 100644 --- a/contract/enterprise/admin.go +++ b/contract/enterprise/admin.go @@ -3,8 +3,8 @@ package enterprise import ( "bytes" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" ) const AdminsKey = "ADMINS" diff --git a/contract/enterprise/changecluster.go b/contract/enterprise/changecluster.go index c29554603..fd1725c1d 100644 --- a/contract/enterprise/changecluster.go +++ b/contract/enterprise/changecluster.go @@ -5,7 +5,7 @@ import ( "reflect" "strconv" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" ) type CcArgument map[string]interface{} diff --git a/contract/enterprise/config.go b/contract/enterprise/config.go index b75e4d676..f3bd44d6d 100644 --- a/contract/enterprise/config.go +++ b/contract/enterprise/config.go @@ -4,8 +4,8 @@ import ( "fmt" "strings" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" ) var confPrefix = []byte("conf\\") diff --git a/contract/enterprise/config_test.go b/contract/enterprise/config_test.go index 0adc872dc..6168a0fc6 100644 --- a/contract/enterprise/config_test.go +++ b/contract/enterprise/config_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/aergoio/aergo-lib/db" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" "github.com/stretchr/testify/assert" ) diff --git a/contract/enterprise/execute.go b/contract/enterprise/execute.go index 0170e9ed9..61ca90528 100644 --- a/contract/enterprise/execute.go +++ b/contract/enterprise/execute.go @@ -8,9 +8,9 @@ import ( "strings" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" ) var ( diff --git a/contract/enterprise/execute_test.go b/contract/enterprise/execute_test.go index 87354ded3..4ed14027b 100644 --- a/contract/enterprise/execute_test.go +++ b/contract/enterprise/execute_test.go @@ -5,9 +5,9 @@ import ( "strings" "testing" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" "github.com/stretchr/testify/assert" ) diff --git a/contract/enterprise/validate.go b/contract/enterprise/validate.go index 2905eb67a..142c9bacf 100644 --- a/contract/enterprise/validate.go +++ b/contract/enterprise/validate.go @@ -8,9 +8,9 @@ import ( "fmt" "strings" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" ) const SetConf = "setConf" diff --git a/contract/hook_dbg.go b/contract/hook_dbg.go index 27575a622..72f6a05e0 100644 --- a/contract/hook_dbg.go +++ b/contract/hook_dbg.go @@ -15,7 +15,7 @@ import ( "fmt" "path/filepath" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" ) type contract_info struct { diff --git a/contract/measure/main.go b/contract/measure/main.go index 214edb987..b02d2d81f 100644 --- a/contract/measure/main.go +++ b/contract/measure/main.go @@ -7,8 +7,8 @@ import ( "io/ioutil" "log" - "github.com/aergoio/aergo/contract/vm_dummy" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/contract/vm_dummy" + "github.com/aergoio/aergo/v2/types" ) func main() { diff --git a/contract/name/execute.go b/contract/name/execute.go index 976905a9c..b3858f425 100644 --- a/contract/name/execute.go +++ b/contract/name/execute.go @@ -6,9 +6,9 @@ import ( "errors" "fmt" - "github.com/aergoio/aergo/contract/system" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/contract/system" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" ) func ExecuteNameTx(bs *state.BlockState, scs *state.ContractState, txBody *types.TxBody, diff --git a/contract/name/execute_test.go b/contract/name/execute_test.go index fe276c3c8..4a16f2cde 100644 --- a/contract/name/execute_test.go +++ b/contract/name/execute_test.go @@ -3,8 +3,8 @@ package name import ( "testing" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" "github.com/stretchr/testify/assert" ) diff --git a/contract/name/name.go b/contract/name/name.go index 3021fe7dd..39e7efebb 100644 --- a/contract/name/name.go +++ b/contract/name/name.go @@ -5,8 +5,8 @@ import ( "fmt" "strings" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" ) var prefix = []byte("name") diff --git a/contract/name/name_test.go b/contract/name/name_test.go index b05a10623..7ca8e37ba 100644 --- a/contract/name/name_test.go +++ b/contract/name/name_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/aergoio/aergo-lib/db" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" "github.com/stretchr/testify/assert" ) diff --git a/contract/statesql.go b/contract/statesql.go index de77c5e74..d5fd02547 100644 --- a/contract/statesql.go +++ b/contract/statesql.go @@ -15,9 +15,9 @@ import ( "sync" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" ) var ( diff --git a/contract/system/execute.go b/contract/system/execute.go index 64fe2d6eb..b971c414a 100644 --- a/contract/system/execute.go +++ b/contract/system/execute.go @@ -10,8 +10,8 @@ import ( "fmt" "math/big" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" "github.com/mr-tron/base58" ) diff --git a/contract/system/execute_test.go b/contract/system/execute_test.go index cbdb282c6..82ae494b7 100644 --- a/contract/system/execute_test.go +++ b/contract/system/execute_test.go @@ -8,8 +8,8 @@ import ( "math/big" "testing" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/types" "github.com/mr-tron/base58/base58" "github.com/stretchr/testify/assert" ) diff --git a/contract/system/param.go b/contract/system/param.go index 9ac68b06d..a4fe2ba1a 100644 --- a/contract/system/param.go +++ b/contract/system/param.go @@ -4,8 +4,8 @@ import ( "math/big" "strings" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" ) type parameters map[string]*big.Int diff --git a/contract/system/proposal.go b/contract/system/proposal.go index fb64f71e6..d79d6df1e 100644 --- a/contract/system/proposal.go +++ b/contract/system/proposal.go @@ -6,7 +6,7 @@ import ( "math/big" "strings" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" ) const proposalPrefixKey = "proposal" //aergo proposal format diff --git a/contract/system/proposal_test.go b/contract/system/proposal_test.go index b2dd748d9..e462508d9 100644 --- a/contract/system/proposal_test.go +++ b/contract/system/proposal_test.go @@ -5,9 +5,9 @@ import ( "math/big" "testing" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" "github.com/stretchr/testify/assert" ) diff --git a/contract/system/staking.go b/contract/system/staking.go index 9fedbaf90..fec058c84 100644 --- a/contract/system/staking.go +++ b/contract/system/staking.go @@ -9,8 +9,8 @@ import ( "errors" "math/big" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" ) var consensusType string diff --git a/contract/system/staking_test.go b/contract/system/staking_test.go index cba2170b7..f9c8ed102 100644 --- a/contract/system/staking_test.go +++ b/contract/system/staking_test.go @@ -9,7 +9,7 @@ import ( "math/big" "testing" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" "github.com/stretchr/testify/assert" ) diff --git a/contract/system/validation.go b/contract/system/validation.go index ddb6333dc..cf3fcd37c 100644 --- a/contract/system/validation.go +++ b/contract/system/validation.go @@ -8,8 +8,8 @@ import ( "sort" "strings" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" ) var ErrTxSystemOperatorIsNotSet = errors.New("operator is not set") diff --git a/contract/system/vote.go b/contract/system/vote.go index 98b266ae2..9c809aaaa 100644 --- a/contract/system/vote.go +++ b/contract/system/vote.go @@ -12,9 +12,9 @@ import ( "math/big" "strings" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" "github.com/mr-tron/base58" ) diff --git a/contract/system/vote_test.go b/contract/system/vote_test.go index 8b7e4c702..0b19c618e 100644 --- a/contract/system/vote_test.go +++ b/contract/system/vote_test.go @@ -14,8 +14,8 @@ import ( "testing" "github.com/aergoio/aergo-lib/db" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" "github.com/libp2p/go-libp2p-core/crypto" "github.com/mr-tron/base58" "github.com/stretchr/testify/assert" diff --git a/contract/system/voteresult.go b/contract/system/voteresult.go index dddfd5f57..33d9aded0 100644 --- a/contract/system/voteresult.go +++ b/contract/system/voteresult.go @@ -8,9 +8,9 @@ import ( "math/big" "sort" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" "github.com/mr-tron/base58" ) diff --git a/contract/system/vprt.go b/contract/system/vprt.go index 1b8fb192c..6d7ed9f63 100644 --- a/contract/system/vprt.go +++ b/contract/system/vprt.go @@ -12,9 +12,9 @@ import ( "reflect" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" rb "github.com/emirpasic/gods/trees/redblacktree" jsoniter "github.com/json-iterator/go" "github.com/sanity-io/litter" diff --git a/contract/system/vprt_test.go b/contract/system/vprt_test.go index 56f04f619..4a616b9cd 100644 --- a/contract/system/vprt_test.go +++ b/contract/system/vprt_test.go @@ -9,9 +9,9 @@ import ( "testing" "github.com/aergoio/aergo-lib/db" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" "github.com/stretchr/testify/assert" ) diff --git a/contract/vm.go b/contract/vm.go index 02a51b405..ca69e3b05 100644 --- a/contract/vm.go +++ b/contract/vm.go @@ -36,11 +36,11 @@ import ( "unsafe" "github.com/aergoio/aergo-lib/log" - luacUtil "github.com/aergoio/aergo/cmd/aergoluac/util" - "github.com/aergoio/aergo/fee" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + luacUtil "github.com/aergoio/aergo/v2/cmd/aergoluac/util" + "github.com/aergoio/aergo/v2/fee" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" jsoniter "github.com/json-iterator/go" ) diff --git a/contract/vm_callback.go b/contract/vm_callback.go index 842dca197..226c85ac0 100644 --- a/contract/vm_callback.go +++ b/contract/vm_callback.go @@ -36,13 +36,13 @@ import ( "strings" "unsafe" - "github.com/aergoio/aergo/cmd/aergoluac/util" - "github.com/aergoio/aergo/contract/name" - "github.com/aergoio/aergo/contract/system" - "github.com/aergoio/aergo/internal/common" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/aergoluac/util" + "github.com/aergoio/aergo/v2/contract/name" + "github.com/aergoio/aergo/v2/contract/system" + "github.com/aergoio/aergo/v2/internal/common" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" "github.com/btcsuite/btcd/btcec" "github.com/minio/sha256-simd" ) diff --git a/contract/vm_dummy/vm_dummy.go b/contract/vm_dummy/vm_dummy.go index e29790402..12498f86f 100644 --- a/contract/vm_dummy/vm_dummy.go +++ b/contract/vm_dummy/vm_dummy.go @@ -14,14 +14,14 @@ import ( "github.com/aergoio/aergo-lib/db" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/cmd/aergoluac/util" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/contract" - "github.com/aergoio/aergo/contract/system" - "github.com/aergoio/aergo/fee" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/aergoluac/util" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/contract" + "github.com/aergoio/aergo/v2/contract/system" + "github.com/aergoio/aergo/v2/fee" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" sha256 "github.com/minio/sha256-simd" ) @@ -560,11 +560,11 @@ func NewLuaTxCall(sender, recipient string, amount uint64, payload string) *luaT func NewLuaTxCallBig(sender, recipient string, amount *big.Int, payload string) *luaTxCall { return &luaTxCall{ luaTxContractCommon: luaTxContractCommon{ - _sender: contract.StrHash(sender), + _sender: contract.StrHash(sender), _recipient: contract.StrHash(recipient), - _amount: amount, - _payload: []byte(payload), - txId: newTxId(), + _amount: amount, + _payload: []byte(payload), + txId: newTxId(), }, } } @@ -573,7 +573,7 @@ func NewLuaTxCallFeeDelegate(sender, recipient string, amount uint64, payload st return &luaTxCall{ luaTxContractCommon: luaTxContractCommon{ _sender: contract.StrHash(sender), - _recipient: contract.StrHash(recipient), + _recipient: contract.StrHash(recipient), _amount: types.NewAmount(amount, types.Aer), _payload: []byte(payload), txId: newTxId(), diff --git a/contract/vm_dummy/vm_dummy_dbg.go b/contract/vm_dummy/vm_dummy_dbg.go index 0fa8ca7e9..1a5ea3812 100644 --- a/contract/vm_dummy/vm_dummy_dbg.go +++ b/contract/vm_dummy/vm_dummy_dbg.go @@ -4,8 +4,8 @@ package vm_dummy import ( - luacUtil "github.com/aergoio/aergo/cmd/aergoluac/util" - "github.com/aergoio/aergo/contract" + luacUtil "github.com/aergoio/aergo/v2/cmd/aergoluac/util" + "github.com/aergoio/aergo/v2/contract" "math/big" ) diff --git a/contract/vm_dummy/vm_dummy_release.go b/contract/vm_dummy/vm_dummy_release.go index c9fd703a0..f0a89f954 100644 --- a/contract/vm_dummy/vm_dummy_release.go +++ b/contract/vm_dummy/vm_dummy_release.go @@ -6,8 +6,8 @@ package vm_dummy import ( "math/big" - "github.com/aergoio/aergo/cmd/aergoluac/util" - "github.com/aergoio/aergo/contract" + "github.com/aergoio/aergo/v2/cmd/aergoluac/util" + "github.com/aergoio/aergo/v2/contract" ) func NewLuaTxDeployBig(sender, recipient string, amount *big.Int, code string) *luaTxDeploy { diff --git a/contract/vm_dummy/vm_dummy_test.go b/contract/vm_dummy/vm_dummy_test.go index ec7ad7cf3..4dae49020 100644 --- a/contract/vm_dummy/vm_dummy_test.go +++ b/contract/vm_dummy/vm_dummy_test.go @@ -12,8 +12,8 @@ import ( "strings" "testing" - "github.com/aergoio/aergo/contract" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/contract" + "github.com/aergoio/aergo/v2/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -2556,257 +2556,257 @@ func TestGasPerFunction(t *testing.T) { assert.NoError(t, err, "sending funds to contracts") tests_v2 := []struct { - funcName string - funcArgs string - amount int64 + funcName string + funcArgs string + amount int64 expectedGas int64 }{ - { "comp_ops", "", 0, 134635 }, - { "unarytest_n_copy_ops", "", 0, 134548 }, - { "unary_ops", "", 0, 134947 }, - { "binary_ops", "", 0, 136470 }, - { "constant_ops", "", 0, 134463 }, - { "upvalue_n_func_ops", "", 0, 135742 }, - { "table_ops", "", 0, 135733 }, - { "call_n_vararg_ops", "", 0, 136396 }, - { "return_ops", "", 0, 134468 }, - { "loop_n_branche_ops", "", 0, 137803 }, - { "function_header_ops", "", 0, 134447 }, - - { "assert", "", 0, 134577 }, - { "getfenv", "", 0, 134472 }, - { "metatable", "", 0, 135383 }, - { "ipairs", "", 0, 134470 }, - { "pairs", "", 0, 134470 }, - { "next", "", 0, 134518 }, - { "rawequal", "", 0, 134647 }, - { "rawget", "", 0, 134518 }, - { "rawset", "", 0, 135336 }, - { "select", "", 0, 134597 }, - { "setfenv", "", 0, 134507 }, - { "tonumber", "", 0, 134581 }, - { "tostring", "", 0, 134852 }, - { "type", "", 0, 134680 }, - { "unpack", "", 0, 142140 }, - { "pcall", "", 0, 138169 }, - { "xpcall", "", 0, 138441 }, - - { "string.byte", "", 0, 148435 }, - { "string.char", "", 0, 151792 }, - { "string.dump", "", 0, 138300 }, - { "string.find", "", 0, 139239 }, - { "string.format", "", 0, 135159 }, - { "string.gmatch", "", 0, 135194 }, - { "string.gsub", "", 0, 136338 }, - { "string.len", "", 0, 134528 }, - { "string.lower", "", 0, 139746 }, - { "string.match", "", 0, 134708 }, - { "string.rep", "", 0, 213323 }, - { "string.reverse", "", 0, 139746 }, - { "string.sub", "", 0, 136600 }, - { "string.upper", "", 0, 139746 }, - - { "table.concat", "", 0, 155263 }, - { "table.insert", "", 0, 288649 }, - { "table.remove", "", 0, 148059 }, - { "table.maxn", "", 0, 139357 }, - { "table.sort", "", 0, 151261 }, - - { "math.abs", "", 0, 134615 }, - { "math.ceil", "", 0, 134615 }, - { "math.floor", "", 0, 134615 }, - { "math.max", "", 0, 134987 }, - { "math.min", "", 0, 134987 }, - { "math.pow", "", 0, 134975 }, - - { "bit.tobit", "", 0, 134510 }, - { "bit.tohex", "", 0, 134985 }, - { "bit.bnot", "", 0, 134487 }, - { "bit.bor", "", 0, 134561 }, - { "bit.band", "", 0, 134537 }, - { "bit.xor", "", 0, 134537 }, - { "bit.lshift", "", 0, 134510 }, - { "bit.rshift", "", 0, 134510 }, - { "bit.ashift", "", 0, 134510 }, - { "bit.rol", "", 0, 134510 }, - { "bit.ror", "", 0, 134510 }, - { "bit.bswap", "", 0, 134467 }, - - { "bignum.number", "", 0, 136307 }, - { "bignum.isneg", "", 0, 136539 }, - { "bignum.iszero", "", 0, 136539 }, - { "bignum.tonumber", "", 0, 136859 }, - { "bignum.tostring", "", 0, 137150 }, - { "bignum.neg", "", 0, 138603 }, - { "bignum.sqrt", "", 0, 139479 }, - { "bignum.compare", "", 0, 136804 }, - { "bignum.add", "", 0, 138145 }, - { "bignum.sub", "", 0, 138090 }, - { "bignum.mul", "", 0, 140468 }, - { "bignum.div", "", 0, 139958 }, - { "bignum.mod", "", 0, 141893 }, - { "bignum.pow", "", 0, 140887 }, - { "bignum.divmod", "", 0, 146193 }, - { "bignum.powmod", "", 0, 145559 }, - { "bignum.operators", "", 0, 138811 }, - - { "json", "", 0, 142320 }, - - { "crypto.sha256", "", 0, 137578 }, - { "crypto.ecverify", "", 0, 139467 }, - - { "state.set", "", 0, 137310 }, - { "state.get", "", 0, 137115 }, - { "state.delete", "", 0, 137122 }, - - { "system.getSender", "", 0, 135656 }, - { "system.getBlockheight", "", 0, 134761 }, - { "system.getTxhash", "", 0, 135132 }, - { "system.getTimestamp", "", 0, 134761 }, - { "system.getContractID", "", 0, 135656 }, - { "system.setItem", "", 0, 135589 }, - { "system.getItem", "", 0, 135898 }, - { "system.getAmount", "", 0, 134803 }, - { "system.getCreator", "", 0, 135156 }, - { "system.getOrigin", "", 0, 135656 }, + {"comp_ops", "", 0, 134635}, + {"unarytest_n_copy_ops", "", 0, 134548}, + {"unary_ops", "", 0, 134947}, + {"binary_ops", "", 0, 136470}, + {"constant_ops", "", 0, 134463}, + {"upvalue_n_func_ops", "", 0, 135742}, + {"table_ops", "", 0, 135733}, + {"call_n_vararg_ops", "", 0, 136396}, + {"return_ops", "", 0, 134468}, + {"loop_n_branche_ops", "", 0, 137803}, + {"function_header_ops", "", 0, 134447}, + + {"assert", "", 0, 134577}, + {"getfenv", "", 0, 134472}, + {"metatable", "", 0, 135383}, + {"ipairs", "", 0, 134470}, + {"pairs", "", 0, 134470}, + {"next", "", 0, 134518}, + {"rawequal", "", 0, 134647}, + {"rawget", "", 0, 134518}, + {"rawset", "", 0, 135336}, + {"select", "", 0, 134597}, + {"setfenv", "", 0, 134507}, + {"tonumber", "", 0, 134581}, + {"tostring", "", 0, 134852}, + {"type", "", 0, 134680}, + {"unpack", "", 0, 142140}, + {"pcall", "", 0, 138169}, + {"xpcall", "", 0, 138441}, + + {"string.byte", "", 0, 148435}, + {"string.char", "", 0, 151792}, + {"string.dump", "", 0, 138300}, + {"string.find", "", 0, 139239}, + {"string.format", "", 0, 135159}, + {"string.gmatch", "", 0, 135194}, + {"string.gsub", "", 0, 136338}, + {"string.len", "", 0, 134528}, + {"string.lower", "", 0, 139746}, + {"string.match", "", 0, 134708}, + {"string.rep", "", 0, 213323}, + {"string.reverse", "", 0, 139746}, + {"string.sub", "", 0, 136600}, + {"string.upper", "", 0, 139746}, + + {"table.concat", "", 0, 155263}, + {"table.insert", "", 0, 288649}, + {"table.remove", "", 0, 148059}, + {"table.maxn", "", 0, 139357}, + {"table.sort", "", 0, 151261}, + + {"math.abs", "", 0, 134615}, + {"math.ceil", "", 0, 134615}, + {"math.floor", "", 0, 134615}, + {"math.max", "", 0, 134987}, + {"math.min", "", 0, 134987}, + {"math.pow", "", 0, 134975}, + + {"bit.tobit", "", 0, 134510}, + {"bit.tohex", "", 0, 134985}, + {"bit.bnot", "", 0, 134487}, + {"bit.bor", "", 0, 134561}, + {"bit.band", "", 0, 134537}, + {"bit.xor", "", 0, 134537}, + {"bit.lshift", "", 0, 134510}, + {"bit.rshift", "", 0, 134510}, + {"bit.ashift", "", 0, 134510}, + {"bit.rol", "", 0, 134510}, + {"bit.ror", "", 0, 134510}, + {"bit.bswap", "", 0, 134467}, + + {"bignum.number", "", 0, 136307}, + {"bignum.isneg", "", 0, 136539}, + {"bignum.iszero", "", 0, 136539}, + {"bignum.tonumber", "", 0, 136859}, + {"bignum.tostring", "", 0, 137150}, + {"bignum.neg", "", 0, 138603}, + {"bignum.sqrt", "", 0, 139479}, + {"bignum.compare", "", 0, 136804}, + {"bignum.add", "", 0, 138145}, + {"bignum.sub", "", 0, 138090}, + {"bignum.mul", "", 0, 140468}, + {"bignum.div", "", 0, 139958}, + {"bignum.mod", "", 0, 141893}, + {"bignum.pow", "", 0, 140887}, + {"bignum.divmod", "", 0, 146193}, + {"bignum.powmod", "", 0, 145559}, + {"bignum.operators", "", 0, 138811}, + + {"json", "", 0, 142320}, + + {"crypto.sha256", "", 0, 137578}, + {"crypto.ecverify", "", 0, 139467}, + + {"state.set", "", 0, 137310}, + {"state.get", "", 0, 137115}, + {"state.delete", "", 0, 137122}, + + {"system.getSender", "", 0, 135656}, + {"system.getBlockheight", "", 0, 134761}, + {"system.getTxhash", "", 0, 135132}, + {"system.getTimestamp", "", 0, 134761}, + {"system.getContractID", "", 0, 135656}, + {"system.setItem", "", 0, 135589}, + {"system.getItem", "", 0, 135898}, + {"system.getAmount", "", 0, 134803}, + {"system.getCreator", "", 0, 135156}, + {"system.getOrigin", "", 0, 135656}, // as the returned value differs in length (43 or 44) // due to base58, the computed gas is different. //{ "system.getPrevBlockHash", "", 0, 135132 }, - { "contract.send", "", 0, 135716 }, - { "contract.balance", "", 0, 135605 }, - { "contract.deploy", "", 0, 158752 }, - { "contract.call", "", 0, 149642 }, - { "contract.pcall", "", 0, 150563 }, - { "contract.delegatecall", "", 0, 144902 }, - { "contract.event", "", 0, 153263 }, + {"contract.send", "", 0, 135716}, + {"contract.balance", "", 0, 135605}, + {"contract.deploy", "", 0, 158752}, + {"contract.call", "", 0, 149642}, + {"contract.pcall", "", 0, 150563}, + {"contract.delegatecall", "", 0, 144902}, + {"contract.event", "", 0, 153263}, } tests_v3 := []struct { - funcName string - funcArgs string - amount int64 + funcName string + funcArgs string + amount int64 expectedGas int64 }{ - { "comp_ops", "", 0, 134635 }, - { "unarytest_n_copy_ops", "", 0, 134548 }, - { "unary_ops", "", 0, 134947 }, - { "binary_ops", "", 0, 136470 }, - { "constant_ops", "", 0, 134463 }, - { "upvalue_n_func_ops", "", 0, 135742 }, - { "table_ops", "", 0, 135733 }, - { "call_n_vararg_ops", "", 0, 136396 }, - { "return_ops", "", 0, 134468 }, - { "loop_n_branche_ops", "", 0, 137803 }, - { "function_header_ops", "", 0, 134447 }, - - { "assert", "", 0, 134577 }, - { "getfenv", "", 0, 134472 }, - { "metatable", "", 0, 135383 }, - { "ipairs", "", 0, 134470 }, - { "pairs", "", 0, 134470 }, - { "next", "", 0, 134518 }, - { "rawequal", "", 0, 134647 }, - { "rawget", "", 0, 134518 }, - { "rawset", "", 0, 135336 }, - { "select", "", 0, 134597 }, - { "setfenv", "", 0, 134507 }, - { "tonumber", "", 0, 134581 }, - { "tostring", "", 0, 134852 }, - { "type", "", 0, 134680 }, - { "unpack", "", 0, 142140 }, - { "pcall", "", 0, 137560 }, - { "xpcall", "", 0, 137832 }, - - { "string.byte", "", 0, 148435 }, - { "string.char", "", 0, 151792 }, - { "string.dump", "", 0, 138261 }, - { "string.find", "", 0, 139239 }, - { "string.format", "", 0, 135159 }, - { "string.gmatch", "", 0, 135194 }, - { "string.gsub", "", 0, 136338 }, - { "string.len", "", 0, 134528 }, - { "string.lower", "", 0, 139746 }, - { "string.match", "", 0, 134708 }, - { "string.rep", "", 0, 213323 }, - { "string.reverse", "", 0, 139746 }, - { "string.sub", "", 0, 136600 }, - { "string.upper", "", 0, 139746 }, - - { "table.concat", "", 0, 155263 }, - { "table.insert", "", 0, 288649 }, - { "table.remove", "", 0, 148059 }, - { "table.maxn", "", 0, 139357 }, - { "table.sort", "", 0, 151261 }, - - { "math.abs", "", 0, 134615 }, - { "math.ceil", "", 0, 134615 }, - { "math.floor", "", 0, 134615 }, - { "math.max", "", 0, 134987 }, - { "math.min", "", 0, 134987 }, - { "math.pow", "", 0, 134975 }, - - { "bit.tobit", "", 0, 134510 }, - { "bit.tohex", "", 0, 134985 }, - { "bit.bnot", "", 0, 134487 }, - { "bit.bor", "", 0, 134561 }, - { "bit.band", "", 0, 134537 }, - { "bit.xor", "", 0, 134537 }, - { "bit.lshift", "", 0, 134510 }, - { "bit.rshift", "", 0, 134510 }, - { "bit.ashift", "", 0, 134510 }, - { "bit.rol", "", 0, 134510 }, - { "bit.ror", "", 0, 134510 }, - { "bit.bswap", "", 0, 134467 }, - - { "bignum.number", "", 0, 136307 }, - { "bignum.isneg", "", 0, 136539 }, - { "bignum.iszero", "", 0, 136539 }, - { "bignum.tonumber", "", 0, 136859 }, - { "bignum.tostring", "", 0, 137150 }, - { "bignum.neg", "", 0, 138603 }, - { "bignum.sqrt", "", 0, 139479 }, - { "bignum.compare", "", 0, 136804 }, - { "bignum.add", "", 0, 138145 }, - { "bignum.sub", "", 0, 138090 }, - { "bignum.mul", "", 0, 140468 }, - { "bignum.div", "", 0, 139958 }, - { "bignum.mod", "", 0, 141893 }, - { "bignum.pow", "", 0, 140887 }, - { "bignum.divmod", "", 0, 146193 }, - { "bignum.powmod", "", 0, 145559 }, - { "bignum.operators", "", 0, 138811 }, - - { "json", "", 0, 142320 }, - - { "crypto.sha256", "", 0, 137578 }, - { "crypto.ecverify", "", 0, 139467 }, - - { "state.set", "", 0, 137310 }, - { "state.get", "", 0, 137115 }, - { "state.delete", "", 0, 137122 }, - - { "system.getSender", "", 0, 135656 }, - { "system.getBlockheight", "", 0, 134761 }, - { "system.getTxhash", "", 0, 135132 }, - { "system.getTimestamp", "", 0, 134761 }, - { "system.getContractID", "", 0, 135656 }, - { "system.setItem", "", 0, 135589 }, - { "system.getItem", "", 0, 135898 }, - { "system.getAmount", "", 0, 134803 }, - { "system.getCreator", "", 0, 135156 }, - { "system.getOrigin", "", 0, 135656 }, + {"comp_ops", "", 0, 134635}, + {"unarytest_n_copy_ops", "", 0, 134548}, + {"unary_ops", "", 0, 134947}, + {"binary_ops", "", 0, 136470}, + {"constant_ops", "", 0, 134463}, + {"upvalue_n_func_ops", "", 0, 135742}, + {"table_ops", "", 0, 135733}, + {"call_n_vararg_ops", "", 0, 136396}, + {"return_ops", "", 0, 134468}, + {"loop_n_branche_ops", "", 0, 137803}, + {"function_header_ops", "", 0, 134447}, + + {"assert", "", 0, 134577}, + {"getfenv", "", 0, 134472}, + {"metatable", "", 0, 135383}, + {"ipairs", "", 0, 134470}, + {"pairs", "", 0, 134470}, + {"next", "", 0, 134518}, + {"rawequal", "", 0, 134647}, + {"rawget", "", 0, 134518}, + {"rawset", "", 0, 135336}, + {"select", "", 0, 134597}, + {"setfenv", "", 0, 134507}, + {"tonumber", "", 0, 134581}, + {"tostring", "", 0, 134852}, + {"type", "", 0, 134680}, + {"unpack", "", 0, 142140}, + {"pcall", "", 0, 137560}, + {"xpcall", "", 0, 137832}, + + {"string.byte", "", 0, 148435}, + {"string.char", "", 0, 151792}, + {"string.dump", "", 0, 138261}, + {"string.find", "", 0, 139239}, + {"string.format", "", 0, 135159}, + {"string.gmatch", "", 0, 135194}, + {"string.gsub", "", 0, 136338}, + {"string.len", "", 0, 134528}, + {"string.lower", "", 0, 139746}, + {"string.match", "", 0, 134708}, + {"string.rep", "", 0, 213323}, + {"string.reverse", "", 0, 139746}, + {"string.sub", "", 0, 136600}, + {"string.upper", "", 0, 139746}, + + {"table.concat", "", 0, 155263}, + {"table.insert", "", 0, 288649}, + {"table.remove", "", 0, 148059}, + {"table.maxn", "", 0, 139357}, + {"table.sort", "", 0, 151261}, + + {"math.abs", "", 0, 134615}, + {"math.ceil", "", 0, 134615}, + {"math.floor", "", 0, 134615}, + {"math.max", "", 0, 134987}, + {"math.min", "", 0, 134987}, + {"math.pow", "", 0, 134975}, + + {"bit.tobit", "", 0, 134510}, + {"bit.tohex", "", 0, 134985}, + {"bit.bnot", "", 0, 134487}, + {"bit.bor", "", 0, 134561}, + {"bit.band", "", 0, 134537}, + {"bit.xor", "", 0, 134537}, + {"bit.lshift", "", 0, 134510}, + {"bit.rshift", "", 0, 134510}, + {"bit.ashift", "", 0, 134510}, + {"bit.rol", "", 0, 134510}, + {"bit.ror", "", 0, 134510}, + {"bit.bswap", "", 0, 134467}, + + {"bignum.number", "", 0, 136307}, + {"bignum.isneg", "", 0, 136539}, + {"bignum.iszero", "", 0, 136539}, + {"bignum.tonumber", "", 0, 136859}, + {"bignum.tostring", "", 0, 137150}, + {"bignum.neg", "", 0, 138603}, + {"bignum.sqrt", "", 0, 139479}, + {"bignum.compare", "", 0, 136804}, + {"bignum.add", "", 0, 138145}, + {"bignum.sub", "", 0, 138090}, + {"bignum.mul", "", 0, 140468}, + {"bignum.div", "", 0, 139958}, + {"bignum.mod", "", 0, 141893}, + {"bignum.pow", "", 0, 140887}, + {"bignum.divmod", "", 0, 146193}, + {"bignum.powmod", "", 0, 145559}, + {"bignum.operators", "", 0, 138811}, + + {"json", "", 0, 142320}, + + {"crypto.sha256", "", 0, 137578}, + {"crypto.ecverify", "", 0, 139467}, + + {"state.set", "", 0, 137310}, + {"state.get", "", 0, 137115}, + {"state.delete", "", 0, 137122}, + + {"system.getSender", "", 0, 135656}, + {"system.getBlockheight", "", 0, 134761}, + {"system.getTxhash", "", 0, 135132}, + {"system.getTimestamp", "", 0, 134761}, + {"system.getContractID", "", 0, 135656}, + {"system.setItem", "", 0, 135589}, + {"system.getItem", "", 0, 135898}, + {"system.getAmount", "", 0, 134803}, + {"system.getCreator", "", 0, 135156}, + {"system.getOrigin", "", 0, 135656}, // as the returned value differs in length (43 or 44) // due to base58, the computed gas is different. //{ "system.getPrevBlockHash", "", 0, 135132 }, - { "contract.send", "", 0, 135716 }, - { "contract.balance", "", 0, 135728 }, - { "contract.deploy", "", 0, 158752 }, - { "contract.call", "", 0, 149642 }, - { "contract.pcall", "", 0, 150563 }, - { "contract.delegatecall", "", 0, 144902 }, - { "contract.event", "", 0, 153263 }, + {"contract.send", "", 0, 135716}, + {"contract.balance", "", 0, 135728}, + {"contract.deploy", "", 0, 158752}, + {"contract.call", "", 0, 149642}, + {"contract.pcall", "", 0, 150563}, + {"contract.delegatecall", "", 0, 144902}, + {"contract.event", "", 0, 153263}, } // set the hard fork version diff --git a/docs/ReleaseNotes.md b/docs/ReleaseNotes.md new file mode 100644 index 000000000..829c31548 --- /dev/null +++ b/docs/ReleaseNotes.md @@ -0,0 +1,17 @@ +# v2.4.5 + +## Improvements + +- Updated golang and dependencies. +- Improved unit tests and integrations tests + +## Bug Fixes + +- Fixed hardfork version on child Lua state +- Fixed typos + +## Tools + +### brick + +* Added hardfork command diff --git a/examples/component/main.go b/examples/component/main.go index 3416aaad8..d532688a6 100644 --- a/examples/component/main.go +++ b/examples/component/main.go @@ -10,10 +10,10 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/examples/component/message" - "github.com/aergoio/aergo/examples/component/server" - "github.com/aergoio/aergo/examples/component/service" - "github.com/aergoio/aergo/pkg/component" + "github.com/aergoio/aergo/v2/examples/component/message" + "github.com/aergoio/aergo/v2/examples/component/server" + "github.com/aergoio/aergo/v2/examples/component/service" + "github.com/aergoio/aergo/v2/pkg/component" ) func main() { diff --git a/examples/component/server/server.go b/examples/component/server/server.go index 65ebbf736..36e217c29 100644 --- a/examples/component/server/server.go +++ b/examples/component/server/server.go @@ -7,8 +7,8 @@ package server import ( "github.com/aergoio/aergo-actor/actor" - "github.com/aergoio/aergo/examples/component/message" - "github.com/aergoio/aergo/pkg/component" + "github.com/aergoio/aergo/v2/examples/component/message" + "github.com/aergoio/aergo/v2/pkg/component" ) type TestServer struct { diff --git a/examples/component/service/service.go b/examples/component/service/service.go index 21078ab54..31d2784fe 100644 --- a/examples/component/service/service.go +++ b/examples/component/service/service.go @@ -10,8 +10,8 @@ import ( "github.com/aergoio/aergo-actor/actor" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/examples/component/message" - "github.com/aergoio/aergo/pkg/component" + "github.com/aergoio/aergo/v2/examples/component/message" + "github.com/aergoio/aergo/v2/pkg/component" ) type ExampleService struct { diff --git a/go.mod b/go.mod index 1d4b10b33..157d5e2a5 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/aergoio/aergo +module github.com/aergoio/aergo/v2 go 1.19 diff --git a/mempool/mempool.go b/mempool/mempool.go index dc440c6be..b16209d02 100644 --- a/mempool/mempool.go +++ b/mempool/mempool.go @@ -20,19 +20,19 @@ import ( "github.com/aergoio/aergo-actor/actor" "github.com/aergoio/aergo-actor/router" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/account/key" - "github.com/aergoio/aergo/chain" - cfg "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/contract/enterprise" - "github.com/aergoio/aergo/contract/name" - "github.com/aergoio/aergo/contract/system" - "github.com/aergoio/aergo/fee" - "github.com/aergoio/aergo/internal/common" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/state" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/account/key" + "github.com/aergoio/aergo/v2/chain" + cfg "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/contract/enterprise" + "github.com/aergoio/aergo/v2/contract/name" + "github.com/aergoio/aergo/v2/contract/system" + "github.com/aergoio/aergo/v2/fee" + "github.com/aergoio/aergo/v2/internal/common" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/state" + "github.com/aergoio/aergo/v2/types" "github.com/golang/protobuf/proto" ) diff --git a/mempool/mempool2_test.go b/mempool/mempool2_test.go index 3c8bebe79..d1983b528 100644 --- a/mempool/mempool2_test.go +++ b/mempool/mempool2_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" ) func TestCheckExpired(t *testing.T) { diff --git a/mempool/mempool_test.go b/mempool/mempool_test.go index 138d4ddd8..9b0675a12 100644 --- a/mempool/mempool_test.go +++ b/mempool/mempool_test.go @@ -13,10 +13,10 @@ import ( "testing" "time" - crypto "github.com/aergoio/aergo/account/key/crypto" - "github.com/aergoio/aergo/cmd/aergocli/util/encoding/json" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/types" + crypto "github.com/aergoio/aergo/v2/account/key/crypto" + "github.com/aergoio/aergo/v2/cmd/aergocli/util/encoding/json" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/types" "github.com/btcsuite/btcd/btcec" "github.com/stretchr/testify/assert" ) diff --git a/mempool/stub.go b/mempool/stub.go index bc54ecb1d..a7f6de5d3 100644 --- a/mempool/stub.go +++ b/mempool/stub.go @@ -8,7 +8,7 @@ package mempool import ( "sync" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" ) /* diff --git a/mempool/txlist.go b/mempool/txlist.go index ccc7d3f89..5af22e01d 100644 --- a/mempool/txlist.go +++ b/mempool/txlist.go @@ -11,8 +11,8 @@ import ( "sync" "time" - "github.com/aergoio/aergo/contract/system" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/contract/system" + "github.com/aergoio/aergo/v2/types" ) // txList is internal struct for transactions per account diff --git a/mempool/txlist_test.go b/mempool/txlist_test.go index 654fcd1e2..e67309e84 100644 --- a/mempool/txlist_test.go +++ b/mempool/txlist_test.go @@ -9,9 +9,9 @@ import ( "math/rand" "testing" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/fee" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/fee" + "github.com/aergoio/aergo/v2/types" "github.com/stretchr/testify/assert" ) diff --git a/mempool/txverifier.go b/mempool/txverifier.go index 3ac0ad54f..76f3e9745 100644 --- a/mempool/txverifier.go +++ b/mempool/txverifier.go @@ -2,9 +2,9 @@ package mempool import ( "github.com/aergoio/aergo-actor/actor" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/types" ) type TxVerifier struct { diff --git a/message/accountmsg.go b/message/accountmsg.go index c05022876..d8f12d183 100644 --- a/message/accountmsg.go +++ b/message/accountmsg.go @@ -1,7 +1,7 @@ package message import ( - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" ) const AccountsSvc = "AccountsSvc" diff --git a/message/blockchainmsg.go b/message/blockchainmsg.go index 0d6826d28..5208add9a 100644 --- a/message/blockchainmsg.go +++ b/message/blockchainmsg.go @@ -8,7 +8,7 @@ package message import ( "math/big" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" ) const ChainSvc = "ChainSvc" diff --git a/message/mempoolmsg.go b/message/mempoolmsg.go index cebae83f8..72faa0cca 100644 --- a/message/mempoolmsg.go +++ b/message/mempoolmsg.go @@ -6,7 +6,7 @@ package message import ( - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" ) // MemPoolSvc is exported name for MemPool service diff --git a/message/messagemock/helper.go b/message/messagemock/helper.go index ef215d305..651b3e972 100644 --- a/message/messagemock/helper.go +++ b/message/messagemock/helper.go @@ -5,7 +5,7 @@ package messagemock import ( - types "github.com/aergoio/aergo/types" + types "github.com/aergoio/aergo/v2/types" gomock "github.com/golang/mock/gomock" reflect "reflect" ) diff --git a/message/msghelper.go b/message/msghelper.go index 5de3aa580..104650d3d 100644 --- a/message/msghelper.go +++ b/message/msghelper.go @@ -4,7 +4,7 @@ import ( "fmt" "reflect" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" ) const RPCSvc = "RPCSvc" diff --git a/message/p2pmsg.go b/message/p2pmsg.go index 9c33a9723..ebafc0f38 100644 --- a/message/p2pmsg.go +++ b/message/p2pmsg.go @@ -9,7 +9,7 @@ import ( "fmt" "time" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" ) const P2PSvc = "p2pSvc" diff --git a/message/pmapmsg.go b/message/pmapmsg.go index 14ee5bd37..2d1aa1c40 100644 --- a/message/pmapmsg.go +++ b/message/pmapmsg.go @@ -6,7 +6,7 @@ package message import ( - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" ) const PolarisRPCSvc = "pRpcSvc" diff --git a/message/restmsg.go b/message/restmsg.go index f4df27746..158142790 100644 --- a/message/restmsg.go +++ b/message/restmsg.go @@ -5,6 +5,6 @@ package message -// "github.com/aergoio/aergo/types" +// "github.com/aergoio/aergo/v2/types" const RestSvc = "RestSvc" diff --git a/message/syncermsg.go b/message/syncermsg.go index e68290935..834084e49 100644 --- a/message/syncermsg.go +++ b/message/syncermsg.go @@ -1,7 +1,7 @@ package message import ( - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" ) const SyncerSvc = "SyncerSvc" diff --git a/p2p/actorwork.go b/p2p/actorwork.go index 0f174988c..f55736eee 100644 --- a/p2p/actorwork.go +++ b/p2p/actorwork.go @@ -11,11 +11,11 @@ import ( "time" "github.com/aergoio/aergo-actor/actor" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" "github.com/aergoio/etcd/raft/raftpb" ) diff --git a/p2p/actorwork_test.go b/p2p/actorwork_test.go index 2eda76688..f05f61dd1 100644 --- a/p2p/actorwork_test.go +++ b/p2p/actorwork_test.go @@ -10,11 +10,11 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/types" "github.com/aergoio/etcd/raft/raftpb" "github.com/golang/mock/gomock" ) diff --git a/p2p/ancestorreceiver.go b/p2p/ancestorreceiver.go index 513f267ff..3c2c2c1ad 100644 --- a/p2p/ancestorreceiver.go +++ b/p2p/ancestorreceiver.go @@ -8,9 +8,9 @@ package p2p import ( "time" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/types" ) // BlocksChunkReceiver is send p2p getBlocksRequest to target peer and receive p2p responses till all requests blocks are received diff --git a/p2p/ancestorreceiver_test.go b/p2p/ancestorreceiver_test.go index f854d8783..c0acc5cbc 100644 --- a/p2p/ancestorreceiver_test.go +++ b/p2p/ancestorreceiver_test.go @@ -9,10 +9,10 @@ import ( "testing" "time" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" ) diff --git a/p2p/blkreceiver.go b/p2p/blkreceiver.go index 3cebe29ca..10fa63bfe 100644 --- a/p2p/blkreceiver.go +++ b/p2p/blkreceiver.go @@ -9,10 +9,10 @@ import ( "bytes" "time" - "github.com/aergoio/aergo/chain" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/chain" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/types" ) // BlocksChunkReceiver is send p2p getBlocksRequest to target peer and receive p2p responses till all requests blocks are received diff --git a/p2p/blkreceiver_test.go b/p2p/blkreceiver_test.go index be0f55215..94860e879 100644 --- a/p2p/blkreceiver_test.go +++ b/p2p/blkreceiver_test.go @@ -9,11 +9,11 @@ import ( "testing" "time" - "github.com/aergoio/aergo/chain" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/chain" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" ) diff --git a/p2p/certmanager.go b/p2p/certmanager.go index 99a452fcf..fc93908ef 100644 --- a/p2p/certmanager.go +++ b/p2p/certmanager.go @@ -6,11 +6,11 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pkey" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pkey" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" "github.com/btcsuite/btcd/btcec" ) diff --git a/p2p/certmanager_test.go b/p2p/certmanager_test.go index 0253a3d47..5d654d347 100644 --- a/p2p/certmanager_test.go +++ b/p2p/certmanager_test.go @@ -6,11 +6,11 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" "github.com/libp2p/go-libp2p-core/crypto" "github.com/libp2p/go-libp2p-peerstore/test" diff --git a/p2p/const_test.go b/p2p/const_test.go index d759200e2..b126be5c8 100644 --- a/p2p/const_test.go +++ b/p2p/const_test.go @@ -13,10 +13,10 @@ import ( "testing" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" "github.com/libp2p/go-libp2p-core/crypto" ) diff --git a/p2p/handshakev2.go b/p2p/handshakev2.go index d2838f0d0..713dd2f68 100644 --- a/p2p/handshakev2.go +++ b/p2p/handshakev2.go @@ -13,9 +13,9 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" ) // baseWireHandshaker works to handshake to just connected peer, it detect chain networks diff --git a/p2p/handshakev2_test.go b/p2p/handshakev2_test.go index 0461c9176..ad7d28377 100644 --- a/p2p/handshakev2_test.go +++ b/p2p/handshakev2_test.go @@ -15,9 +15,9 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" "github.com/pkg/errors" ) diff --git a/p2p/hashbynoreceiver.go b/p2p/hashbynoreceiver.go index d3a98270e..c217ac6be 100644 --- a/p2p/hashbynoreceiver.go +++ b/p2p/hashbynoreceiver.go @@ -8,9 +8,9 @@ package p2p import ( "time" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/types" ) // BlocksChunkReceiver is send p2p getBlocksRequest to target peer and receive p2p responses till all requests blocks are received diff --git a/p2p/hashbynoreceiver_test.go b/p2p/hashbynoreceiver_test.go index 069d31335..d07788bfb 100644 --- a/p2p/hashbynoreceiver_test.go +++ b/p2p/hashbynoreceiver_test.go @@ -9,10 +9,10 @@ import ( "testing" "time" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" ) diff --git a/p2p/hashreceiver.go b/p2p/hashreceiver.go index 51c13c998..5b8ad0ca3 100644 --- a/p2p/hashreceiver.go +++ b/p2p/hashreceiver.go @@ -8,9 +8,9 @@ package p2p import ( "time" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/types" ) // BlockHashesReceiver is send p2p GetHashesRequest to target peer and receive p2p responses till all requested hashes are received diff --git a/p2p/hashreceiver_test.go b/p2p/hashreceiver_test.go index 0d967c871..ecda5f4e4 100644 --- a/p2p/hashreceiver_test.go +++ b/p2p/hashreceiver_test.go @@ -9,12 +9,12 @@ import ( "testing" "time" - "github.com/aergoio/aergo/chain" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/chain" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/types" "github.com/funkygao/golib/rand" "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" diff --git a/p2p/list/dummymanager.go b/p2p/list/dummymanager.go index 1629d2cb1..1c394396e 100644 --- a/p2p/list/dummymanager.go +++ b/p2p/list/dummymanager.go @@ -8,8 +8,8 @@ package list import ( "time" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/types" ) // dummyListManager allows all remote nodes diff --git a/p2p/list/listmanager.go b/p2p/list/listmanager.go index 46a459a2b..0ee2921df 100644 --- a/p2p/list/listmanager.go +++ b/p2p/list/listmanager.go @@ -13,10 +13,10 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/contract/enterprise" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/contract/enterprise" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/types" ) // variables that are used internally diff --git a/p2p/list/listmanager_test.go b/p2p/list/listmanager_test.go index ec93fe547..843c6d4ba 100644 --- a/p2p/list/listmanager_test.go +++ b/p2p/list/listmanager_test.go @@ -9,10 +9,10 @@ import ( "testing" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/contract/enterprise" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/contract/enterprise" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" ) diff --git a/p2p/metric/exponentmetric.go b/p2p/metric/exponentmetric.go index bf2701098..0af9ef9c3 100644 --- a/p2p/metric/exponentmetric.go +++ b/p2p/metric/exponentmetric.go @@ -9,7 +9,7 @@ import ( "math" "sync/atomic" - "github.com/aergoio/aergo/p2p/p2putil" + "github.com/aergoio/aergo/v2/p2p/p2putil" ) // this struct calculate roughly approximate mean value. diff --git a/p2p/metric/metricsman.go b/p2p/metric/metricsman.go index 10b386208..c8c228a3a 100644 --- a/p2p/metric/metricsman.go +++ b/p2p/metric/metricsman.go @@ -13,8 +13,8 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" ) type MetricsManager interface { diff --git a/p2p/metric/metricsman_test.go b/p2p/metric/metricsman_test.go index 2d08bf0b7..7cae62838 100644 --- a/p2p/metric/metricsman_test.go +++ b/p2p/metric/metricsman_test.go @@ -9,8 +9,8 @@ import ( "testing" "time" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/types" "github.com/stretchr/testify/assert" ) diff --git a/p2p/metric/peermetric.go b/p2p/metric/peermetric.go index 644778ffc..9127cdc92 100644 --- a/p2p/metric/peermetric.go +++ b/p2p/metric/peermetric.go @@ -9,8 +9,8 @@ import ( "sync/atomic" "time" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/types" ) type PeerMetric struct { diff --git a/p2p/metric/peermetric_test.go b/p2p/metric/peermetric_test.go index 23eec6086..542d62121 100644 --- a/p2p/metric/peermetric_test.go +++ b/p2p/metric/peermetric_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" "github.com/stretchr/testify/assert" ) diff --git a/p2p/mofactory.go b/p2p/mofactory.go index 2ec2c2ae4..ed39ddfd5 100644 --- a/p2p/mofactory.go +++ b/p2p/mofactory.go @@ -8,9 +8,9 @@ package p2p import ( "time" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" "github.com/aergoio/etcd/raft/raftpb" "github.com/gofrs/uuid" ) diff --git a/p2p/mofactory_test.go b/p2p/mofactory_test.go index f4ba295bc..b93e51c5c 100644 --- a/p2p/mofactory_test.go +++ b/p2p/mofactory_test.go @@ -9,8 +9,8 @@ import ( "math/rand" "testing" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/types" "github.com/gofrs/uuid" ) diff --git a/p2p/msgorder.go b/p2p/msgorder.go index 0c5811a9d..77286cabd 100644 --- a/p2p/msgorder.go +++ b/p2p/msgorder.go @@ -8,12 +8,12 @@ package p2p import ( "time" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/p2p/raftsupport" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/p2p/raftsupport" + "github.com/aergoio/aergo/v2/types" "github.com/aergoio/etcd/raft/raftpb" ) diff --git a/p2p/msgorder_test.go b/p2p/msgorder_test.go index 43fc32a82..600491031 100644 --- a/p2p/msgorder_test.go +++ b/p2p/msgorder_test.go @@ -12,9 +12,9 @@ import ( "testing" "time" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" ) diff --git a/p2p/p2p.go b/p2p/p2p.go index 24844f8b5..d2d8708b3 100644 --- a/p2p/p2p.go +++ b/p2p/p2p.go @@ -13,21 +13,21 @@ import ( "github.com/aergoio/aergo-actor/actor" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/chain" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/internal/network" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/list" - "github.com/aergoio/aergo/p2p/metric" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pkey" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/p2p/raftsupport" - "github.com/aergoio/aergo/p2p/subproto" - "github.com/aergoio/aergo/p2p/transport" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/chain" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/internal/network" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/list" + "github.com/aergoio/aergo/v2/p2p/metric" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pkey" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/p2p/raftsupport" + "github.com/aergoio/aergo/v2/p2p/subproto" + "github.com/aergoio/aergo/v2/p2p/transport" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/types" "github.com/rs/zerolog" ) diff --git a/p2p/p2p_test.go b/p2p/p2p_test.go index a24eca275..a4bc06edf 100644 --- a/p2p/p2p_test.go +++ b/p2p/p2p_test.go @@ -11,12 +11,12 @@ import ( "testing" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/list" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/list" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" ) diff --git a/p2p/p2pcommon/actorservice.go b/p2p/p2pcommon/actorservice.go index fce55f42f..49548b5ac 100644 --- a/p2p/p2pcommon/actorservice.go +++ b/p2p/p2pcommon/actorservice.go @@ -9,7 +9,7 @@ import ( "time" "github.com/aergoio/aergo-actor/actor" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" ) // ActorService is collection of helper methods to use actor diff --git a/p2p/p2pcommon/certificate.go b/p2p/p2pcommon/certificate.go index 8a112cc2e..63f7fb223 100644 --- a/p2p/p2pcommon/certificate.go +++ b/p2p/p2pcommon/certificate.go @@ -4,7 +4,7 @@ import ( "errors" "time" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" "github.com/btcsuite/btcd/btcec" ) @@ -71,4 +71,4 @@ type CertificateManager interface { CanHandle(bpID types.PeerID) bool } -//go:generate sh -c "mockgen github.com/aergoio/aergo/p2p/p2pcommon CertificateManager | sed -e 's/^package mock_p2pcommon/package p2pmock/g' > ../p2pmock/mock_certificate.go" +//go:generate sh -c "mockgen github.com/aergoio/aergo/v2/p2p/p2pcommon CertificateManager | sed -e 's/^package mock_p2pcommon/package p2pmock/g' > ../p2pmock/mock_certificate.go" diff --git a/p2p/p2pcommon/consts.go b/p2p/p2pcommon/consts.go index a731656e2..cf7e112c4 100644 --- a/p2p/p2pcommon/consts.go +++ b/p2p/p2pcommon/consts.go @@ -9,7 +9,7 @@ import ( "fmt" "time" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" core "github.com/libp2p/go-libp2p-core" ) diff --git a/p2p/p2pcommon/handshake.go b/p2p/p2pcommon/handshake.go index da43df5f5..c5a3d74d2 100644 --- a/p2p/p2pcommon/handshake.go +++ b/p2p/p2pcommon/handshake.go @@ -11,7 +11,7 @@ import ( "io" "time" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" ) type HandshakeResult struct { diff --git a/p2p/p2pcommon/internalmsg.go b/p2p/p2pcommon/internalmsg.go index 0f5e85a2a..3e52e3cd5 100644 --- a/p2p/p2pcommon/internalmsg.go +++ b/p2p/p2pcommon/internalmsg.go @@ -6,7 +6,7 @@ package p2pcommon import ( - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" "github.com/aergoio/etcd/raft/raftpb" ) diff --git a/p2p/p2pcommon/internalservice.go b/p2p/p2pcommon/internalservice.go index df199459f..4a378a6f1 100644 --- a/p2p/p2pcommon/internalservice.go +++ b/p2p/p2pcommon/internalservice.go @@ -8,8 +8,8 @@ package p2pcommon import ( "net" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/types" ) // InternalService provides informations of self node and reference of other p2p components. diff --git a/p2p/p2pcommon/listmanager.go b/p2p/p2pcommon/listmanager.go index 336bd3d89..0a0d311b6 100644 --- a/p2p/p2pcommon/listmanager.go +++ b/p2p/p2pcommon/listmanager.go @@ -8,7 +8,7 @@ package p2pcommon import ( "time" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" ) // ListManager manages whitelist and blacklist diff --git a/p2p/p2pcommon/message.go b/p2p/p2pcommon/message.go index 5b2a171a1..5fb0c6e42 100644 --- a/p2p/p2pcommon/message.go +++ b/p2p/p2pcommon/message.go @@ -9,7 +9,7 @@ package p2pcommon import ( "time" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" "github.com/golang/protobuf/proto" ) diff --git a/p2p/p2pcommon/others.go b/p2p/p2pcommon/others.go index 5a109a173..2443b509c 100644 --- a/p2p/p2pcommon/others.go +++ b/p2p/p2pcommon/others.go @@ -3,7 +3,7 @@ package p2pcommon import ( "fmt" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" ) // PeerAccessor is an interface for a another actor module to get info of peers @@ -34,6 +34,6 @@ type SyncManager interface { RetryGetTx(peer RemotePeer, hashes [][]byte) } -//go:generate sh -c "mockgen github.com/aergoio/aergo/p2p/p2pcommon SyncManager,PeerAccessor | sed -e 's/^package mock_p2pcommon/package p2pmock/g' > ../p2pmock/mock_syncmanager.go" +//go:generate sh -c "mockgen github.com/aergoio/aergo/v2/p2p/p2pcommon SyncManager,PeerAccessor | sed -e 's/^package mock_p2pcommon/package p2pmock/g' > ../p2pmock/mock_syncmanager.go" var SyncManagerBusyError = fmt.Errorf("server is busy") diff --git a/p2p/p2pcommon/peermanager.go b/p2p/p2pcommon/peermanager.go index 5bff382e4..23172398b 100644 --- a/p2p/p2pcommon/peermanager.go +++ b/p2p/p2pcommon/peermanager.go @@ -7,8 +7,8 @@ package p2pcommon import ( - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/types" ) // PeerManager is internal service that provide peer management diff --git a/p2p/p2pcommon/peermeta.go b/p2p/p2pcommon/peermeta.go index 7ac2626d2..2d7bfa9a5 100644 --- a/p2p/p2pcommon/peermeta.go +++ b/p2p/p2pcommon/peermeta.go @@ -8,7 +8,7 @@ package p2pcommon import ( "strconv" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/p2pcommon/peermeta_test.go b/p2p/p2pcommon/peermeta_test.go index ac44b3278..f946b9027 100644 --- a/p2p/p2pcommon/peermeta_test.go +++ b/p2p/p2pcommon/peermeta_test.go @@ -9,8 +9,8 @@ import ( "bytes" "testing" - "github.com/aergoio/aergo/internal/network" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/network" + "github.com/aergoio/aergo/v2/types" "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/p2pcommon/peerrole.go b/p2p/p2pcommon/peerrole.go index 76f03482d..0dfb407c2 100644 --- a/p2p/p2pcommon/peerrole.go +++ b/p2p/p2pcommon/peerrole.go @@ -6,7 +6,7 @@ package p2pcommon import ( - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" ) type PeerRoleManager interface { diff --git a/p2p/p2pcommon/pool.go b/p2p/p2pcommon/pool.go index 7c2de5a0d..2c4e72ca3 100644 --- a/p2p/p2pcommon/pool.go +++ b/p2p/p2pcommon/pool.go @@ -9,7 +9,7 @@ import ( "errors" "time" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" "github.com/libp2p/go-libp2p-core/network" ) diff --git a/p2p/p2pcommon/remoteinfo.go b/p2p/p2pcommon/remoteinfo.go index 70648afbd..cc4048d85 100644 --- a/p2p/p2pcommon/remoteinfo.go +++ b/p2p/p2pcommon/remoteinfo.go @@ -3,7 +3,7 @@ package p2pcommon import ( "net" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" ) type PeerZone bool diff --git a/p2p/p2pcommon/remotepeer.go b/p2p/p2pcommon/remotepeer.go index 2443b962b..04dfe0b64 100644 --- a/p2p/p2pcommon/remotepeer.go +++ b/p2p/p2pcommon/remotepeer.go @@ -9,7 +9,7 @@ package p2pcommon import ( "time" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" ) type PeerFactory interface { diff --git a/p2p/p2pcommon/temptype.go b/p2p/p2pcommon/temptype.go index da20c3976..d5cbd4e7b 100644 --- a/p2p/p2pcommon/temptype.go +++ b/p2p/p2pcommon/temptype.go @@ -8,11 +8,11 @@ package p2pcommon // This file describe the command to generate mock objects of imported interfaces // in aergo but outside of p2p -//go:generate sh -c "mockgen github.com/aergoio/aergo/types ChainAccessor | sed -e 's/[Pp]ackage mock_types/package p2pmock/g' > ../p2pmock/mock_chainaccessor.go" +//go:generate sh -c "mockgen github.com/aergoio/aergo/v2/types ChainAccessor | sed -e 's/[Pp]ackage mock_types/package p2pmock/g' > ../p2pmock/mock_chainaccessor.go" -//go:generate sh -c "mockgen github.com/aergoio/aergo/consensus ConsensusAccessor,AergoRaftAccessor | sed -e 's/^package mock_consensus/package p2pmock/g' > ../p2pmock/mock_consensus.go" +//go:generate sh -c "mockgen github.com/aergoio/aergo/v2/consensus ConsensusAccessor,AergoRaftAccessor | sed -e 's/^package mock_consensus/package p2pmock/g' > ../p2pmock/mock_consensus.go" -//go:generate sh -c "mockgen github.com/aergoio/aergo/types AergoRPCService_ListBlockStreamServer | sed -e 's/^package mock_types/package p2pmock/g' > ../p2pmock/mock_protobuf.go" +//go:generate sh -c "mockgen github.com/aergoio/aergo/v2/types AergoRPCService_ListBlockStreamServer | sed -e 's/^package mock_types/package p2pmock/g' > ../p2pmock/mock_protobuf.go" // in aergoio //go:generate sh -c "mockgen github.com/aergoio/aergo-actor/actor Context | sed -e 's/[Pp]ackage mock_actor/package p2pmock/g' > ../p2pmock/mock_actorcontext.go" diff --git a/p2p/p2pcommon/transport.go b/p2p/p2pcommon/transport.go index c87ed579a..755586d7d 100644 --- a/p2p/p2pcommon/transport.go +++ b/p2p/p2pcommon/transport.go @@ -8,14 +8,14 @@ package p2pcommon import ( "time" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" core "github.com/libp2p/go-libp2p-core" "github.com/libp2p/go-libp2p-core/network" ) // NTContainer can provide NetworkTransport interface. // -//go:generate sh -c "mockgen github.com/aergoio/aergo/p2p/p2pcommon NTContainer,NetworkTransport | sed -e 's/^package mock_p2pcommon/package p2pmock/g' > ../p2pmock/mock_networktransport.go" +//go:generate sh -c "mockgen github.com/aergoio/aergo/v2/p2p/p2pcommon NTContainer,NetworkTransport | sed -e 's/^package mock_p2pcommon/package p2pmock/g' > ../p2pmock/mock_networktransport.go" type NTContainer interface { GetNetworkTransport() NetworkTransport diff --git a/p2p/p2pkey/nodekey.go b/p2p/p2pkey/nodekey.go index c815b9e69..90dd90d16 100644 --- a/p2p/p2pkey/nodekey.go +++ b/p2p/p2pkey/nodekey.go @@ -11,11 +11,11 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" "github.com/libp2p/go-libp2p-core/crypto" ) diff --git a/p2p/p2pmock/mock_actorservice.go b/p2p/p2pmock/mock_actorservice.go index 34e1949ee..af3c7ebbd 100644 --- a/p2p/p2pmock/mock_actorservice.go +++ b/p2p/p2pmock/mock_actorservice.go @@ -6,7 +6,7 @@ package p2pmock import ( actor "github.com/aergoio/aergo-actor/actor" - types "github.com/aergoio/aergo/types" + types "github.com/aergoio/aergo/v2/types" gomock "github.com/golang/mock/gomock" reflect "reflect" time "time" diff --git a/p2p/p2pmock/mock_certificate.go b/p2p/p2pmock/mock_certificate.go index 8baf93413..280cd08d1 100644 --- a/p2p/p2pmock/mock_certificate.go +++ b/p2p/p2pmock/mock_certificate.go @@ -1,11 +1,11 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/aergoio/aergo/p2p/p2pcommon (interfaces: CertificateManager) +// Source: github.com/aergoio/aergo/v2/p2p/p2pcommon (interfaces: CertificateManager) // Package mock_p2pcommon is a generated GoMock package. package p2pmock import ( - p2pcommon "github.com/aergoio/aergo/p2p/p2pcommon" + p2pcommon "github.com/aergoio/aergo/v2/p2p/p2pcommon" gomock "github.com/golang/mock/gomock" peer "github.com/libp2p/go-libp2p-core/peer" reflect "reflect" diff --git a/p2p/p2pmock/mock_chainaccessor.go b/p2p/p2pmock/mock_chainaccessor.go index cf103da54..e55b42f57 100644 --- a/p2p/p2pmock/mock_chainaccessor.go +++ b/p2p/p2pmock/mock_chainaccessor.go @@ -1,11 +1,11 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/aergoio/aergo/types (interfaces: ChainAccessor) +// Source: github.com/aergoio/aergo/v2/types (interfaces: ChainAccessor) // package p2pmock is a generated GoMock package. package p2pmock import ( - types "github.com/aergoio/aergo/types" + types "github.com/aergoio/aergo/v2/types" gomock "github.com/golang/mock/gomock" big "math/big" reflect "reflect" diff --git a/p2p/p2pmock/mock_consensus.go b/p2p/p2pmock/mock_consensus.go index ac7d34159..eef8b6c3b 100644 --- a/p2p/p2pmock/mock_consensus.go +++ b/p2p/p2pmock/mock_consensus.go @@ -1,13 +1,13 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/aergoio/aergo/consensus (interfaces: ConsensusAccessor,AergoRaftAccessor) +// Source: github.com/aergoio/aergo/v2/consensus (interfaces: ConsensusAccessor,AergoRaftAccessor) // Package mock_consensus is a generated GoMock package. package p2pmock import ( context "context" - consensus "github.com/aergoio/aergo/consensus" - types "github.com/aergoio/aergo/types" + consensus "github.com/aergoio/aergo/v2/consensus" + types "github.com/aergoio/aergo/v2/types" raft "github.com/aergoio/etcd/raft" raftpb "github.com/aergoio/etcd/raft/raftpb" gomock "github.com/golang/mock/gomock" diff --git a/p2p/p2pmock/mock_handshake.go b/p2p/p2pmock/mock_handshake.go index 2505bb796..8cc28382a 100644 --- a/p2p/p2pmock/mock_handshake.go +++ b/p2p/p2pmock/mock_handshake.go @@ -6,8 +6,8 @@ package p2pmock import ( context "context" - p2pcommon "github.com/aergoio/aergo/p2p/p2pcommon" - types "github.com/aergoio/aergo/types" + p2pcommon "github.com/aergoio/aergo/v2/p2p/p2pcommon" + types "github.com/aergoio/aergo/v2/types" gomock "github.com/golang/mock/gomock" io "io" reflect "reflect" diff --git a/p2p/p2pmock/mock_internalservice.go b/p2p/p2pmock/mock_internalservice.go index 4388afb5d..46c2db88f 100644 --- a/p2p/p2pmock/mock_internalservice.go +++ b/p2p/p2pmock/mock_internalservice.go @@ -5,9 +5,9 @@ package p2pmock import ( - consensus "github.com/aergoio/aergo/consensus" - p2pcommon "github.com/aergoio/aergo/p2p/p2pcommon" - types "github.com/aergoio/aergo/types" + consensus "github.com/aergoio/aergo/v2/consensus" + p2pcommon "github.com/aergoio/aergo/v2/p2p/p2pcommon" + types "github.com/aergoio/aergo/v2/types" gomock "github.com/golang/mock/gomock" reflect "reflect" ) diff --git a/p2p/p2pmock/mock_listmanager.go b/p2p/p2pmock/mock_listmanager.go index ea593f1d5..26d9487e3 100644 --- a/p2p/p2pmock/mock_listmanager.go +++ b/p2p/p2pmock/mock_listmanager.go @@ -5,7 +5,7 @@ package p2pmock import ( - types "github.com/aergoio/aergo/types" + types "github.com/aergoio/aergo/v2/types" gomock "github.com/golang/mock/gomock" reflect "reflect" time "time" diff --git a/p2p/p2pmock/mock_message.go b/p2p/p2pmock/mock_message.go index 2a2cf94bf..e04b936f8 100644 --- a/p2p/p2pmock/mock_message.go +++ b/p2p/p2pmock/mock_message.go @@ -5,8 +5,8 @@ package p2pmock import ( - p2pcommon "github.com/aergoio/aergo/p2p/p2pcommon" - types "github.com/aergoio/aergo/types" + p2pcommon "github.com/aergoio/aergo/v2/p2p/p2pcommon" + types "github.com/aergoio/aergo/v2/types" gomock "github.com/golang/mock/gomock" reflect "reflect" time "time" diff --git a/p2p/p2pmock/mock_metricsman.go b/p2p/p2pmock/mock_metricsman.go index f5a9bfd80..be133c0b3 100644 --- a/p2p/p2pmock/mock_metricsman.go +++ b/p2p/p2pmock/mock_metricsman.go @@ -5,8 +5,8 @@ package p2pmock import ( - metric "github.com/aergoio/aergo/p2p/metric" - types "github.com/aergoio/aergo/types" + metric "github.com/aergoio/aergo/v2/p2p/metric" + types "github.com/aergoio/aergo/v2/types" gomock "github.com/golang/mock/gomock" reflect "reflect" ) diff --git a/p2p/p2pmock/mock_msgio.go b/p2p/p2pmock/mock_msgio.go index 59b1bb8a2..6bdaf6781 100644 --- a/p2p/p2pmock/mock_msgio.go +++ b/p2p/p2pmock/mock_msgio.go @@ -5,7 +5,7 @@ package p2pmock import ( - p2pcommon "github.com/aergoio/aergo/p2p/p2pcommon" + p2pcommon "github.com/aergoio/aergo/v2/p2p/p2pcommon" gomock "github.com/golang/mock/gomock" reflect "reflect" ) diff --git a/p2p/p2pmock/mock_msgorder.go b/p2p/p2pmock/mock_msgorder.go index ef02acb1d..8cb9081d2 100644 --- a/p2p/p2pmock/mock_msgorder.go +++ b/p2p/p2pmock/mock_msgorder.go @@ -5,8 +5,8 @@ package p2pmock import ( - p2pcommon "github.com/aergoio/aergo/p2p/p2pcommon" - types "github.com/aergoio/aergo/types" + p2pcommon "github.com/aergoio/aergo/v2/p2p/p2pcommon" + types "github.com/aergoio/aergo/v2/types" raftpb "github.com/aergoio/etcd/raft/raftpb" gomock "github.com/golang/mock/gomock" reflect "reflect" diff --git a/p2p/p2pmock/mock_networktransport.go b/p2p/p2pmock/mock_networktransport.go index f2e1fa505..879f1e081 100644 --- a/p2p/p2pmock/mock_networktransport.go +++ b/p2p/p2pmock/mock_networktransport.go @@ -1,13 +1,13 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/aergoio/aergo/p2p/p2pcommon (interfaces: NTContainer,NetworkTransport) +// Source: github.com/aergoio/aergo/v2/p2p/p2pcommon (interfaces: NTContainer,NetworkTransport) // Package mock_p2pcommon is a generated GoMock package. package p2pmock import ( context "context" - p2pcommon "github.com/aergoio/aergo/p2p/p2pcommon" - types "github.com/aergoio/aergo/types" + p2pcommon "github.com/aergoio/aergo/v2/p2p/p2pcommon" + types "github.com/aergoio/aergo/v2/types" gomock "github.com/golang/mock/gomock" connmgr "github.com/libp2p/go-libp2p-core/connmgr" event "github.com/libp2p/go-libp2p-core/event" diff --git a/p2p/p2pmock/mock_peerfinder.go b/p2p/p2pmock/mock_peerfinder.go index 977eafde2..c464ca621 100644 --- a/p2p/p2pmock/mock_peerfinder.go +++ b/p2p/p2pmock/mock_peerfinder.go @@ -5,8 +5,8 @@ package p2pmock import ( - p2pcommon "github.com/aergoio/aergo/p2p/p2pcommon" - types "github.com/aergoio/aergo/types" + p2pcommon "github.com/aergoio/aergo/v2/p2p/p2pcommon" + types "github.com/aergoio/aergo/v2/types" gomock "github.com/golang/mock/gomock" network "github.com/libp2p/go-libp2p-core/network" reflect "reflect" diff --git a/p2p/p2pmock/mock_peermanager.go b/p2p/p2pmock/mock_peermanager.go index 384b43999..271b12b08 100644 --- a/p2p/p2pmock/mock_peermanager.go +++ b/p2p/p2pmock/mock_peermanager.go @@ -5,9 +5,9 @@ package p2pmock import ( - message "github.com/aergoio/aergo/message" - p2pcommon "github.com/aergoio/aergo/p2p/p2pcommon" - types "github.com/aergoio/aergo/types" + message "github.com/aergoio/aergo/v2/message" + p2pcommon "github.com/aergoio/aergo/v2/p2p/p2pcommon" + types "github.com/aergoio/aergo/v2/types" gomock "github.com/golang/mock/gomock" reflect "reflect" ) diff --git a/p2p/p2pmock/mock_peerrole.go b/p2p/p2pmock/mock_peerrole.go index 61eb843e7..fdc657b63 100644 --- a/p2p/p2pmock/mock_peerrole.go +++ b/p2p/p2pmock/mock_peerrole.go @@ -5,8 +5,8 @@ package p2pmock import ( - p2pcommon "github.com/aergoio/aergo/p2p/p2pcommon" - types "github.com/aergoio/aergo/types" + p2pcommon "github.com/aergoio/aergo/v2/p2p/p2pcommon" + types "github.com/aergoio/aergo/v2/types" gomock "github.com/golang/mock/gomock" reflect "reflect" ) diff --git a/p2p/p2pmock/mock_protobuf.go b/p2p/p2pmock/mock_protobuf.go index d815dddb5..af1292b25 100644 --- a/p2p/p2pmock/mock_protobuf.go +++ b/p2p/p2pmock/mock_protobuf.go @@ -1,12 +1,12 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/aergoio/aergo/types (interfaces: AergoRPCService_ListBlockStreamServer) +// Source: github.com/aergoio/aergo/v2/types (interfaces: AergoRPCService_ListBlockStreamServer) // Package mock_types is a generated GoMock package. package p2pmock import ( context "context" - types "github.com/aergoio/aergo/types" + types "github.com/aergoio/aergo/v2/types" gomock "github.com/golang/mock/gomock" metadata "google.golang.org/grpc/metadata" reflect "reflect" diff --git a/p2p/p2pmock/mock_remotepeer.go b/p2p/p2pmock/mock_remotepeer.go index b6de1290e..c77f27c31 100644 --- a/p2p/p2pmock/mock_remotepeer.go +++ b/p2p/p2pmock/mock_remotepeer.go @@ -5,8 +5,8 @@ package p2pmock import ( - p2pcommon "github.com/aergoio/aergo/p2p/p2pcommon" - types "github.com/aergoio/aergo/types" + p2pcommon "github.com/aergoio/aergo/v2/p2p/p2pcommon" + types "github.com/aergoio/aergo/v2/types" gomock "github.com/golang/mock/gomock" reflect "reflect" time "time" diff --git a/p2p/p2pmock/mock_syncmanager.go b/p2p/p2pmock/mock_syncmanager.go index a6c7725e3..8b8918dff 100644 --- a/p2p/p2pmock/mock_syncmanager.go +++ b/p2p/p2pmock/mock_syncmanager.go @@ -1,12 +1,12 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/aergoio/aergo/p2p/p2pcommon (interfaces: SyncManager,PeerAccessor) +// Source: github.com/aergoio/aergo/v2/p2p/p2pcommon (interfaces: SyncManager,PeerAccessor) // Package mock_p2pcommon is a generated GoMock package. package p2pmock import ( - p2pcommon "github.com/aergoio/aergo/p2p/p2pcommon" - types "github.com/aergoio/aergo/types" + p2pcommon "github.com/aergoio/aergo/v2/p2p/p2pcommon" + types "github.com/aergoio/aergo/v2/types" gomock "github.com/golang/mock/gomock" peer "github.com/libp2p/go-libp2p-core/peer" reflect "reflect" diff --git a/p2p/p2pmock/mock_txnotice.go b/p2p/p2pmock/mock_txnotice.go index a476baa21..af5a20271 100644 --- a/p2p/p2pmock/mock_txnotice.go +++ b/p2p/p2pmock/mock_txnotice.go @@ -5,7 +5,7 @@ package p2pmock import ( - types "github.com/aergoio/aergo/types" + types "github.com/aergoio/aergo/v2/types" gomock "github.com/golang/mock/gomock" reflect "reflect" ) diff --git a/p2p/p2pmock/readme.txt b/p2p/p2pmock/readme.txt index 0ec3ca9b4..b4d7d7025 100644 --- a/p2p/p2pmock/readme.txt +++ b/p2p/p2pmock/readme.txt @@ -1,10 +1,10 @@ Examples to generate mock class 1. with reflection (and no flag is allowed) : It can generate mock of outside of current source tree, but has drawback that cannot set output package. it must be followed by manual editing or other way to correct the package of generated mock class -mockgen github.com/aergoio/aergo/p2p/p2pcommon HSHandlerFactory > p2p/p2pmock/mock_hsfactory.go +mockgen github.com/aergoio/aergo/v2/p2p/p2pcommon HSHandlerFactory > p2p/p2pmock/mock_hsfactory.go -1-1. correct package using GNU sed +1-1. correct package name using GNU sed mockgen github.com/libp2p/go-libp2p-core Host | gsed -e 's/^package mock_[a-zA-Z0-9_]\+/package p2pmock/g' > p2p/p2pmock/mock_host.go NOTE: There is no suitable common way to catch regexp + (match one or more) on multiple OS environment. On linux gnu sed, the flag to enable extended regxp is -r, but on macos bsd sed, it is -E. @@ -20,10 +20,10 @@ mockgen -source=p2p/p2pcommon/pool.go -mock_names=WaitingPeerManager=MockWaiting The generate decriptions of these mock objects are in p2p/p2pcommon/temptypes.go . So you can use such like `go generate ./p2p/p2pcommon/temptypes.go` command. # mock files which are not generated automatically by go generate ./p2p -mockgen github.com/aergoio/aergo/consensus ConsensusAccessor,AergoRaftAccessor | gsed -e 's/^package mock_[a-zA-Z0-9_]\+/package p2pmock/g' > p2p/p2pmock/mock_consensus.go +mockgen github.com/aergoio/aergo/v2/consensus ConsensusAccessor,AergoRaftAccessor | gsed -e 's/^package mock_[a-zA-Z0-9_]\+/package p2pmock/g' > p2p/p2pmock/mock_consensus.go mockgen -source=types/blockchain.go -package=p2pmock -destination=p2p/p2pmock/mock_chainaccessor.go mockgen io Reader,ReadCloser,Writer,WriteCloser,ReadWriteCloser > p2p/p2pmock/mock_io.go | gsed -e 's/^package mock_[a-zA-Z0-9_]\+/package p2pmock/g' > p2p/p2pmock/mock_io.go -mockgen github.com/aergoio/aergo/types ChainAccessor | sed -e 's/^package mock_mock_[a-zA-Z0-9_]\+/package p2pmock/g' > ../p2pmock/mock_chainaccessor.go \ No newline at end of file +mockgen github.com/aergoio/aergo/v2/types ChainAccessor | sed -e 's/^package mock_mock_[a-zA-Z0-9_]\+/package p2pmock/g' > ../p2pmock/mock_chainaccessor.go \ No newline at end of file diff --git a/p2p/p2putil/certificate.go b/p2p/p2putil/certificate.go index f36cd2568..9f41b654e 100644 --- a/p2p/p2putil/certificate.go +++ b/p2p/p2putil/certificate.go @@ -4,9 +4,9 @@ import ( "encoding/binary" "time" - "github.com/aergoio/aergo/internal/network" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/network" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/types" "github.com/btcsuite/btcd/btcec" "github.com/libp2p/go-libp2p-core/peer" "github.com/minio/sha256-simd" diff --git a/p2p/p2putil/certificate_test.go b/p2p/p2putil/certificate_test.go index 957ca02a2..11d58d261 100644 --- a/p2p/p2putil/certificate_test.go +++ b/p2p/p2putil/certificate_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/types" "github.com/btcsuite/btcd/btcec" "github.com/golang/protobuf/proto" ) diff --git a/p2p/p2putil/chan_test.go b/p2p/p2putil/chan_test.go index 5a938addb..284f975dd 100644 --- a/p2p/p2putil/chan_test.go +++ b/p2p/p2putil/chan_test.go @@ -9,8 +9,8 @@ import ( "testing" "time" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/types" ) func TestClosedChannel(t *testing.T) { diff --git a/p2p/p2putil/libp2putil.go b/p2p/p2putil/libp2putil.go index 43971de48..af4a88b4e 100644 --- a/p2p/p2putil/libp2putil.go +++ b/p2p/p2putil/libp2putil.go @@ -12,8 +12,8 @@ import ( "os" "path/filepath" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/types" core "github.com/libp2p/go-libp2p-core" "github.com/libp2p/go-libp2p-core/crypto" "github.com/multiformats/go-multiaddr" diff --git a/p2p/p2putil/libp2putil_test.go b/p2p/p2putil/libp2putil_test.go index ba5d12479..159585fd6 100644 --- a/p2p/p2putil/libp2putil_test.go +++ b/p2p/p2putil/libp2putil_test.go @@ -12,9 +12,9 @@ import ( "reflect" "testing" - "github.com/aergoio/aergo/internal/network" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/network" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/types" "github.com/multiformats/go-multiaddr" ) diff --git a/p2p/p2putil/loggingutil.go b/p2p/p2putil/loggingutil.go index c6294ff43..1d73b6a4b 100644 --- a/p2p/p2putil/loggingutil.go +++ b/p2p/p2putil/loggingutil.go @@ -10,8 +10,8 @@ import ( "net" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/types" "github.com/rs/zerolog" ) diff --git a/p2p/p2putil/loggingutil_test.go b/p2p/p2putil/loggingutil_test.go index 10b05c82c..8dd569044 100644 --- a/p2p/p2putil/loggingutil_test.go +++ b/p2p/p2putil/loggingutil_test.go @@ -13,8 +13,8 @@ import ( "testing" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/types" "github.com/funkygao/golib/rand" "github.com/rs/zerolog" ) diff --git a/p2p/p2putil/peerutil.go b/p2p/p2putil/peerutil.go index 2a1712cb0..30e4f692a 100644 --- a/p2p/p2putil/peerutil.go +++ b/p2p/p2putil/peerutil.go @@ -8,8 +8,8 @@ package p2putil import ( "fmt" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/types" ) var ( diff --git a/p2p/p2putil/peerutil_test.go b/p2p/p2putil/peerutil_test.go index d5744c913..0aca303b1 100644 --- a/p2p/p2putil/peerutil_test.go +++ b/p2p/p2putil/peerutil_test.go @@ -6,8 +6,8 @@ import ( "strings" "testing" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/types" ) func TestPeerMeta_String(t *testing.T) { diff --git a/p2p/p2putil/protobuf.go b/p2p/p2putil/protobuf.go index 1a38bb245..8faf2953a 100644 --- a/p2p/p2putil/protobuf.go +++ b/p2p/p2putil/protobuf.go @@ -6,7 +6,7 @@ package p2putil import ( - "github.com/aergoio/aergo/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/golang/protobuf/proto" ) diff --git a/p2p/p2putil/protobuf_test.go b/p2p/p2putil/protobuf_test.go index 8acc3e031..cc3e10d04 100644 --- a/p2p/p2putil/protobuf_test.go +++ b/p2p/p2putil/protobuf_test.go @@ -9,8 +9,8 @@ import ( "fmt" "testing" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/types" "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" ) diff --git a/p2p/p2putil/util.go b/p2p/p2putil/util.go index da8cf0644..539378821 100644 --- a/p2p/p2putil/util.go +++ b/p2p/p2putil/util.go @@ -13,9 +13,9 @@ import ( "strconv" "strings" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/types" "github.com/gofrs/uuid" ) diff --git a/p2p/p2putil/util_test.go b/p2p/p2putil/util_test.go index efc933c3f..b077f1efe 100644 --- a/p2p/p2putil/util_test.go +++ b/p2p/p2putil/util_test.go @@ -16,8 +16,8 @@ import ( "testing" "time" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/types" "github.com/gofrs/uuid" lru "github.com/hashicorp/golang-lru" addrutil "github.com/libp2p/go-addr-util" diff --git a/p2p/peerfinder.go b/p2p/peerfinder.go index 4a098735f..ba3a8f5e6 100644 --- a/p2p/peerfinder.go +++ b/p2p/peerfinder.go @@ -9,10 +9,10 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" ) const ( diff --git a/p2p/peerfinder_test.go b/p2p/peerfinder_test.go index 3f0b7210c..63ea8c16e 100644 --- a/p2p/peerfinder_test.go +++ b/p2p/peerfinder_test.go @@ -9,10 +9,10 @@ import ( "reflect" "testing" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" ) diff --git a/p2p/peermanager.go b/p2p/peermanager.go index ea6305d30..60db0043d 100644 --- a/p2p/peermanager.go +++ b/p2p/peermanager.go @@ -10,13 +10,13 @@ import ( "github.com/aergoio/aergo-actor/actor" "github.com/aergoio/aergo-lib/log" - cfg "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/metric" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pkey" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + cfg "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/metric" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pkey" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" "github.com/libp2p/go-libp2p-core/protocol" ) diff --git a/p2p/peermanager_test.go b/p2p/peermanager_test.go index a77a218ce..bd5b50891 100644 --- a/p2p/peermanager_test.go +++ b/p2p/peermanager_test.go @@ -9,13 +9,13 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - cfg "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pkey" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + cfg "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pkey" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" "github.com/libp2p/go-libp2p-core/crypto" "github.com/pkg/errors" diff --git a/p2p/pi.go b/p2p/pi.go index 5231d7fe7..83af31fdf 100644 --- a/p2p/pi.go +++ b/p2p/pi.go @@ -10,12 +10,12 @@ import ( "strconv" "strings" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/internal/network" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pkey" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/internal/network" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pkey" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" ) func SetupSelfMeta(peerID types.PeerID, conf *config.P2PConfig, produceBlock bool) p2pcommon.PeerMeta { diff --git a/p2p/pi_test.go b/p2p/pi_test.go index c545b6508..2599df075 100644 --- a/p2p/pi_test.go +++ b/p2p/pi_test.go @@ -9,11 +9,11 @@ import ( "testing" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pkey" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pkey" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/types" ) const ( diff --git a/p2p/raftsupport/clusterreceiver.go b/p2p/raftsupport/clusterreceiver.go index 407e21e8f..a4872a7cd 100644 --- a/p2p/raftsupport/clusterreceiver.go +++ b/p2p/raftsupport/clusterreceiver.go @@ -10,9 +10,9 @@ import ( "sync" "time" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/types" "github.com/golang/protobuf/proto" "github.com/pkg/errors" ) diff --git a/p2p/raftsupport/clusterreceiver_test.go b/p2p/raftsupport/clusterreceiver_test.go index b15222a7d..8de5a8d4d 100644 --- a/p2p/raftsupport/clusterreceiver_test.go +++ b/p2p/raftsupport/clusterreceiver_test.go @@ -11,10 +11,10 @@ import ( "testing" "time" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" ) diff --git a/p2p/raftsupport/concclusterreceiver.go b/p2p/raftsupport/concclusterreceiver.go index f2552b822..b97dc17ac 100644 --- a/p2p/raftsupport/concclusterreceiver.go +++ b/p2p/raftsupport/concclusterreceiver.go @@ -11,10 +11,10 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" "github.com/golang/protobuf/proto" "github.com/pkg/errors" ) diff --git a/p2p/raftsupport/concclusterreceiver_test.go b/p2p/raftsupport/concclusterreceiver_test.go index eb697db83..8ca72bdec 100644 --- a/p2p/raftsupport/concclusterreceiver_test.go +++ b/p2p/raftsupport/concclusterreceiver_test.go @@ -13,11 +13,11 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" ) diff --git a/p2p/raftsupport/logutil.go b/p2p/raftsupport/logutil.go index 38ce4940e..96e20137a 100644 --- a/p2p/raftsupport/logutil.go +++ b/p2p/raftsupport/logutil.go @@ -6,7 +6,7 @@ package raftsupport import ( - "github.com/aergoio/aergo/consensus/impl/raftv2" + "github.com/aergoio/aergo/v2/consensus/impl/raftv2" "github.com/aergoio/etcd/raft/raftpb" "github.com/rs/zerolog" ) diff --git a/p2p/raftsupport/rafttransport.go b/p2p/raftsupport/rafttransport.go index 21f4aec81..0faf2f17b 100644 --- a/p2p/raftsupport/rafttransport.go +++ b/p2p/raftsupport/rafttransport.go @@ -13,11 +13,11 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/consensus/impl/raftv2" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/consensus/impl/raftv2" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" "github.com/aergoio/etcd/etcdserver/stats" rtypes "github.com/aergoio/etcd/pkg/types" "github.com/aergoio/etcd/raft" diff --git a/p2p/raftsupport/rafttransport_test.go b/p2p/raftsupport/rafttransport_test.go index 909bf0cd6..0f6a8eea4 100644 --- a/p2p/raftsupport/rafttransport_test.go +++ b/p2p/raftsupport/rafttransport_test.go @@ -12,11 +12,11 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/consensus/impl/raftv2" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/consensus/impl/raftv2" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/types" "github.com/aergoio/etcd/raft" "github.com/aergoio/etcd/raft/raftpb" "github.com/aergoio/etcd/snap" diff --git a/p2p/raftsupport/snapshot.go b/p2p/raftsupport/snapshot.go index 22bfe5516..8fc314d5b 100644 --- a/p2p/raftsupport/snapshot.go +++ b/p2p/raftsupport/snapshot.go @@ -8,7 +8,7 @@ package raftsupport import ( "io" - "github.com/aergoio/aergo/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" "github.com/aergoio/etcd/snap" ) diff --git a/p2p/raftsupport/snapshotreceiver.go b/p2p/raftsupport/snapshotreceiver.go index e68f145ed..8d2cd4df4 100644 --- a/p2p/raftsupport/snapshotreceiver.go +++ b/p2p/raftsupport/snapshotreceiver.go @@ -11,10 +11,10 @@ import ( "io" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" rtypes "github.com/aergoio/etcd/pkg/types" "github.com/aergoio/etcd/raft/raftpb" "github.com/golang/protobuf/proto" diff --git a/p2p/raftsupport/snapshotreceiver_test.go b/p2p/raftsupport/snapshotreceiver_test.go index dfabbed38..f26133232 100644 --- a/p2p/raftsupport/snapshotreceiver_test.go +++ b/p2p/raftsupport/snapshotreceiver_test.go @@ -10,7 +10,7 @@ import ( "testing" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" ) func TestSnapshotReceiver_sendResp(t *testing.T) { diff --git a/p2p/raftsupport/snapshotsender.go b/p2p/raftsupport/snapshotsender.go index 0e0e78ba1..125a1d14f 100644 --- a/p2p/raftsupport/snapshotsender.go +++ b/p2p/raftsupport/snapshotsender.go @@ -14,10 +14,10 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" pioutil "github.com/aergoio/etcd/pkg/ioutil" "github.com/aergoio/etcd/raft" "github.com/aergoio/etcd/raft/raftpb" diff --git a/p2p/raftsupport/snapshotsender_test.go b/p2p/raftsupport/snapshotsender_test.go index 7f40edfe2..2c09a2154 100644 --- a/p2p/raftsupport/snapshotsender_test.go +++ b/p2p/raftsupport/snapshotsender_test.go @@ -11,9 +11,9 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/types" "github.com/aergoio/etcd/raft/raftpb" "github.com/aergoio/etcd/snap" "github.com/golang/mock/gomock" diff --git a/p2p/raftsupport/status.go b/p2p/raftsupport/status.go index 90b9e55d3..2def4f43f 100644 --- a/p2p/raftsupport/status.go +++ b/p2p/raftsupport/status.go @@ -10,8 +10,8 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" rtypes "github.com/aergoio/etcd/pkg/types" ) diff --git a/p2p/raftsupport/status_test.go b/p2p/raftsupport/status_test.go index f55f9e7ea..5e991b84a 100644 --- a/p2p/raftsupport/status_test.go +++ b/p2p/raftsupport/status_test.go @@ -13,7 +13,7 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" rtypes "github.com/aergoio/etcd/pkg/types" ) diff --git a/p2p/remotepeer.go b/p2p/remotepeer.go index 964b279fb..6d2cf2ae8 100644 --- a/p2p/remotepeer.go +++ b/p2p/remotepeer.go @@ -12,10 +12,10 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/p2p/metric" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/metric" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" lru "github.com/hashicorp/golang-lru" "github.com/pkg/errors" ) diff --git a/p2p/remotepeer_test.go b/p2p/remotepeer_test.go index 658ffec3f..ade9dc57e 100644 --- a/p2p/remotepeer_test.go +++ b/p2p/remotepeer_test.go @@ -13,10 +13,10 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" "github.com/gofrs/uuid" "github.com/golang/mock/gomock" "github.com/libp2p/go-libp2p-core/crypto" diff --git a/p2p/rolemanager.go b/p2p/rolemanager.go index f9f1428fd..31e3c591d 100644 --- a/p2p/rolemanager.go +++ b/p2p/rolemanager.go @@ -12,10 +12,10 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" ) type RaftRoleManager struct { diff --git a/p2p/rolemanager_test.go b/p2p/rolemanager_test.go index 5c512a110..78cb307ed 100644 --- a/p2p/rolemanager_test.go +++ b/p2p/rolemanager_test.go @@ -11,10 +11,10 @@ import ( "testing" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" ) diff --git a/p2p/signature.go b/p2p/signature.go index d9e7aef60..e596828b6 100644 --- a/p2p/signature.go +++ b/p2p/signature.go @@ -8,8 +8,8 @@ package p2p import ( "fmt" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/types" "github.com/golang/protobuf/proto" "github.com/libp2p/go-libp2p-core/crypto" ) diff --git a/p2p/signature_test.go b/p2p/signature_test.go index 7a809eeaf..107496b1c 100644 --- a/p2p/signature_test.go +++ b/p2p/signature_test.go @@ -8,8 +8,8 @@ package p2p import ( "testing" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/types" "github.com/stretchr/testify/assert" ) diff --git a/p2p/subproto/addrs.go b/p2p/subproto/addrs.go index c05abb0d1..47909ef84 100644 --- a/p2p/subproto/addrs.go +++ b/p2p/subproto/addrs.go @@ -7,10 +7,10 @@ package subproto import ( "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/internal/network" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/network" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" ) type addressesRequestHandler struct { diff --git a/p2p/subproto/addrs_test.go b/p2p/subproto/addrs_test.go index 54f9ed167..1d789caf6 100644 --- a/p2p/subproto/addrs_test.go +++ b/p2p/subproto/addrs_test.go @@ -10,9 +10,9 @@ import ( "testing" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" "github.com/golang/protobuf/proto" ) diff --git a/p2p/subproto/advice.go b/p2p/subproto/advice.go index da208fab1..be74adb85 100644 --- a/p2p/subproto/advice.go +++ b/p2p/subproto/advice.go @@ -9,8 +9,8 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2putil" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2putil" "github.com/rs/zerolog" ) diff --git a/p2p/subproto/base.go b/p2p/subproto/base.go index c2f16070c..233608b44 100644 --- a/p2p/subproto/base.go +++ b/p2p/subproto/base.go @@ -2,7 +2,7 @@ package subproto import ( "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" ) // func(msg *types.P2PMessage) diff --git a/p2p/subproto/block.go b/p2p/subproto/block.go index f66405e29..79c602ea2 100644 --- a/p2p/subproto/block.go +++ b/p2p/subproto/block.go @@ -7,11 +7,11 @@ package subproto import ( "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" ) type getBlockHeadersRequestHandler struct { diff --git a/p2p/subproto/blockhash.go b/p2p/subproto/blockhash.go index af9527213..e14816d14 100644 --- a/p2p/subproto/blockhash.go +++ b/p2p/subproto/blockhash.go @@ -9,9 +9,9 @@ import ( "bytes" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" ) type getHashRequestHandler struct { diff --git a/p2p/subproto/blockhash_test.go b/p2p/subproto/blockhash_test.go index f83aa8342..4dba77a74 100644 --- a/p2p/subproto/blockhash_test.go +++ b/p2p/subproto/blockhash_test.go @@ -12,11 +12,11 @@ import ( "testing" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/chain" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/chain" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/types" "github.com/aergoio/etcd/raft/raftpb" "github.com/gofrs/uuid" "github.com/golang/mock/gomock" diff --git a/p2p/subproto/bp.go b/p2p/subproto/bp.go index 5ef0f366b..2bbda3973 100644 --- a/p2p/subproto/bp.go +++ b/p2p/subproto/bp.go @@ -7,11 +7,11 @@ package subproto import ( "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" ) type blockProducedNoticeHandler struct { diff --git a/p2p/subproto/bp_test.go b/p2p/subproto/bp_test.go index 37cd45b91..d0e07a7d9 100644 --- a/p2p/subproto/bp_test.go +++ b/p2p/subproto/bp_test.go @@ -10,11 +10,11 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" "github.com/golang/protobuf/proto" "github.com/libp2p/go-libp2p-core/crypto" diff --git a/p2p/subproto/cert.go b/p2p/subproto/cert.go index ea0881c22..b094c182b 100644 --- a/p2p/subproto/cert.go +++ b/p2p/subproto/cert.go @@ -7,9 +7,9 @@ package subproto import ( "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" ) type issueCertRequestHandler struct { diff --git a/p2p/subproto/cert_test.go b/p2p/subproto/cert_test.go index d78a3aac9..34689d809 100644 --- a/p2p/subproto/cert_test.go +++ b/p2p/subproto/cert_test.go @@ -5,10 +5,10 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" "github.com/libp2p/go-libp2p-core/crypto" "github.com/libp2p/go-libp2p-core/peer" diff --git a/p2p/subproto/getblock.go b/p2p/subproto/getblock.go index 810d89d1f..765b127e2 100644 --- a/p2p/subproto/getblock.go +++ b/p2p/subproto/getblock.go @@ -9,10 +9,10 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" "github.com/golang/protobuf/proto" ) diff --git a/p2p/subproto/getblock_test.go b/p2p/subproto/getblock_test.go index c76ac956c..2204087f9 100644 --- a/p2p/subproto/getblock_test.go +++ b/p2p/subproto/getblock_test.go @@ -10,11 +10,11 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" ) diff --git a/p2p/subproto/getcluster.go b/p2p/subproto/getcluster.go index e6050e79d..02733a0da 100644 --- a/p2p/subproto/getcluster.go +++ b/p2p/subproto/getcluster.go @@ -9,10 +9,10 @@ import ( "errors" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" ) var ( diff --git a/p2p/subproto/ping.go b/p2p/subproto/ping.go index 6ea9bf020..410a49e10 100644 --- a/p2p/subproto/ping.go +++ b/p2p/subproto/ping.go @@ -7,9 +7,9 @@ package subproto import ( "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" ) type pingRequestHandler struct { diff --git a/p2p/subproto/ping_test.go b/p2p/subproto/ping_test.go index 12ea49849..b6526aa4f 100644 --- a/p2p/subproto/ping_test.go +++ b/p2p/subproto/ping_test.go @@ -3,13 +3,13 @@ package subproto import ( "testing" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/types" "github.com/libp2p/go-libp2p-core/network" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pmock" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pmock" "github.com/golang/mock/gomock" ) diff --git a/p2p/subproto/raftstub.go b/p2p/subproto/raftstub.go index 12be6fccc..23c3fb9c5 100644 --- a/p2p/subproto/raftstub.go +++ b/p2p/subproto/raftstub.go @@ -7,10 +7,10 @@ package subproto import ( "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" ) // raftBPNoticeDiscardHandler silently discard blk notice. It is for raft block producer, since raft BP receive notice from raft HTTPS diff --git a/p2p/subproto/raftwrap.go b/p2p/subproto/raftwrap.go index e2b22bfcf..9eacf87d7 100644 --- a/p2p/subproto/raftwrap.go +++ b/p2p/subproto/raftwrap.go @@ -9,10 +9,10 @@ import ( "context" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/p2p/raftsupport" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/p2p/raftsupport" "github.com/aergoio/etcd/raft/raftpb" ) diff --git a/p2p/subproto/tx.go b/p2p/subproto/tx.go index 433f24917..97e1a91db 100644 --- a/p2p/subproto/tx.go +++ b/p2p/subproto/tx.go @@ -7,11 +7,11 @@ package subproto import ( "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" ) type txRequestHandler struct { diff --git a/p2p/subproto/tx_test.go b/p2p/subproto/tx_test.go index 85eb88a1b..be9668aec 100644 --- a/p2p/subproto/tx_test.go +++ b/p2p/subproto/tx_test.go @@ -10,10 +10,10 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/types" "github.com/gofrs/uuid" "github.com/golang/mock/gomock" ) diff --git a/p2p/syncmanager.go b/p2p/syncmanager.go index d75cc2f84..9ecd6a785 100644 --- a/p2p/syncmanager.go +++ b/p2p/syncmanager.go @@ -9,12 +9,12 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/chain" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/chain" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" lru "github.com/hashicorp/golang-lru" ) diff --git a/p2p/syncmanager_test.go b/p2p/syncmanager_test.go index f1f24cf44..65ef98614 100644 --- a/p2p/syncmanager_test.go +++ b/p2p/syncmanager_test.go @@ -10,11 +10,11 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/chain" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/chain" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" "github.com/stretchr/testify/mock" ) diff --git a/p2p/synctx.go b/p2p/synctx.go index 23f0d446d..b3e5be415 100644 --- a/p2p/synctx.go +++ b/p2p/synctx.go @@ -8,11 +8,11 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/p2p/subproto" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/p2p/subproto" + "github.com/aergoio/aergo/v2/types" "github.com/golang/protobuf/proto" lru "github.com/hashicorp/golang-lru" ) diff --git a/p2p/synctx_test.go b/p2p/synctx_test.go index 777257036..fed5988d7 100644 --- a/p2p/synctx_test.go +++ b/p2p/synctx_test.go @@ -8,12 +8,12 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/message/messagemock" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/message/messagemock" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" ) diff --git a/p2p/testhelper_test.go b/p2p/testhelper_test.go index d5b64be1a..1f7f48de4 100644 --- a/p2p/testhelper_test.go +++ b/p2p/testhelper_test.go @@ -3,8 +3,8 @@ package p2p import ( "sync" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/types" "github.com/aergoio/etcd/raft/raftpb" ) diff --git a/p2p/transport/networktransport.go b/p2p/transport/networktransport.go index e30a19ed6..f8ea38070 100644 --- a/p2p/transport/networktransport.go +++ b/p2p/transport/networktransport.go @@ -11,12 +11,12 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - cfg "github.com/aergoio/aergo/config" - network2 "github.com/aergoio/aergo/internal/network" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pkey" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + cfg "github.com/aergoio/aergo/v2/config" + network2 "github.com/aergoio/aergo/v2/internal/network" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pkey" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" "github.com/libp2p/go-libp2p" core "github.com/libp2p/go-libp2p-core" "github.com/libp2p/go-libp2p-core/crypto" diff --git a/p2p/transport/networktransport_test.go b/p2p/transport/networktransport_test.go index 67092e53f..be2b8e1f1 100644 --- a/p2p/transport/networktransport_test.go +++ b/p2p/transport/networktransport_test.go @@ -11,13 +11,13 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/config" - cfg "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pkey" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/config" + cfg "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pkey" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" ) diff --git a/p2p/txreceiver.go b/p2p/txreceiver.go index bb0bfb2d6..94c956410 100644 --- a/p2p/txreceiver.go +++ b/p2p/txreceiver.go @@ -10,11 +10,11 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" ) // GetTxsReceiver is send p2p getTXsRequest to target peer and receive p2p responses till all requests transactions are received diff --git a/p2p/txreceiver_test.go b/p2p/txreceiver_test.go index 4548738d1..8957db1dd 100644 --- a/p2p/txreceiver_test.go +++ b/p2p/txreceiver_test.go @@ -9,10 +9,10 @@ import ( "testing" "time" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" ) diff --git a/p2p/v030/v030handshake.go b/p2p/v030/v030handshake.go index 77e351891..c353d73a1 100644 --- a/p2p/v030/v030handshake.go +++ b/p2p/v030/v030handshake.go @@ -12,10 +12,10 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/internal/network" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/network" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" ) // V030Handshaker exchange status data over protocol version .0.3.0 diff --git a/p2p/v030/v030handshake_test.go b/p2p/v030/v030handshake_test.go index 007ca0b8e..fa1d02fae 100644 --- a/p2p/v030/v030handshake_test.go +++ b/p2p/v030/v030handshake_test.go @@ -13,12 +13,12 @@ import ( "testing" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pkey" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pkey" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" ) diff --git a/p2p/v030/v030io.go b/p2p/v030/v030io.go index d4bfe2db5..7434c8a17 100644 --- a/p2p/v030/v030io.go +++ b/p2p/v030/v030io.go @@ -11,7 +11,7 @@ import ( "fmt" "io" - "github.com/aergoio/aergo/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" ) const msgHeaderLength int = 48 diff --git a/p2p/v030/v030io_test.go b/p2p/v030/v030io_test.go index e43ee6da9..e114d0034 100644 --- a/p2p/v030/v030io_test.go +++ b/p2p/v030/v030io_test.go @@ -13,9 +13,9 @@ import ( "testing" "time" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/types" "github.com/gofrs/uuid" "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" diff --git a/p2p/v030/v032handshake.go b/p2p/v030/v032handshake.go index 892628074..f92ab94bf 100644 --- a/p2p/v030/v032handshake.go +++ b/p2p/v030/v032handshake.go @@ -12,10 +12,10 @@ import ( "io" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" ) // V032Handshaker exchange status data over protocol version .0.3.1 diff --git a/p2p/v030/v032handshake_test.go b/p2p/v030/v032handshake_test.go index d0aeb51ac..41a2042f9 100644 --- a/p2p/v030/v032handshake_test.go +++ b/p2p/v030/v032handshake_test.go @@ -12,10 +12,10 @@ import ( "testing" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" ) diff --git a/p2p/v030/v033handshake.go b/p2p/v030/v033handshake.go index a67f158e5..5c7e7d24c 100644 --- a/p2p/v030/v033handshake.go +++ b/p2p/v030/v033handshake.go @@ -12,11 +12,11 @@ import ( "io" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/internal/network" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/internal/network" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" ) // V033Handshaker exchange status data over protocol version .0.3.1 diff --git a/p2p/v030/v033handshake_test.go b/p2p/v030/v033handshake_test.go index 200180916..72ac5c76a 100644 --- a/p2p/v030/v033handshake_test.go +++ b/p2p/v030/v033handshake_test.go @@ -13,10 +13,10 @@ import ( "testing" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" ) diff --git a/p2p/v200/v200handshake.go b/p2p/v200/v200handshake.go index 72e7e92d3..e4a98ae21 100644 --- a/p2p/v200/v200handshake.go +++ b/p2p/v200/v200handshake.go @@ -14,13 +14,13 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/internal/network" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pkey" - "github.com/aergoio/aergo/p2p/p2putil" - v030 "github.com/aergoio/aergo/p2p/v030" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/internal/network" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pkey" + "github.com/aergoio/aergo/v2/p2p/p2putil" + v030 "github.com/aergoio/aergo/v2/p2p/v030" + "github.com/aergoio/aergo/v2/types" ) var ( diff --git a/p2p/v200/v200handshake_test.go b/p2p/v200/v200handshake_test.go index 4b8d2e8ce..074eff420 100644 --- a/p2p/v200/v200handshake_test.go +++ b/p2p/v200/v200handshake_test.go @@ -16,12 +16,12 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pkey" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pkey" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" "github.com/libp2p/go-libp2p-core/crypto" ) diff --git a/p2p/versionmanager.go b/p2p/versionmanager.go index 7b5159089..1e776210c 100644 --- a/p2p/versionmanager.go +++ b/p2p/versionmanager.go @@ -10,11 +10,11 @@ import ( "io" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/chain" - "github.com/aergoio/aergo/p2p/p2pcommon" - v030 "github.com/aergoio/aergo/p2p/v030" - v200 "github.com/aergoio/aergo/p2p/v200" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/chain" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + v030 "github.com/aergoio/aergo/v2/p2p/v030" + v200 "github.com/aergoio/aergo/v2/p2p/v200" + "github.com/aergoio/aergo/v2/types" ) type defaultVersionManager struct { diff --git a/p2p/versionmanager_test.go b/p2p/versionmanager_test.go index 30793d59a..eee1ee048 100644 --- a/p2p/versionmanager_test.go +++ b/p2p/versionmanager_test.go @@ -9,10 +9,10 @@ import ( "reflect" "testing" - "github.com/aergoio/aergo/chain" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/chain" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" ) diff --git a/p2p/waitpeermanager.go b/p2p/waitpeermanager.go index 4730d355c..3ff02b3f3 100644 --- a/p2p/waitpeermanager.go +++ b/p2p/waitpeermanager.go @@ -12,9 +12,9 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" "github.com/libp2p/go-libp2p-core/network" ) diff --git a/p2p/waitpeermanager_test.go b/p2p/waitpeermanager_test.go index 11bef9fe5..502b94587 100644 --- a/p2p/waitpeermanager_test.go +++ b/p2p/waitpeermanager_test.go @@ -12,12 +12,12 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - network2 "github.com/aergoio/aergo/internal/network" - "github.com/aergoio/aergo/p2p/list" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/types" + network2 "github.com/aergoio/aergo/v2/internal/network" + "github.com/aergoio/aergo/v2/p2p/list" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" "github.com/libp2p/go-libp2p-core/network" ) diff --git a/pkg/trie/trie_test.go b/pkg/trie/trie_test.go index 6ad50ac89..4e91f2c61 100644 --- a/pkg/trie/trie_test.go +++ b/pkg/trie/trie_test.go @@ -17,7 +17,7 @@ import ( "time" "github.com/aergoio/aergo-lib/db" - "github.com/aergoio/aergo/internal/common" + "github.com/aergoio/aergo/v2/internal/common" ) func TestTrieEmpty(t *testing.T) { diff --git a/polaris/client/polarisconnect.go b/polaris/client/polarisconnect.go index c01bf269e..b784e1c8c 100644 --- a/polaris/client/polarisconnect.go +++ b/polaris/client/polarisconnect.go @@ -13,15 +13,15 @@ import ( "github.com/aergoio/aergo-actor/actor" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pkey" - "github.com/aergoio/aergo/p2p/p2putil" - v030 "github.com/aergoio/aergo/p2p/v030" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/polaris/common" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pkey" + "github.com/aergoio/aergo/v2/p2p/p2putil" + v030 "github.com/aergoio/aergo/v2/p2p/v030" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/polaris/common" + "github.com/aergoio/aergo/v2/types" "github.com/libp2p/go-libp2p-core/network" ) diff --git a/polaris/client/polarisconnect_test.go b/polaris/client/polarisconnect_test.go index 2b667e80a..c45a71b46 100644 --- a/polaris/client/polarisconnect_test.go +++ b/polaris/client/polarisconnect_test.go @@ -9,13 +9,13 @@ import ( "errors" "testing" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/polaris/common" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/polaris/common" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" ) diff --git a/polaris/common/consts.go b/polaris/common/consts.go index 5119f6944..f841ac6d1 100644 --- a/polaris/common/consts.go +++ b/polaris/common/consts.go @@ -5,7 +5,7 @@ package common -import "github.com/aergoio/aergo/types" +import "github.com/aergoio/aergo/v2/types" var ( // 89.16 is ceiling of declination of Polaris diff --git a/polaris/common/message.go b/polaris/common/message.go index c3e7850dd..abc26ead6 100644 --- a/polaris/common/message.go +++ b/polaris/common/message.go @@ -8,7 +8,7 @@ package common import ( "time" - "github.com/aergoio/aergo/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" ) // PolarisMessage is data struct for transferring between polaris server and client. diff --git a/polaris/common/polarisprotocol.go b/polaris/common/polarisprotocol.go index 51f1dfad1..2056d85e1 100644 --- a/polaris/common/polarisprotocol.go +++ b/polaris/common/polarisprotocol.go @@ -8,7 +8,7 @@ package common import ( "time" - "github.com/aergoio/aergo/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" core "github.com/libp2p/go-libp2p-core" ) diff --git a/polaris/server/genesisreader.go b/polaris/server/genesisreader.go index 9adf58f0b..10f68c440 100644 --- a/polaris/server/genesisreader.go +++ b/polaris/server/genesisreader.go @@ -10,7 +10,7 @@ import ( "fmt" "os" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" ) // readGenesis is based on code in cmd/aergosvr/cmd.go . diff --git a/polaris/server/genesisreader_test.go b/polaris/server/genesisreader_test.go index 71bf64724..13bbe8a43 100644 --- a/polaris/server/genesisreader_test.go +++ b/polaris/server/genesisreader_test.go @@ -8,7 +8,7 @@ package server import ( "testing" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" ) func Test_readGenesis(t *testing.T) { diff --git a/polaris/server/healthcheck.go b/polaris/server/healthcheck.go index 8e298f00b..0e073787e 100644 --- a/polaris/server/healthcheck.go +++ b/polaris/server/healthcheck.go @@ -10,8 +10,8 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/polaris/common" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/polaris/common" ) type HealthCheckManager interface { diff --git a/polaris/server/healthcheck_test.go b/polaris/server/healthcheck_test.go index 13d671253..c122f6487 100644 --- a/polaris/server/healthcheck_test.go +++ b/polaris/server/healthcheck_test.go @@ -10,7 +10,7 @@ import ( "testing" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" ) func TestNewHCM(t *testing.T) { diff --git a/polaris/server/listmanager.go b/polaris/server/listmanager.go index 11520dcf4..d315c20ff 100644 --- a/polaris/server/listmanager.go +++ b/polaris/server/listmanager.go @@ -16,8 +16,8 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/types" "github.com/rs/zerolog" ) diff --git a/polaris/server/listmanager_test.go b/polaris/server/listmanager_test.go index 7819e15c7..7e073b1c0 100644 --- a/polaris/server/listmanager_test.go +++ b/polaris/server/listmanager_test.go @@ -12,8 +12,8 @@ import ( "testing" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" ) diff --git a/polaris/server/litentcontainer.go b/polaris/server/litentcontainer.go index 2261128ea..9772ffd7e 100644 --- a/polaris/server/litentcontainer.go +++ b/polaris/server/litentcontainer.go @@ -13,16 +13,16 @@ import ( "github.com/aergoio/aergo-actor/actor" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/internal/network" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pkey" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/p2p/transport" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/internal/network" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pkey" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/p2p/transport" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/types" ) // P2P is actor component for p2p diff --git a/polaris/server/mapservice.go b/polaris/server/mapservice.go index 51b705fce..5b8050b2e 100644 --- a/polaris/server/mapservice.go +++ b/polaris/server/mapservice.go @@ -15,14 +15,14 @@ import ( "github.com/aergoio/aergo-actor/actor" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/internal/network" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2putil" - v030 "github.com/aergoio/aergo/p2p/v030" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/polaris/common" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/internal/network" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2putil" + v030 "github.com/aergoio/aergo/v2/p2p/v030" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/polaris/common" + "github.com/aergoio/aergo/v2/types" "github.com/gofrs/uuid" ) diff --git a/polaris/server/mapservice_test.go b/polaris/server/mapservice_test.go index 7c34bed1a..73e7151fd 100644 --- a/polaris/server/mapservice_test.go +++ b/polaris/server/mapservice_test.go @@ -13,13 +13,13 @@ import ( "testing" "time" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/polaris/common" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/polaris/common" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" "github.com/golang/protobuf/proto" "github.com/libp2p/go-libp2p-core/network" diff --git a/polaris/server/peerstate.go b/polaris/server/peerstate.go index 4ca906164..7aa5c3c63 100644 --- a/polaris/server/peerstate.go +++ b/polaris/server/peerstate.go @@ -12,11 +12,11 @@ import ( "sync/atomic" "time" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2putil" - v030 "github.com/aergoio/aergo/p2p/v030" - "github.com/aergoio/aergo/polaris/common" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2putil" + v030 "github.com/aergoio/aergo/v2/p2p/v030" + "github.com/aergoio/aergo/v2/polaris/common" + "github.com/aergoio/aergo/v2/types" ) type PeerHealth int diff --git a/polaris/server/peerstate_test.go b/polaris/server/peerstate_test.go index f2817ea84..8707f85a9 100644 --- a/polaris/server/peerstate_test.go +++ b/polaris/server/peerstate_test.go @@ -11,11 +11,11 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" ) diff --git a/polaris/server/prpc.go b/polaris/server/prpc.go index 125353fd7..5e046c6ac 100644 --- a/polaris/server/prpc.go +++ b/polaris/server/prpc.go @@ -16,11 +16,11 @@ import ( "github.com/aergoio/aergo-actor/actor" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/types" "github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc" "github.com/opentracing/opentracing-go" "github.com/soheilhy/cmux" diff --git a/rpc/ActorService_test.go b/rpc/ActorService_test.go index 80645929a..65e93f14e 100644 --- a/rpc/ActorService_test.go +++ b/rpc/ActorService_test.go @@ -6,7 +6,7 @@ import ( "time" ) import ( - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" mock "github.com/stretchr/testify/mock" ) diff --git a/rpc/Helper_test.go b/rpc/Helper_test.go index ba5c6e127..560221d54 100644 --- a/rpc/Helper_test.go +++ b/rpc/Helper_test.go @@ -2,7 +2,7 @@ package rpc import mock "github.com/stretchr/testify/mock" -import types "github.com/aergoio/aergo/types" +import types "github.com/aergoio/aergo/v2/types" // MockMsgHelper is an autogenerated mock type for the MockMsgHelper type type MockMsgHelper struct { diff --git a/rpc/actor_test.go b/rpc/actor_test.go index 2173970eb..e7486286d 100644 --- a/rpc/actor_test.go +++ b/rpc/actor_test.go @@ -8,7 +8,7 @@ import ( "github.com/aergoio/aergo-actor/actor" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/pkg/component" + "github.com/aergoio/aergo/v2/pkg/component" ) func TestActorTimeout(t *testing.T) { diff --git a/rpc/admin.go b/rpc/admin.go index c22c495c3..9d04da4a1 100644 --- a/rpc/admin.go +++ b/rpc/admin.go @@ -8,10 +8,10 @@ import ( "time" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/types" "github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc" "github.com/opentracing/opentracing-go" "google.golang.org/grpc" diff --git a/rpc/authentication.go b/rpc/authentication.go index 92f430941..303e01e9a 100644 --- a/rpc/authentication.go +++ b/rpc/authentication.go @@ -8,7 +8,7 @@ import ( "context" "strings" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" "google.golang.org/grpc/peer" diff --git a/rpc/grpcserver.go b/rpc/grpcserver.go index 02b933f3b..9036ba5a5 100644 --- a/rpc/grpcserver.go +++ b/rpc/grpcserver.go @@ -19,14 +19,14 @@ import ( "github.com/aergoio/aergo-actor/actor" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/chain" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/internal/common" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/metric" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/chain" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/internal/common" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/metric" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/types" "github.com/golang/protobuf/ptypes/timestamp" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/rpc/grpcserver_test.go b/rpc/grpcserver_test.go index bee57f2a4..928d88802 100644 --- a/rpc/grpcserver_test.go +++ b/rpc/grpcserver_test.go @@ -13,13 +13,13 @@ import ( "testing" "github.com/aergoio/aergo-actor/actor" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/message/messagemock" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/message/messagemock" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" "github.com/mr-tron/base58/base58" ) diff --git a/rpc/rpc.go b/rpc/rpc.go index b41bef127..0e885c7cd 100644 --- a/rpc/rpc.go +++ b/rpc/rpc.go @@ -20,16 +20,16 @@ import ( "time" "github.com/aergoio/aergo-actor/actor" - "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/contract/enterprise" - "github.com/aergoio/aergo/internal/network" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2pcommon" - "github.com/aergoio/aergo/p2p/p2pkey" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/types" - aergorpc "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/contract/enterprise" + "github.com/aergoio/aergo/v2/internal/network" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2pcommon" + "github.com/aergoio/aergo/v2/p2p/p2pkey" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/types" + aergorpc "github.com/aergoio/aergo/v2/types" "github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc" "github.com/improbable-eng/grpc-web/go/grpcweb" "github.com/opentracing/opentracing-go" diff --git a/rpc/rpcstream.go b/rpc/rpcstream.go index 090805950..85f3ba08b 100644 --- a/rpc/rpcstream.go +++ b/rpc/rpcstream.go @@ -8,7 +8,7 @@ package rpc import ( "errors" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" ) const DefaultBlockBroadcastBuffer = 5 diff --git a/rpc/rpcstream_test.go b/rpc/rpcstream_test.go index bcd50cd47..3fb61f2a3 100644 --- a/rpc/rpcstream_test.go +++ b/rpc/rpcstream_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "github.com/aergoio/aergo/p2p/p2pmock" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/p2p/p2pmock" + "github.com/aergoio/aergo/v2/types" "github.com/golang/mock/gomock" ) diff --git a/rpc/txputter.go b/rpc/txputter.go index 4d08e2303..6754ab448 100644 --- a/rpc/txputter.go +++ b/rpc/txputter.go @@ -8,10 +8,10 @@ import ( "github.com/aergoio/aergo-actor/actor" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/rpc/txputter_test.go b/rpc/txputter_test.go index 2d66385dd..2baf54d77 100644 --- a/rpc/txputter_test.go +++ b/rpc/txputter_test.go @@ -7,10 +7,10 @@ import ( "time" "github.com/aergoio/aergo-actor/actor" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/types" ) func Test_txPutter_Commit(t *testing.T) { diff --git a/state/blockstate.go b/state/blockstate.go index faf815adf..f603334a1 100644 --- a/state/blockstate.go +++ b/state/blockstate.go @@ -3,8 +3,8 @@ package state import ( "math/big" - "github.com/aergoio/aergo/consensus" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/consensus" + "github.com/aergoio/aergo/v2/types" "github.com/bluele/gcache" "github.com/willf/bloom" ) diff --git a/state/chainstatedb.go b/state/chainstatedb.go index c2454d475..1709cfdb7 100644 --- a/state/chainstatedb.go +++ b/state/chainstatedb.go @@ -6,9 +6,9 @@ import ( "sync" "github.com/aergoio/aergo-lib/db" - "github.com/aergoio/aergo/internal/common" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/common" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/types" ) // ChainStateDB manages statedb and additional informations about blocks like a state root hash diff --git a/state/contract.go b/state/contract.go index d0bca77b3..1e7ef6095 100644 --- a/state/contract.go +++ b/state/contract.go @@ -5,8 +5,8 @@ import ( "math/big" "github.com/aergoio/aergo-lib/db" - "github.com/aergoio/aergo/internal/common" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/common" + "github.com/aergoio/aergo/v2/types" "github.com/golang/protobuf/proto" ) diff --git a/state/contract_test.go b/state/contract_test.go index bb9981a67..8bb04a58a 100644 --- a/state/contract_test.go +++ b/state/contract_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/aergoio/aergo-lib/db" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" "github.com/stretchr/testify/assert" ) diff --git a/state/statebuffer.go b/state/statebuffer.go index 9a7fecc0b..0ea32c8e5 100644 --- a/state/statebuffer.go +++ b/state/statebuffer.go @@ -3,9 +3,9 @@ package state import ( "sort" - "github.com/aergoio/aergo/internal/common" - "github.com/aergoio/aergo/pkg/trie" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/common" + "github.com/aergoio/aergo/v2/pkg/trie" + "github.com/aergoio/aergo/v2/types" "github.com/golang/protobuf/proto" ) diff --git a/state/statebuffer_test.go b/state/statebuffer_test.go index e21501420..4f881eb60 100644 --- a/state/statebuffer_test.go +++ b/state/statebuffer_test.go @@ -4,7 +4,7 @@ import ( "encoding/hex" "testing" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" "github.com/stretchr/testify/assert" ) diff --git a/state/statedata.go b/state/statedata.go index 9cc4102b2..d4756c603 100644 --- a/state/statedata.go +++ b/state/statedata.go @@ -5,7 +5,7 @@ import ( "encoding/gob" "github.com/aergoio/aergo-lib/db" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" "github.com/golang/protobuf/proto" ) diff --git a/state/statedb.go b/state/statedb.go index a7f91aad5..4bd37dbef 100644 --- a/state/statedb.go +++ b/state/statedb.go @@ -14,10 +14,10 @@ import ( "github.com/aergoio/aergo-lib/db" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/internal/common" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/pkg/trie" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/common" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/pkg/trie" + "github.com/aergoio/aergo/v2/types" ) const ( diff --git a/state/statedb_test.go b/state/statedb_test.go index 93e1b0f6b..daef8fa70 100644 --- a/state/statedb_test.go +++ b/state/statedb_test.go @@ -5,7 +5,7 @@ import ( "math/big" "testing" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" "github.com/stretchr/testify/assert" ) diff --git a/state/storage.go b/state/storage.go index dfc727b0b..2eea7404d 100644 --- a/state/storage.go +++ b/state/storage.go @@ -5,10 +5,10 @@ import ( "sync" "github.com/aergoio/aergo-lib/db" - "github.com/aergoio/aergo/internal/common" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/pkg/trie" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/common" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/pkg/trie" + "github.com/aergoio/aergo/v2/types" ) var ( diff --git a/state/storage_test.go b/state/storage_test.go index 6992bf3c0..8cf79325d 100644 --- a/state/storage_test.go +++ b/state/storage_test.go @@ -3,7 +3,7 @@ package state import ( "testing" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" "github.com/stretchr/testify/assert" ) diff --git a/syncer/blockfetcher.go b/syncer/blockfetcher.go index b43b7b1b2..e0a57be5a 100644 --- a/syncer/blockfetcher.go +++ b/syncer/blockfetcher.go @@ -9,11 +9,11 @@ import ( "sync/atomic" "time" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/types" "github.com/rs/zerolog" ) diff --git a/syncer/blockfetcher_test.go b/syncer/blockfetcher_test.go index 75e20a1c8..5cd664067 100644 --- a/syncer/blockfetcher_test.go +++ b/syncer/blockfetcher_test.go @@ -3,8 +3,8 @@ package syncer import ( "testing" - "github.com/aergoio/aergo/chain" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/chain" + "github.com/aergoio/aergo/v2/types" "github.com/stretchr/testify/assert" ) diff --git a/syncer/blockprocessor.go b/syncer/blockprocessor.go index 414085ef6..71559b55b 100644 --- a/syncer/blockprocessor.go +++ b/syncer/blockprocessor.go @@ -5,12 +5,12 @@ import ( "fmt" "sort" - "github.com/aergoio/aergo/chain" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/chain" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/types" ) type BlockProcessor struct { diff --git a/syncer/finder.go b/syncer/finder.go index f11b9f4a1..dce1ead75 100644 --- a/syncer/finder.go +++ b/syncer/finder.go @@ -5,12 +5,12 @@ import ( "sync" "time" - "github.com/aergoio/aergo/chain" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/chain" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/types" "github.com/pkg/errors" ) diff --git a/syncer/finder_test.go b/syncer/finder_test.go index 15babdb4e..2687e90b8 100644 --- a/syncer/finder_test.go +++ b/syncer/finder_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" - "github.com/aergoio/aergo/chain" - "github.com/aergoio/aergo/message" + "github.com/aergoio/aergo/v2/chain" + "github.com/aergoio/aergo/v2/message" ) func testFullscanSucceed(t *testing.T, expAncestor uint64) { diff --git a/syncer/hashfetcher.go b/syncer/hashfetcher.go index 3bf45191e..3892bd130 100644 --- a/syncer/hashfetcher.go +++ b/syncer/hashfetcher.go @@ -4,10 +4,10 @@ import ( "sync" "time" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/types" "github.com/pkg/errors" ) diff --git a/syncer/hashfetcher_test.go b/syncer/hashfetcher_test.go index ea3c5a3aa..2663ff1a3 100644 --- a/syncer/hashfetcher_test.go +++ b/syncer/hashfetcher_test.go @@ -4,9 +4,9 @@ import ( "testing" "time" - "github.com/aergoio/aergo/chain" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/chain" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/types" ) func TestHashFetcher_normal(t *testing.T) { diff --git a/syncer/stubsyncer.go b/syncer/stubsyncer.go index 717a7f437..8c1ff9274 100644 --- a/syncer/stubsyncer.go +++ b/syncer/stubsyncer.go @@ -9,11 +9,11 @@ import ( "time" "github.com/aergoio/aergo-actor/actor" - "github.com/aergoio/aergo/chain" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/chain" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/types" "github.com/stretchr/testify/assert" ) diff --git a/syncer/stubsyncerchain.go b/syncer/stubsyncerchain.go index 834561c17..e729d1019 100644 --- a/syncer/stubsyncerchain.go +++ b/syncer/stubsyncerchain.go @@ -4,9 +4,9 @@ import ( "fmt" "time" - "github.com/aergoio/aergo/chain" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/chain" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/types" ) type StubPeer struct { diff --git a/syncer/syncerservice.go b/syncer/syncerservice.go index b54eff6d3..ce489fcf2 100644 --- a/syncer/syncerservice.go +++ b/syncer/syncerservice.go @@ -9,12 +9,12 @@ import ( "github.com/aergoio/aergo-actor/actor" "github.com/aergoio/aergo-lib/log" - "github.com/aergoio/aergo/chain" - cfg "github.com/aergoio/aergo/config" - "github.com/aergoio/aergo/message" - "github.com/aergoio/aergo/p2p/p2putil" - "github.com/aergoio/aergo/pkg/component" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/chain" + cfg "github.com/aergoio/aergo/v2/config" + "github.com/aergoio/aergo/v2/message" + "github.com/aergoio/aergo/v2/p2p/p2putil" + "github.com/aergoio/aergo/v2/pkg/component" + "github.com/aergoio/aergo/v2/types" "github.com/pkg/errors" ) diff --git a/syncer/syncerservice_test.go b/syncer/syncerservice_test.go index 9fe048d44..16193ad61 100644 --- a/syncer/syncerservice_test.go +++ b/syncer/syncerservice_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "github.com/aergoio/aergo/chain" - "github.com/aergoio/aergo/message" + "github.com/aergoio/aergo/v2/chain" + "github.com/aergoio/aergo/v2/message" "github.com/stretchr/testify/assert" ) diff --git a/tools/genesisdump/main.go b/tools/genesisdump/main.go index cdd54e0c7..26de7d6ee 100644 --- a/tools/genesisdump/main.go +++ b/tools/genesisdump/main.go @@ -6,7 +6,7 @@ import ( "fmt" "os" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/types" ) func getGenesis(path string) *types.Genesis { diff --git a/tools/mpdumpdiag/main.go b/tools/mpdumpdiag/main.go index 31485a323..14f98adc8 100644 --- a/tools/mpdumpdiag/main.go +++ b/tools/mpdumpdiag/main.go @@ -8,8 +8,8 @@ import ( "io/ioutil" "os" - "github.com/aergoio/aergo/cmd/aergocli/util" - "github.com/aergoio/aergo/types" + "github.com/aergoio/aergo/v2/cmd/aergocli/util" + "github.com/aergoio/aergo/v2/types" "github.com/golang/protobuf/proto" "github.com/spf13/cobra" ) diff --git a/types/blockchain.go b/types/blockchain.go index be8ccb0a5..48330ba0a 100644 --- a/types/blockchain.go +++ b/types/blockchain.go @@ -16,9 +16,9 @@ import ( "sync/atomic" "time" - "github.com/aergoio/aergo/internal/common" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/internal/merkle" + "github.com/aergoio/aergo/v2/internal/common" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/internal/merkle" "github.com/golang/protobuf/proto" "github.com/libp2p/go-libp2p-core/crypto" "github.com/minio/sha256-simd" diff --git a/types/genesis.go b/types/genesis.go index 40b2e8099..4ec01695f 100644 --- a/types/genesis.go +++ b/types/genesis.go @@ -11,7 +11,7 @@ import ( "strings" "time" - "github.com/aergoio/aergo/internal/common" + "github.com/aergoio/aergo/v2/internal/common" ) const ( diff --git a/types/genesis_test.go b/types/genesis_test.go index ecd885b5f..d464648e3 100644 --- a/types/genesis_test.go +++ b/types/genesis_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/aergoio/aergo/internal/enc" + "github.com/aergoio/aergo/v2/internal/enc" "github.com/davecgh/go-spew/spew" "github.com/stretchr/testify/assert" ) diff --git a/types/logging.go b/types/logging.go index a27955b0a..4c21ce63d 100644 --- a/types/logging.go +++ b/types/logging.go @@ -8,7 +8,7 @@ package types import ( "fmt" - "github.com/aergoio/aergo/internal/enc" + "github.com/aergoio/aergo/v2/internal/enc" "github.com/rs/zerolog" ) diff --git a/types/p2p_test.go b/types/p2p_test.go index 541c0c062..ef88473af 100644 --- a/types/p2p_test.go +++ b/types/p2p_test.go @@ -10,7 +10,7 @@ import ( "fmt" "testing" - "github.com/aergoio/aergo/internal/enc" + "github.com/aergoio/aergo/v2/internal/enc" "github.com/golang/protobuf/proto" "github.com/stretchr/testify/assert" ) diff --git a/types/p2plogging.go b/types/p2plogging.go index d1f8763cc..0b25b1d8d 100644 --- a/types/p2plogging.go +++ b/types/p2plogging.go @@ -8,7 +8,7 @@ package types import ( "fmt" - "github.com/aergoio/aergo/internal/enc" + "github.com/aergoio/aergo/v2/internal/enc" "github.com/rs/zerolog" ) diff --git a/types/p2ptypes.go b/types/p2ptypes.go index be1de5d59..e951285b5 100644 --- a/types/p2ptypes.go +++ b/types/p2ptypes.go @@ -10,7 +10,7 @@ import ( "strconv" "strings" - "github.com/aergoio/aergo/internal/network" + "github.com/aergoio/aergo/v2/internal/network" core "github.com/libp2p/go-libp2p-core" "github.com/libp2p/go-libp2p-core/crypto" "github.com/libp2p/go-libp2p-core/peer" diff --git a/types/p2ptypes_test.go b/types/p2ptypes_test.go index c3cf5a048..fe493f7d0 100644 --- a/types/p2ptypes_test.go +++ b/types/p2ptypes_test.go @@ -10,7 +10,7 @@ import ( "reflect" "testing" - "github.com/aergoio/aergo/internal/network" + "github.com/aergoio/aergo/v2/internal/network" "github.com/multiformats/go-multiaddr" ) diff --git a/types/receipt.go b/types/receipt.go index cf50d5398..524243b16 100644 --- a/types/receipt.go +++ b/types/receipt.go @@ -10,8 +10,8 @@ import ( "reflect" "strconv" - "github.com/aergoio/aergo/internal/enc" - "github.com/aergoio/aergo/internal/merkle" + "github.com/aergoio/aergo/v2/internal/enc" + "github.com/aergoio/aergo/v2/internal/merkle" "github.com/golang/protobuf/jsonpb" "github.com/minio/sha256-simd" "github.com/willf/bloom" diff --git a/types/state.go b/types/state.go index 911575c0b..c33577631 100644 --- a/types/state.go +++ b/types/state.go @@ -6,8 +6,8 @@ import ( "math/big" "reflect" - "github.com/aergoio/aergo/internal/common" - "github.com/aergoio/aergo/internal/enc" + "github.com/aergoio/aergo/v2/internal/common" + "github.com/aergoio/aergo/v2/internal/enc" ) const ( diff --git a/types/transaction.go b/types/transaction.go index 645921267..61fac049f 100644 --- a/types/transaction.go +++ b/types/transaction.go @@ -7,7 +7,7 @@ import ( "math/big" "strings" - "github.com/aergoio/aergo/fee" + "github.com/aergoio/aergo/v2/fee" "github.com/golang/protobuf/proto" "github.com/mr-tron/base58/base58" )