Skip to content

Commit

Permalink
Merge pull request #890 from comdex-official/feature/dev
Browse files Browse the repository at this point in the history
v14 upgrade
  • Loading branch information
cgsingh33 authored Jun 19, 2024
2 parents 4982138 + 973e1bf commit 349f924
Show file tree
Hide file tree
Showing 208 changed files with 7,265 additions and 2,822 deletions.
Binary file removed .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/[email protected]
with:
go-version: 1.20.5
go-version: 1.21.7
id: go

- name: Check out code into the Go module directory˛˜
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/checkout@v3
- uses: actions/[email protected]
with:
go-version: 1.20.5
go-version: 1.21.7
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
steps:
- uses: actions/[email protected]
with:
go-version: 1.20.5 # we run the linter with go 1.20 to match dev laptops even though we use 1.18 for the chain (don't update the chain to 1.19 please-- there is an issue in golang causing 1.19 to output some hashes differently from 1.18)
go-version: 1.21.7 # we run the linter with go 1.21 to match dev laptops even though we use 1.18 for the chain (don't update the chain to 1.19 please-- there is an issue in golang causing 1.19 to output some hashes differently from 1.18)
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/[email protected]
with:
go-version: 1.20.5
go-version: 1.21.7
id: go

- name: Check out code into the Go module directory
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
name: Setup Golang
uses: actions/[email protected]
with:
go-version: 1.20.5
go-version: 1.21.7
-
name: Display go version
run: go version
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ GOBIN = $(shell go env GOPATH)/bin
GOARCH = $(shell go env GOARCH)
GOOS = $(shell go env GOOS)
GO_MINOR_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2)
GO_MINIMUM_MINOR_VERSION = $(shell cat go.mod | grep -E 'go [0-9].[0-9]+' | cut -d ' ' -f2 | cut -d'.' -f2)

export GO111MODULE = on

Expand Down Expand Up @@ -94,8 +95,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_MINIMUM_MINOR_VERSION),21)
@echo "ERROR: Please upgrade Go version to 1.21+"
exit 1
endif

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ If you have technical questions or concerns, ask a developer or community member

### Installation

Requires [Go 1.20+](https://golang.org/dl/)
Requires [Go 1.21+](https://golang.org/dl/)

### Linux

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

import (
"github.com/CosmWasm/wasmd/x/wasm"
errorsmod "cosmossdk.io/errors"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
"github.com/comdex-official/comdex/app/decorators"
"github.com/cosmos/cosmos-sdk/codec"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
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"
auctionanteskip "github.com/skip-mev/block-sdk/x/auction/ante"
auctionkeeperskip "github.com/skip-mev/block-sdk/x/auction/keeper"
)

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

MEVLane auctionanteskip.MEVLane
TxDecoder sdk.TxDecoder
TxEncoder sdk.TxEncoder
auctionkeeperskip auctionkeeperskip.Keeper
}

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 @@ -59,6 +67,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
ante.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler),
ante.NewIncrementSequenceDecorator(options.AccountKeeper),
ibcante.NewRedundantRelayDecorator(options.IBCChannelKeeper),
auctionanteskip.NewAuctionDecorator(options.auctionkeeperskip, options.TxEncoder, options.MEVLane),
}

return sdk.ChainAnteDecorators(anteDecorators...), nil
Expand Down
Loading

0 comments on commit 349f924

Please sign in to comment.