Skip to content

Commit

Permalink
Merge branch 'cosmos-sdk-v0.47' of https://github.com/bandprotocol/chain
Browse files Browse the repository at this point in the history
 into extra-rest-47
  • Loading branch information
RogerKSI committed Sep 21, 2023
2 parents 220ee89 + c5d214b commit c5ecae0
Show file tree
Hide file tree
Showing 29 changed files with 67 additions and 65 deletions.
3 changes: 3 additions & 0 deletions app/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
if options.IBCKeeper == nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "IBC keeper is required for AnteHandler")
}
if options.StakingKeeper == nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "Staking keeper is required for AnteHandler")
}
if options.GlobalfeeKeeper == nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "Globalfee keeper is required for AnteHandler")
}
Expand Down
2 changes: 1 addition & 1 deletion app/keepers/keepers.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package keepers

import (
globalfeekeeper "github.com/bandprotocol/chain/v2/x/globalfee/keeper"
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper"
capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper"
Expand All @@ -22,6 +21,7 @@ import (
ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper"

bandbankkeeper "github.com/bandprotocol/chain/v2/x/bank/keeper"
globalfeekeeper "github.com/bandprotocol/chain/v2/x/globalfee/keeper"
oraclekeeper "github.com/bandprotocol/chain/v2/x/oracle/keeper"
)

Expand Down
3 changes: 2 additions & 1 deletion app/upgrades/types.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package upgrades

import (
"github.com/bandprotocol/chain/v2/app/keepers"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
store "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

"github.com/bandprotocol/chain/v2/app/keepers"
)

// Upgrade defines a struct containing necessary fields that a SoftwareUpgradeProposal
Expand Down
3 changes: 2 additions & 1 deletion app/upgrades/v2_4/constants.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package v2_4

import (
"github.com/bandprotocol/chain/v2/app/upgrades"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types"

"github.com/bandprotocol/chain/v2/app/upgrades"
)

const UpgradeName = "v2_4"
Expand Down
10 changes: 5 additions & 5 deletions app/upgrades/v2_4/upgrades.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package v2_4

import (
"github.com/bandprotocol/chain/v2/app/keepers"
"github.com/bandprotocol/chain/v2/app/upgrades"
oracletypes "github.com/bandprotocol/chain/v2/x/oracle/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"
"github.com/cosmos/cosmos-sdk/x/authz"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
Expand All @@ -18,8 +17,9 @@ import (
icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types"
ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/bandprotocol/chain/v2/app/keepers"
"github.com/bandprotocol/chain/v2/app/upgrades"
oracletypes "github.com/bandprotocol/chain/v2/x/oracle/types"
)

func CreateUpgradeHandler(
Expand Down
3 changes: 2 additions & 1 deletion app/upgrades/v2_5/constants.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package v2_5

import (
"github.com/bandprotocol/chain/v2/app/upgrades"
storetypes "github.com/cosmos/cosmos-sdk/store/types"

"github.com/bandprotocol/chain/v2/app/upgrades"
)

const UpgradeName = "v2_5"
Expand Down
8 changes: 4 additions & 4 deletions app/upgrades/v2_5/upgrades.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package v2_5

import (
"github.com/bandprotocol/chain/v2/app/keepers"
"github.com/bandprotocol/chain/v2/app/upgrades"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

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

"github.com/bandprotocol/chain/v2/app/keepers"
"github.com/bandprotocol/chain/v2/app/upgrades"
)

func CreateUpgradeHandler(
Expand Down
10 changes: 5 additions & 5 deletions app/upgrades/v2_6/upgrades.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package v2_6

import (
"github.com/bandprotocol/chain/v2/app/keepers"
"github.com/bandprotocol/chain/v2/app/upgrades"
globalfeetypes "github.com/bandprotocol/chain/v2/x/globalfee/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/bandprotocol/chain/v2/app/keepers"
"github.com/bandprotocol/chain/v2/app/upgrades"
globalfeetypes "github.com/bandprotocol/chain/v2/x/globalfee/types"
)

func CreateUpgradeHandler(
Expand Down
5 changes: 3 additions & 2 deletions benchmark/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ import (
"testing"
"time"

oraclekeeper "github.com/bandprotocol/chain/v2/x/oracle/keeper"
oracletypes "github.com/bandprotocol/chain/v2/x/oracle/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/stretchr/testify/require"

oraclekeeper "github.com/bandprotocol/chain/v2/x/oracle/keeper"
oracletypes "github.com/bandprotocol/chain/v2/x/oracle/types"
)

var PrepareCases = map[string]struct {
Expand Down
7 changes: 4 additions & 3 deletions benchmark/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ import (
"testing"
"time"

"github.com/bandprotocol/chain/v2/pkg/obi"
"github.com/bandprotocol/chain/v2/testing/testapp"
oracletypes "github.com/bandprotocol/chain/v2/x/oracle/types"
owasm "github.com/bandprotocol/go-owasm/api"
types "github.com/cometbft/cometbft/abci/types"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
Expand All @@ -19,6 +16,10 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/stretchr/testify/require"

"github.com/bandprotocol/chain/v2/pkg/obi"
"github.com/bandprotocol/chain/v2/testing/testapp"
oracletypes "github.com/bandprotocol/chain/v2/x/oracle/types"
)

type Account struct {
Expand Down
3 changes: 2 additions & 1 deletion client/grpc/oracle/proof/proof_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import (
"encoding/hex"
"testing"

oracletypes "github.com/bandprotocol/chain/v2/x/oracle/types"
"github.com/cometbft/cometbft/crypto/tmhash"
"github.com/stretchr/testify/require"

oracletypes "github.com/bandprotocol/chain/v2/x/oracle/types"
)

func hexToBytes(hexstr string) []byte {
Expand Down
5 changes: 3 additions & 2 deletions client/grpc/oracle/proof/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import (
"encoding/json"
"fmt"

"github.com/bandprotocol/chain/v2/x/oracle/types"
oracletypes "github.com/bandprotocol/chain/v2/x/oracle/types"
rpcclient "github.com/cometbft/cometbft/rpc/client"
"github.com/cosmos/cosmos-sdk/client"
gogogrpc "github.com/cosmos/gogoproto/grpc"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/grpc-ecosystem/grpc-gateway/runtime"

"github.com/bandprotocol/chain/v2/x/oracle/types"
oracletypes "github.com/bandprotocol/chain/v2/x/oracle/types"
)

// RegisterProofService registers the node gRPC service on the provided gRPC router.
Expand Down
2 changes: 1 addition & 1 deletion client/grpc/oracle/proof/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
gogotypes "github.com/cosmos/gogoproto/types"
)

// Copied from https://github.com/cometbft/cometbft/blob/master/types/encoding_helper.go
// Copied from https://github.com/cometbft/cometbft/blob/v0.37.2/types/encoding_helper.go
func cdcEncode(item interface{}) []byte {
if item != nil && !isTypedNil(item) && !isEmpty(item) {
switch item := item.(type) {
Expand Down
1 change: 0 additions & 1 deletion cmd/bandd/cmd/gends.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/spf13/cobra"

"github.com/bandprotocol/chain/v2/pkg/filecache"

"github.com/bandprotocol/chain/v2/x/oracle/types"
)

Expand Down
3 changes: 1 addition & 2 deletions cmd/bandd/cmd/genos.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"io/ioutil"
"path/filepath"

"github.com/bandprotocol/go-owasm/api"
"github.com/cometbft/cometbft/libs/cli"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/server"
Expand All @@ -15,8 +16,6 @@ import (
"github.com/spf13/cobra"

"github.com/bandprotocol/chain/v2/pkg/filecache"
"github.com/bandprotocol/go-owasm/api"

"github.com/bandprotocol/chain/v2/x/oracle/types"
)

Expand Down
16 changes: 7 additions & 9 deletions testing/testapp/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ import (
"testing"
"time"

owasm "github.com/bandprotocol/go-owasm/api"
dbm "github.com/cometbft/cometbft-db"
abci "github.com/cometbft/cometbft/abci/types"
"github.com/cometbft/cometbft/libs/log"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
tmtypes "github.com/cometbft/cometbft/types"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
Expand All @@ -31,19 +37,11 @@ import (
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"

dbm "github.com/cometbft/cometbft-db"
abci "github.com/cometbft/cometbft/abci/types"
"github.com/cometbft/cometbft/libs/log"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
tmtypes "github.com/cometbft/cometbft/types"
ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper"
"github.com/stretchr/testify/require"

"github.com/bandprotocol/chain/v2/pkg/filecache"
owasm "github.com/bandprotocol/go-owasm/api"

bandapp "github.com/bandprotocol/chain/v2/app"
"github.com/bandprotocol/chain/v2/pkg/filecache"
"github.com/bandprotocol/chain/v2/x/oracle/keeper"
"github.com/bandprotocol/chain/v2/x/oracle/types"
)
Expand Down
3 changes: 2 additions & 1 deletion x/bank/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ package bank
import (
"fmt"

"github.com/bandprotocol/chain/v2/x/bank/keeper"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/x/bank"
"github.com/cosmos/cosmos-sdk/x/bank/exported"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
"github.com/cosmos/cosmos-sdk/x/bank/types"

"github.com/bandprotocol/chain/v2/x/bank/keeper"
)

var (
Expand Down
9 changes: 4 additions & 5 deletions x/globalfee/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ func GetQueryCmd() *cobra.Command {

func GetQueryCmdParams() *cobra.Command {
cmd := &cobra.Command{
Use: "params",
Short: "Show params",
Long: "Show parameter of globalfee module",
Aliases: []string{"min"},
Args: cobra.ExactArgs(0),
Use: "params",
Short: "Show params",
Long: "Show parameter of globalfee module",
Args: cobra.ExactArgs(0),
RunE: func(cmd *cobra.Command, args []string) error {
clientCtx, err := client.GetClientQueryContext(cmd)
if err != nil {
Expand Down
3 changes: 1 addition & 2 deletions x/oracle/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ import (
"testing"
"time"

"github.com/bandprotocol/go-owasm/api"
abci "github.com/cometbft/cometbft/abci/types"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/stretchr/testify/require"

"github.com/bandprotocol/go-owasm/api"

"github.com/bandprotocol/chain/v2/testing/testapp"
"github.com/bandprotocol/chain/v2/x/oracle"
"github.com/bandprotocol/chain/v2/x/oracle/types"
Expand Down
7 changes: 3 additions & 4 deletions x/oracle/ibc_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@ import (
"math"
"strings"

"github.com/bandprotocol/chain/v2/x/oracle/keeper"
"github.com/bandprotocol/chain/v2/x/oracle/types"

sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"

channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types"
host "github.com/cosmos/ibc-go/v7/modules/core/24-host"
ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"

"github.com/bandprotocol/chain/v2/x/oracle/keeper"
"github.com/bandprotocol/chain/v2/x/oracle/types"
)

// IBCModule implements the ICS26 interface for oracle given the oracle keeper.
Expand Down
1 change: 0 additions & 1 deletion x/oracle/ibc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/stretchr/testify/suite"

"github.com/bandprotocol/chain/v2/pkg/obi"

ibctesting "github.com/bandprotocol/chain/v2/testing"
"github.com/bandprotocol/chain/v2/testing/testapp"
"github.com/bandprotocol/chain/v2/x/oracle/types"
Expand Down
3 changes: 1 addition & 2 deletions x/oracle/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"time"

owasm "github.com/bandprotocol/go-owasm/api"
"github.com/cometbft/cometbft/libs/log"
"github.com/cosmos/cosmos-sdk/codec"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
Expand All @@ -14,8 +15,6 @@ import (
capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"
host "github.com/cosmos/ibc-go/v7/modules/core/24-host"

owasm "github.com/bandprotocol/go-owasm/api"

"github.com/bandprotocol/chain/v2/pkg/filecache"
"github.com/bandprotocol/chain/v2/x/oracle/types"
)
Expand Down
3 changes: 2 additions & 1 deletion x/oracle/keeper/migrator.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package keeper

import (
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/bandprotocol/chain/v2/x/oracle/exported"
v2 "github.com/bandprotocol/chain/v2/x/oracle/migrations/v2"
sdk "github.com/cosmos/cosmos-sdk/types"
)

// Migrator is a struct for handling in-place state migrations.
Expand Down
1 change: 0 additions & 1 deletion x/oracle/keeper/owasm.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"

"github.com/bandprotocol/chain/v2/pkg/bandrng"

"github.com/bandprotocol/chain/v2/x/oracle/types"
)

Expand Down
1 change: 0 additions & 1 deletion x/oracle/keeper/owasm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"github.com/stretchr/testify/require"

"github.com/bandprotocol/chain/v2/pkg/obi"

"github.com/bandprotocol/chain/v2/testing/testapp"
"github.com/bandprotocol/chain/v2/x/oracle/keeper"
"github.com/bandprotocol/chain/v2/x/oracle/types"
Expand Down
5 changes: 3 additions & 2 deletions x/oracle/keeper/snapshotter_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package keeper_test
import (
"testing"

"github.com/bandprotocol/chain/v2/testing/testapp"
"github.com/bandprotocol/chain/v2/x/oracle/keeper"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/bandprotocol/chain/v2/testing/testapp"
"github.com/bandprotocol/chain/v2/x/oracle/keeper"
)

func TestSnapshotter(t *testing.T) {
Expand Down
Loading

0 comments on commit c5ecae0

Please sign in to comment.