Skip to content

Commit

Permalink
refactor: change path from v2 to v3 (#2912)
Browse files Browse the repository at this point in the history
* bump up go to v1.21

* change path from v2 to v3

* make format
  • Loading branch information
Dreamer authored Mar 11, 2024
1 parent bbefb02 commit 65dccb0
Show file tree
Hide file tree
Showing 73 changed files with 182 additions and 140 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/TestUnit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ jobs:
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: '^1.18' # The Go version to download (if necessary) and use.
go-version: '^1.21' # The Go version to download (if necessary) and use.
- run: make test-unit
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Build image: docker build -t irisnet/irishub:v2.1.0 --build-arg EVM_CHAIN_ID=6688 .
#
FROM golang:1.19.13-alpine3.18 as builder
FROM golang:1.21-alpine as builder

ARG EVM_CHAIN_ID

Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=iris \
-X github.com/cosmos/cosmos-sdk/version.AppName=iris \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
-X github.com/irisnet/irishub/v2/types.EIP155ChainID=$(EVM_CHAIN_ID) \
-X github.com/irisnet/irishub/v3/types.EIP155ChainID=$(EVM_CHAIN_ID) \
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)"

ifeq ($(WITH_CLEVELDB),yes)
Expand Down Expand Up @@ -193,13 +193,13 @@ test-cover:

lint: golangci-lint
golangci-lint run
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./lite/statik/statik.go" -not -path "*.pb.go" | xargs gofmt -d -s
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lite/statik/statik.go" -not -path "*.pb.go" | xargs gofmt -d -s
go mod verify

format:
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./lite/statik/statik.go" -not -path "*.pb.go" | xargs gofmt -w -s
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./lite/statik/statik.go" -not -path "*.pb.go" | xargs misspell -w
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./lite/statik/statik.go" -not -path "*.pb.go" | xargs goimports -w -local github.com/irisnet/irishub/v2
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lite/statik/statik.go" -not -path "*.pb.go" | xargs gofmt -w -s
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lite/statik/statik.go" -not -path "*.pb.go" | xargs misspell -w
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lite/statik/statik.go" -not -path "*.pb.go" | xargs goimports -w -local github.com/irisnet/irishub/v3

benchmark:
@go test -mod=readonly -bench=. ./...
Expand Down
2 changes: 1 addition & 1 deletion app/ante/handler_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
oraclekeeper "github.com/irisnet/irismod/modules/oracle/keeper"
tokenkeeper "github.com/irisnet/irismod/modules/token/keeper"

guardiankeeper "github.com/irisnet/irishub/v2/modules/guardian/keeper"
guardiankeeper "github.com/irisnet/irishub/v3/modules/guardian/keeper"
)

