Skip to content

Commit

Permalink
sdk v50, ibc v8, wasmd v50
Browse files Browse the repository at this point in the history
  • Loading branch information
cgsingh33 committed Jan 20, 2024
1 parent 47bd654 commit 70bdf72
Show file tree
Hide file tree
Showing 396 changed files with 7,849 additions and 7,566 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ endif
#$(info $$BUILD_FLAGS is [$(BUILD_FLAGS)])

check_version:
ifneq ($(GO_MINOR_VERSION),20)
@echo "ERROR: Please upgrade Go version to 1.20+"
ifneq ($(GO_MINOR_VERSION),21)
@echo "ERROR: Please upgrade Go version to 1.21+"
exit 1
endif

Expand Down Expand Up @@ -190,7 +190,7 @@ endif
### Protobuf ###
###############################################################################

protoVer=0.13.0
protoVer=0.14.0
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)

Expand Down
27 changes: 15 additions & 12 deletions app/ante.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package app

import (
corestoretypes "cosmossdk.io/core/store"
errorsmod "cosmossdk.io/errors"
"github.com/CosmWasm/wasmd/x/wasm"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
"github.com/comdex-official/comdex/app/decorators"
Expand All @@ -9,31 +11,31 @@ import (
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
ibcante "github.com/cosmos/ibc-go/v8/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper"
)

// HandlerOptions extend the SDK's AnteHandler options by requiring the IBC
// channel keeper.
type HandlerOptions struct {
ante.HandlerOptions
wasmConfig wasm.Config
txCounterStoreKey storetypes.StoreKey
IBCChannelKeeper *ibckeeper.Keeper
GovKeeper govkeeper.Keeper
Cdc codec.BinaryCodec
wasmConfig wasm.Config
WasmKeeper *wasmkeeper.Keeper
TXCounterStoreService corestoretypes.KVStoreService
IBCChannelKeeper *ibckeeper.Keeper
GovKeeper govkeeper.Keeper
Cdc codec.BinaryCodec
}

func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
if options.AccountKeeper == nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "account keeper is required for AnteHandler")
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "account keeper is required for AnteHandler")
}
if options.BankKeeper == nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "bank keeper is required for AnteHandler")
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "bank keeper is required for AnteHandler")
}
if options.SignModeHandler == nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder")
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder")
}

sigGasConsumer := options.SigGasConsumer
Expand All @@ -44,7 +46,8 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
anteDecorators := []sdk.AnteDecorator{
ante.NewSetUpContextDecorator(),
wasmkeeper.NewLimitSimulationGasDecorator(options.wasmConfig.SimulationGasLimit),
wasmkeeper.NewCountTXDecorator(options.txCounterStoreKey),
wasmkeeper.NewCountTXDecorator(options.TXCounterStoreService),
wasmkeeper.NewGasRegisterDecorator(options.WasmKeeper.GetGasRegister()),
decorators.NewGovPreventSpamDecorator(options.Cdc, options.GovKeeper),
ante.NewExtensionOptionsDecorator(options.ExtensionOptionChecker),
ante.NewValidateBasicDecorator(),
Expand Down
Loading

0 comments on commit 70bdf72

Please sign in to comment.