Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add upgrade v6 handler #104

Merged
merged 2 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ run-local: install
### Linting ###
###############################################################################

lint:
lint: format
@echo "--> Running linter"
@which golangci-lint > /dev/null || echo "\033[91m install golangci-lint ...\033[0m" && go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
golangci-lint run -v --go=1.19 --out-format=tab

format: format-goimports
Expand Down Expand Up @@ -238,7 +238,7 @@ contract-publish:
### Releasing ###
###############################################################################

PACKAGE_NAME := github.com/functionx/fx-core/v5
PACKAGE_NAME := github.com/functionx/fx-core/v6
GOLANG_CROSS_VERSION := v1.19
release-dry-run:
docker run --rm --privileged -e CGO_ENABLED=1 \
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
**fxcore** is a blockchain built using Cosmos SDK and Tendermint and created with [Starport](https://github.com/tendermint/starport).

[![Version](https://img.shields.io/github/v/release/functionx/fx-core.svg)](https://github.com/functionx/fx-core/releases/latest)
[![API Reference](https://pkg.go.dev/badge/github.com/functionx/fx-core.svg)](https://pkg.go.dev/github.com/functionx/fx-core/v5)
[![API Reference](https://pkg.go.dev/badge/github.com/functionx/fx-core.svg)](https://pkg.go.dev/github.com/functionx/fx-core/v6)
[![License](https://img.shields.io/github/license/functionx/fx-core.svg)](https://github.com/functionx/fx-core/blob/main/LICENSE)
[![Tests](https://github.com/functionx/fx-core/actions/workflows/test.yml/badge.svg)](https://github.com/functionx/fx-core/actions/workflows/test.yml)
[![Lint](https://github.com/functionx/fx-core/actions/workflows/lint.yml/badge.svg)](https://github.com/functionx/fx-core/actions/workflows/lint.yml)
[![Go Report Card](https://goreportcard.com/badge/github.com/functionx/fx-core/v5)](https://goreportcard.com/report/github.com/functionx/fx-core/v5)
[![Go Report Card](https://goreportcard.com/badge/github.com/functionx/fx-core/v6)](https://goreportcard.com/report/github.com/functionx/fx-core/v6)

**Note**: Requires [Go 1.19+](https://go.dev/dl)

Expand Down
2 changes: 1 addition & 1 deletion ante/ante_sigs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/evmos/ethermint/x/evm/statedb"
evmtypes "github.com/evmos/ethermint/x/evm/types"

"github.com/functionx/fx-core/v5/testutil/helpers"
"github.com/functionx/fx-core/v6/testutil/helpers"
)

func (suite *AnteTestSuite) TestSignatures() {
Expand Down
8 changes: 4 additions & 4 deletions ante/ante_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ import (
"github.com/stretchr/testify/suite"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"

fxante "github.com/functionx/fx-core/v5/ante"
"github.com/functionx/fx-core/v5/app"
"github.com/functionx/fx-core/v5/testutil/helpers"
fxtypes "github.com/functionx/fx-core/v5/types"
fxante "github.com/functionx/fx-core/v6/ante"
"github.com/functionx/fx-core/v6/app"
"github.com/functionx/fx-core/v6/testutil/helpers"
fxtypes "github.com/functionx/fx-core/v6/types"
)

type AnteTestSuite struct {
Expand Down
2 changes: 1 addition & 1 deletion ante/decorator.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing"
"github.com/evmos/ethermint/crypto/ethsecp256k1"

fxstakingtypes "github.com/functionx/fx-core/v5/x/staking/types"
fxstakingtypes "github.com/functionx/fx-core/v6/x/staking/types"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions ante/eth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"github.com/evmos/ethermint/x/evm/statedb"
evmtypes "github.com/evmos/ethermint/x/evm/types"

"github.com/functionx/fx-core/v5/ante"
"github.com/functionx/fx-core/v5/testutil/helpers"
"github.com/functionx/fx-core/v6/ante"
"github.com/functionx/fx-core/v6/testutil/helpers"
)

func (suite *AnteTestSuite) TestEthSigVerificationDecorator() {
Expand Down
4 changes: 2 additions & 2 deletions ante/fee_market_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
ethtypes "github.com/ethereum/go-ethereum/core/types"
evmtypes "github.com/evmos/ethermint/x/evm/types"

"github.com/functionx/fx-core/v5/ante"
"github.com/functionx/fx-core/v5/testutil/helpers"
"github.com/functionx/fx-core/v6/ante"
"github.com/functionx/fx-core/v6/testutil/helpers"
)

func (suite *AnteTestSuite) TestGasWantedDecorator() {
Expand Down
2 changes: 1 addition & 1 deletion ante/fees.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
evmtypes "github.com/evmos/ethermint/x/evm/types"
tmstrings "github.com/tendermint/tendermint/libs/strings"

fxstakingtypes "github.com/functionx/fx-core/v5/x/staking/types"
fxstakingtypes "github.com/functionx/fx-core/v6/x/staking/types"
)

// DeductFeeDecorator deducts fees from the first signer of the tx
Expand Down
4 changes: 2 additions & 2 deletions ante/fees_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
ethtypes "github.com/ethereum/go-ethereum/core/types"
"github.com/evmos/ethermint/tests"

"github.com/functionx/fx-core/v5/ante"
fxtypes "github.com/functionx/fx-core/v5/types"
"github.com/functionx/fx-core/v6/ante"
fxtypes "github.com/functionx/fx-core/v6/types"
)

func (suite *AnteTestSuite) TestDeductFeeDecorator() {
Expand Down
8 changes: 4 additions & 4 deletions ante/reject_msgs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import (
ethtypes "github.com/ethereum/go-ethereum/core/types"
"github.com/evmos/ethermint/server/config"

"github.com/functionx/fx-core/v5/ante"
"github.com/functionx/fx-core/v5/app"
"github.com/functionx/fx-core/v5/testutil/helpers"
fxtypes "github.com/functionx/fx-core/v5/types"
"github.com/functionx/fx-core/v6/ante"
"github.com/functionx/fx-core/v6/app"
"github.com/functionx/fx-core/v6/testutil/helpers"
fxtypes "github.com/functionx/fx-core/v6/types"
)

func (suite *AnteTestSuite) TestRejectValidatorGranted() {
Expand Down
30 changes: 15 additions & 15 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,21 @@ import (
tmos "github.com/tendermint/tendermint/libs/os"
dbm "github.com/tendermint/tm-db"

fxante "github.com/functionx/fx-core/v5/ante"
"github.com/functionx/fx-core/v5/app/keepers"
_ "github.com/functionx/fx-core/v5/docs/statik"
fxcfg "github.com/functionx/fx-core/v5/server/config"
fxauth "github.com/functionx/fx-core/v5/server/grpc/auth"
gaspricev1 "github.com/functionx/fx-core/v5/server/grpc/gasprice/legacy/v1"
gaspricev2 "github.com/functionx/fx-core/v5/server/grpc/gasprice/legacy/v2"
fxrest "github.com/functionx/fx-core/v5/server/rest"
fxtypes "github.com/functionx/fx-core/v5/types"
"github.com/functionx/fx-core/v5/x/crosschain"
"github.com/functionx/fx-core/v5/x/crosschain/keeper"
crosschaintypes "github.com/functionx/fx-core/v5/x/crosschain/types"
"github.com/functionx/fx-core/v5/x/gravity"
gravitykeeper "github.com/functionx/fx-core/v5/x/gravity/keeper"
gravitytypes "github.com/functionx/fx-core/v5/x/gravity/types"
fxante "github.com/functionx/fx-core/v6/ante"
"github.com/functionx/fx-core/v6/app/keepers"
_ "github.com/functionx/fx-core/v6/docs/statik"
fxcfg "github.com/functionx/fx-core/v6/server/config"
fxauth "github.com/functionx/fx-core/v6/server/grpc/auth"
gaspricev1 "github.com/functionx/fx-core/v6/server/grpc/gasprice/legacy/v1"
gaspricev2 "github.com/functionx/fx-core/v6/server/grpc/gasprice/legacy/v2"
fxrest "github.com/functionx/fx-core/v6/server/rest"
fxtypes "github.com/functionx/fx-core/v6/types"
"github.com/functionx/fx-core/v6/x/crosschain"
"github.com/functionx/fx-core/v6/x/crosschain/keeper"
crosschaintypes "github.com/functionx/fx-core/v6/x/crosschain/types"
"github.com/functionx/fx-core/v6/x/gravity"
gravitykeeper "github.com/functionx/fx-core/v6/x/gravity/keeper"
gravitytypes "github.com/functionx/fx-core/v6/x/gravity/types"
)

var _ servertypes.Application = (*App)(nil)
Expand Down
2 changes: 1 addition & 1 deletion app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/stretchr/testify/require"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"

"github.com/functionx/fx-core/v5/testutil/helpers"
"github.com/functionx/fx-core/v6/testutil/helpers"
)

func TestUpgradeStateOnGenesis(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions app/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
"github.com/evmos/ethermint/crypto/ethsecp256k1"
etherminttypes "github.com/evmos/ethermint/types"

crosschaintypes "github.com/functionx/fx-core/v5/x/crosschain/types"
gravitytypes "github.com/functionx/fx-core/v5/x/gravity/types"
crosschaintypes "github.com/functionx/fx-core/v6/x/crosschain/types"
gravitytypes "github.com/functionx/fx-core/v6/x/gravity/types"
)

// EncodingConfig specifies the concrete encoding types to use for a given app.
Expand Down
2 changes: 1 addition & 1 deletion app/encoding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/stretchr/testify/assert"

"github.com/functionx/fx-core/v5/app"
"github.com/functionx/fx-core/v6/app"
)

func TestMakeEncodingConfig_RegisterInterfaces(t *testing.T) {
Expand Down
10 changes: 5 additions & 5 deletions app/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import (
"github.com/tendermint/tendermint/types"
dbm "github.com/tendermint/tm-db"

"github.com/functionx/fx-core/v5/app"
"github.com/functionx/fx-core/v5/testutil"
"github.com/functionx/fx-core/v5/testutil/helpers"
"github.com/functionx/fx-core/v5/testutil/network"
fxtypes "github.com/functionx/fx-core/v5/types"
"github.com/functionx/fx-core/v6/app"
"github.com/functionx/fx-core/v6/testutil"
"github.com/functionx/fx-core/v6/testutil/helpers"
"github.com/functionx/fx-core/v6/testutil/network"
fxtypes "github.com/functionx/fx-core/v6/types"
)

func TestUseExportGenesisDataRunNode(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions app/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import (
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
tmtypes "github.com/tendermint/tendermint/types"

fxtypes "github.com/functionx/fx-core/v5/types"
ethtypes "github.com/functionx/fx-core/v5/x/eth/types"
fxstakingtypes "github.com/functionx/fx-core/v5/x/staking/types"
fxtypes "github.com/functionx/fx-core/v6/types"
ethtypes "github.com/functionx/fx-core/v6/x/eth/types"
fxstakingtypes "github.com/functionx/fx-core/v6/x/staking/types"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions app/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (

"github.com/stretchr/testify/assert"

"github.com/functionx/fx-core/v5/app"
fxtypes "github.com/functionx/fx-core/v5/types"
"github.com/functionx/fx-core/v6/app"
fxtypes "github.com/functionx/fx-core/v6/types"
)

func TestNewDefaultGenesisByDenom(t *testing.T) {
Expand Down
54 changes: 27 additions & 27 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,33 +53,33 @@ import (
feemarkettypes "github.com/evmos/ethermint/x/feemarket/types"
"github.com/spf13/cast"

fxtypes "github.com/functionx/fx-core/v5/types"
arbitrumtypes "github.com/functionx/fx-core/v5/x/arbitrum/types"
fxauthzkeeper "github.com/functionx/fx-core/v5/x/authz/keeper"
avalanchetypes "github.com/functionx/fx-core/v5/x/avalanche/types"
bsctypes "github.com/functionx/fx-core/v5/x/bsc/types"
"github.com/functionx/fx-core/v5/x/crosschain"
crosschainkeeper "github.com/functionx/fx-core/v5/x/crosschain/keeper"
crosschaintypes "github.com/functionx/fx-core/v5/x/crosschain/types"
"github.com/functionx/fx-core/v5/x/erc20"
erc20keeper "github.com/functionx/fx-core/v5/x/erc20/keeper"
erc20types "github.com/functionx/fx-core/v5/x/erc20/types"
ethtypes "github.com/functionx/fx-core/v5/x/eth/types"
fxevmkeeper "github.com/functionx/fx-core/v5/x/evm/keeper"
fxgovkeeper "github.com/functionx/fx-core/v5/x/gov/keeper"
fxgovtypes "github.com/functionx/fx-core/v5/x/gov/types"
gravitytypes "github.com/functionx/fx-core/v5/x/gravity/types"
fxtransfer "github.com/functionx/fx-core/v5/x/ibc/applications/transfer"
fxtransferkeeper "github.com/functionx/fx-core/v5/x/ibc/applications/transfer/keeper"
"github.com/functionx/fx-core/v5/x/ibc/ibcrouter"
migratekeeper "github.com/functionx/fx-core/v5/x/migrate/keeper"
migratetypes "github.com/functionx/fx-core/v5/x/migrate/types"
optimismtypes "github.com/functionx/fx-core/v5/x/optimism/types"
polygontypes "github.com/functionx/fx-core/v5/x/polygon/types"
fxslashingkeeper "github.com/functionx/fx-core/v5/x/slashing/keeper"
fxstakingkeeper "github.com/functionx/fx-core/v5/x/staking/keeper"
tronkeeper "github.com/functionx/fx-core/v5/x/tron/keeper"
trontypes "github.com/functionx/fx-core/v5/x/tron/types"
fxtypes "github.com/functionx/fx-core/v6/types"
arbitrumtypes "github.com/functionx/fx-core/v6/x/arbitrum/types"
fxauthzkeeper "github.com/functionx/fx-core/v6/x/authz/keeper"
avalanchetypes "github.com/functionx/fx-core/v6/x/avalanche/types"
bsctypes "github.com/functionx/fx-core/v6/x/bsc/types"
"github.com/functionx/fx-core/v6/x/crosschain"
crosschainkeeper "github.com/functionx/fx-core/v6/x/crosschain/keeper"
crosschaintypes "github.com/functionx/fx-core/v6/x/crosschain/types"
"github.com/functionx/fx-core/v6/x/erc20"
erc20keeper "github.com/functionx/fx-core/v6/x/erc20/keeper"
erc20types "github.com/functionx/fx-core/v6/x/erc20/types"
ethtypes "github.com/functionx/fx-core/v6/x/eth/types"
fxevmkeeper "github.com/functionx/fx-core/v6/x/evm/keeper"
fxgovkeeper "github.com/functionx/fx-core/v6/x/gov/keeper"
fxgovtypes "github.com/functionx/fx-core/v6/x/gov/types"
gravitytypes "github.com/functionx/fx-core/v6/x/gravity/types"
fxtransfer "github.com/functionx/fx-core/v6/x/ibc/applications/transfer"
fxtransferkeeper "github.com/functionx/fx-core/v6/x/ibc/applications/transfer/keeper"
"github.com/functionx/fx-core/v6/x/ibc/ibcrouter"
migratekeeper "github.com/functionx/fx-core/v6/x/migrate/keeper"
migratetypes "github.com/functionx/fx-core/v6/x/migrate/types"
optimismtypes "github.com/functionx/fx-core/v6/x/optimism/types"
polygontypes "github.com/functionx/fx-core/v6/x/polygon/types"
fxslashingkeeper "github.com/functionx/fx-core/v6/x/slashing/keeper"
fxstakingkeeper "github.com/functionx/fx-core/v6/x/staking/keeper"
tronkeeper "github.com/functionx/fx-core/v6/x/tron/keeper"
trontypes "github.com/functionx/fx-core/v6/x/tron/types"
)

type CrossChainKeepers struct {
Expand Down
22 changes: 11 additions & 11 deletions app/keepers/keepers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ import (
tmlog "github.com/tendermint/tendermint/libs/log"
dbm "github.com/tendermint/tm-db"

"github.com/functionx/fx-core/v5/app"
"github.com/functionx/fx-core/v5/app/keepers"
fxtypes "github.com/functionx/fx-core/v5/types"
arbitrumtypes "github.com/functionx/fx-core/v5/x/arbitrum/types"
avalanchetypes "github.com/functionx/fx-core/v5/x/avalanche/types"
bsctypes "github.com/functionx/fx-core/v5/x/bsc/types"
erc20types "github.com/functionx/fx-core/v5/x/erc20/types"
ethtypes "github.com/functionx/fx-core/v5/x/eth/types"
optimismtypes "github.com/functionx/fx-core/v5/x/optimism/types"
polygontypes "github.com/functionx/fx-core/v5/x/polygon/types"
trontypes "github.com/functionx/fx-core/v5/x/tron/types"
"github.com/functionx/fx-core/v6/app"
"github.com/functionx/fx-core/v6/app/keepers"
fxtypes "github.com/functionx/fx-core/v6/types"
arbitrumtypes "github.com/functionx/fx-core/v6/x/arbitrum/types"
avalanchetypes "github.com/functionx/fx-core/v6/x/avalanche/types"
bsctypes "github.com/functionx/fx-core/v6/x/bsc/types"
erc20types "github.com/functionx/fx-core/v6/x/erc20/types"
ethtypes "github.com/functionx/fx-core/v6/x/eth/types"
optimismtypes "github.com/functionx/fx-core/v6/x/optimism/types"
polygontypes "github.com/functionx/fx-core/v6/x/polygon/types"
trontypes "github.com/functionx/fx-core/v6/x/tron/types"
)

func TestNewAppKeeper(t *testing.T) {
Expand Down
24 changes: 12 additions & 12 deletions app/keepers/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ import (
evmtypes "github.com/evmos/ethermint/x/evm/types"
feemarkettypes "github.com/evmos/ethermint/x/feemarket/types"

fxtypes "github.com/functionx/fx-core/v5/types"
arbitrumtypes "github.com/functionx/fx-core/v5/x/arbitrum/types"
avalanchetypes "github.com/functionx/fx-core/v5/x/avalanche/types"
bsctypes "github.com/functionx/fx-core/v5/x/bsc/types"
erc20types "github.com/functionx/fx-core/v5/x/erc20/types"
ethtypes "github.com/functionx/fx-core/v5/x/eth/types"
precompilescrosschain "github.com/functionx/fx-core/v5/x/evm/precompiles/crosschain"
precompilesstaking "github.com/functionx/fx-core/v5/x/evm/precompiles/staking"
migratetypes "github.com/functionx/fx-core/v5/x/migrate/types"
optimismtypes "github.com/functionx/fx-core/v5/x/optimism/types"
polygontypes "github.com/functionx/fx-core/v5/x/polygon/types"
trontypes "github.com/functionx/fx-core/v5/x/tron/types"
fxtypes "github.com/functionx/fx-core/v6/types"
arbitrumtypes "github.com/functionx/fx-core/v6/x/arbitrum/types"
avalanchetypes "github.com/functionx/fx-core/v6/x/avalanche/types"
bsctypes "github.com/functionx/fx-core/v6/x/bsc/types"
erc20types "github.com/functionx/fx-core/v6/x/erc20/types"
ethtypes "github.com/functionx/fx-core/v6/x/eth/types"
precompilescrosschain "github.com/functionx/fx-core/v6/x/evm/precompiles/crosschain"
precompilesstaking "github.com/functionx/fx-core/v6/x/evm/precompiles/staking"
migratetypes "github.com/functionx/fx-core/v6/x/migrate/types"
optimismtypes "github.com/functionx/fx-core/v6/x/optimism/types"
polygontypes "github.com/functionx/fx-core/v6/x/polygon/types"
trontypes "github.com/functionx/fx-core/v6/x/tron/types"
)

func (appKeepers *AppKeepers) generateKeys() {
Expand Down
Loading
Loading