// HandlerOptions extend the SDK's AnteHandler options by requiring the IBC
Expand Down
12 changes: 6 additions & 6 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ import (

srvflags "github.com/evmos/ethermint/server/flags"

irishubante "github.com/irisnet/irishub/v2/app/ante"
"github.com/irisnet/irishub/v2/app/keepers"
"github.com/irisnet/irishub/v2/app/params"
"github.com/irisnet/irishub/v2/app/rpc"
"github.com/irisnet/irishub/v2/client/lite"
iristypes "github.com/irisnet/irishub/v2/types"
irishubante "github.com/irisnet/irishub/v3/app/ante"
"github.com/irisnet/irishub/v3/app/keepers"
"github.com/irisnet/irishub/v3/app/params"
"github.com/irisnet/irishub/v3/app/rpc"
"github.com/irisnet/irishub/v3/client/lite"
iristypes "github.com/irisnet/irishub/v3/types"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion app/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package app
import (
enccodec "github.com/evmos/ethermint/encoding/codec"

"github.com/irisnet/irishub/v2/app/params"
"github.com/irisnet/irishub/v3/app/params"
)

// RegisterEncodingConfig registers concrete types on codec
Expand Down
2 changes: 1 addition & 1 deletion app/genesis.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package app

import (
"github.com/irisnet/irishub/v2/types"
"github.com/irisnet/irishub/v3/types"
)

// NewDefaultGenesisState generates the default state for the application.
Expand Down
12 changes: 6 additions & 6 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ import (
tokentypes "github.com/irisnet/irismod/modules/token/types"
tokenv1 "github.com/irisnet/irismod/modules/token/types/v1"

guardiankeeper "github.com/irisnet/irishub/v2/modules/guardian/keeper"
guardiantypes "github.com/irisnet/irishub/v2/modules/guardian/types"
"github.com/irisnet/irishub/v2/modules/internft"
mintkeeper "github.com/irisnet/irishub/v2/modules/mint/keeper"
minttypes "github.com/irisnet/irishub/v2/modules/mint/types"
iristypes "github.com/irisnet/irishub/v2/types"
guardiankeeper "github.com/irisnet/irishub/v3/modules/guardian/keeper"
guardiantypes "github.com/irisnet/irishub/v3/modules/guardian/types"
"github.com/irisnet/irishub/v3/modules/internft"
mintkeeper "github.com/irisnet/irishub/v3/modules/mint/keeper"
minttypes "github.com/irisnet/irishub/v3/modules/mint/types"
iristypes "github.com/irisnet/irishub/v3/types"
)

// AppKeepers defines a structure used to consolidate all
Expand Down
4 changes: 2 additions & 2 deletions app/keepers/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ import (
tibcnfttypes "github.com/bianjieai/tibc-go/modules/tibc/apps/nft_transfer/types"
tibchost "github.com/bianjieai/tibc-go/modules/tibc/core/24-host"

guardiantypes "github.com/irisnet/irishub/v2/modules/guardian/types"
minttypes "github.com/irisnet/irishub/v2/modules/mint/types"
guardiantypes "github.com/irisnet/irishub/v3/modules/guardian/types"
minttypes "github.com/irisnet/irishub/v3/modules/mint/types"
)

func (appKeepers *AppKeepers) genStoreKeys() {
Expand Down
12 changes: 6 additions & 6 deletions app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ import (
nfttransfer "github.com/bianjieai/nft-transfer"
ibcnfttransfertypes "github.com/bianjieai/nft-transfer/types"

irisappparams "github.com/irisnet/irishub/v2/app/params"
irisevm "github.com/irisnet/irishub/v2/modules/evm"
"github.com/irisnet/irishub/v2/modules/guardian"
guardiantypes "github.com/irisnet/irishub/v2/modules/guardian/types"
"github.com/irisnet/irishub/v2/modules/mint"
minttypes "github.com/irisnet/irishub/v2/modules/mint/types"
irisappparams "github.com/irisnet/irishub/v3/app/params"
irisevm "github.com/irisnet/irishub/v3/modules/evm"
"github.com/irisnet/irishub/v3/modules/guardian"
guardiantypes "github.com/irisnet/irishub/v3/modules/guardian/types"
"github.com/irisnet/irishub/v3/modules/mint"
minttypes "github.com/irisnet/irishub/v3/modules/mint/types"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion app/rpc/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

ethermint "github.com/evmos/ethermint/types"

"github.com/irisnet/irishub/v2/app/keepers"
"github.com/irisnet/irishub/v3/app/keepers"
)

var _ authtypes.QueryServer = authQueryServer{}
Expand Down
3 changes: 2 additions & 1 deletion app/rpc/override.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ package rpc
import (
"github.com/cosmos/cosmos-sdk/types/module"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/irisnet/irishub/v2/app/keepers"

"github.com/irisnet/irishub/v3/app/keepers"
)

var overrideModules = map[string]overrideHandler{
Expand Down
6 changes: 3 additions & 3 deletions app/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
tokentypes "github.com/irisnet/irismod/modules/token/types"
"github.com/stretchr/testify/require"

iristypes "github.com/irisnet/irishub/v2/types"
iristypes "github.com/irisnet/irishub/v3/types"

dbm "github.com/cometbft/cometbft-db"
abci "github.com/cometbft/cometbft/abci/types"
Expand Down Expand Up @@ -314,7 +314,7 @@ func TestAppImportExport(t *testing.T) {
func TestAppSimulationAfterImport(t *testing.T) {
config := simcli.NewConfigFromFlags()
config.ChainID = AppChainID
encfg := RegisterEncodingConfig()
encfg := RegisterEncodingConfig()

db, dir, logger, skip, err := simtestutil.SetupSimulation(
config,
Expand Down Expand Up @@ -439,7 +439,7 @@ func TestAppStateDeterminism(t *testing.T) {
numSeeds := 3
numTimesToRunPerSeed := 5
appHashList := make([]json.RawMessage, numTimesToRunPerSeed)
encfg := RegisterEncodingConfig()
encfg := RegisterEncodingConfig()

for i := 0; i < numSeeds; i++ {
config.Seed = rand.Int63()
Expand Down
8 changes: 4 additions & 4 deletions app/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (

upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

"github.com/irisnet/irishub/v2/app/upgrades"
v200 "github.com/irisnet/irishub/v2/app/upgrades/v200"
v210 "github.com/irisnet/irishub/v2/app/upgrades/v210"
v300 "github.com/irisnet/irishub/v2/app/upgrades/v300"
"github.com/irisnet/irishub/v3/app/upgrades"
v200 "github.com/irisnet/irishub/v3/app/upgrades/v200"
v210 "github.com/irisnet/irishub/v3/app/upgrades/v210"
v300 "github.com/irisnet/irishub/v3/app/upgrades/v300"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

"github.com/irisnet/irishub/v2/app/keepers"
"github.com/irisnet/irishub/v3/app/keepers"
)

// Upgrade defines a struct containing necessary fields that a SoftwareUpgradeProposal
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/v200/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
etherminttypes "github.com/evmos/ethermint/x/evm/types"
feemarkettypes "github.com/evmos/ethermint/x/feemarket/types"

"github.com/irisnet/irishub/v2/types"
"github.com/irisnet/irishub/v3/types"
)

// NOTE: Before the release of irishub 2.0.0, the configuration in this file must be modified
Expand Down
4 changes: 2 additions & 2 deletions app/upgrades/v200/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"github.com/evmos/ethermint/x/feemarket"
feemarkettypes "github.com/evmos/ethermint/x/feemarket/types"

"github.com/irisnet/irishub/v2/app/upgrades"
irisevm "github.com/irisnet/irishub/v2/modules/evm"
"github.com/irisnet/irishub/v3/app/upgrades"
irisevm "github.com/irisnet/irishub/v3/modules/evm"
)

// Upgrade defines a struct containing necessary fields that a SoftwareUpgradeProposal
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/v210/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

ibcnfttransfertypes "github.com/bianjieai/nft-transfer/types"

"github.com/irisnet/irishub/v2/app/upgrades"
"github.com/irisnet/irishub/v3/app/upgrades"
)

// Upgrade defines a struct containing necessary fields that a SoftwareUpgradeProposal
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/v300/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types"
icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types"

"github.com/irisnet/irishub/v2/app/upgrades"
"github.com/irisnet/irishub/v3/app/upgrades"
)

// Upgrade defines a struct containing necessary fields that a SoftwareUpgradeProposal
Expand Down
2 changes: 1 addition & 1 deletion client/lite/swagger.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/cosmos/cosmos-sdk/client"

_ "github.com/irisnet/irishub/v2/client/lite/statik"
_ "github.com/irisnet/irishub/v3/client/lite/statik"
)

// RegisterSwaggerAPI registers swagger route with API Server
Expand Down
2 changes: 1 addition & 1 deletion cmd/iris/cmd/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
govtypesv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"

"github.com/irisnet/irishub/v2/app/params"
"github.com/irisnet/irishub/v3/app/params"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion cmd/iris/cmd/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/cosmos/cosmos-sdk/client/input"
"github.com/cosmos/cosmos-sdk/client/keys"

"github.com/irisnet/irishub/v2/client/keystore"
"github.com/irisnet/irishub/v3/client/keystore"
)

// Commands registers a sub-tree of commands to interact with
Expand Down
6 changes: 3 additions & 3 deletions cmd/iris/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ import (
ethermintserver "github.com/evmos/ethermint/server"
servercfg "github.com/evmos/ethermint/server/config"

"github.com/irisnet/irishub/v2/app"
"github.com/irisnet/irishub/v2/app/params"
iristypes "github.com/irisnet/irishub/v2/types"
"github.com/irisnet/irishub/v3/app"
"github.com/irisnet/irishub/v3/app/params"
iristypes "github.com/irisnet/irishub/v3/types"
)

// NewRootCmd creates a new root command for simd. It is called once in the
Expand Down
4 changes: 2 additions & 2 deletions cmd/iris/cmd/testnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ import (
servicetypes "github.com/irisnet/irismod/modules/service/types"
tokentypesv1 "github.com/irisnet/irismod/modules/token/types/v1"

guardiantypes "github.com/irisnet/irishub/v2/modules/guardian/types"
iristypes "github.com/irisnet/irishub/v2/types"
guardiantypes "github.com/irisnet/irishub/v3/modules/guardian/types"
iristypes "github.com/irisnet/irishub/v3/types"
)

var (
Expand Down
6 changes: 3 additions & 3 deletions cmd/iris/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"github.com/cosmos/cosmos-sdk/server"
svrcmd "github.com/cosmos/cosmos-sdk/server/cmd"

_ "github.com/irisnet/irishub/v2/client/lite/statik"
"github.com/irisnet/irishub/v2/cmd/iris/cmd"
"github.com/irisnet/irishub/v2/types"
_ "github.com/irisnet/irishub/v3/client/lite/statik"
"github.com/irisnet/irishub/v3/cmd/iris/cmd"
"github.com/irisnet/irishub/v3/types"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/irisnet/irishub/v2
module github.com/irisnet/irishub/v3

go 1.19
go 1.21

require (
github.com/bianjieai/nft-transfer v1.1.3-ibc-v7.3.0
Expand Down
Loading

0 comments on commit 65dccb0

Please sign in to comment.