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

Upgrate to cosmos-sdk v0.50 and ibc-go v8 #170

Merged
merged 17 commits into from
Apr 22, 2024
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
-w -s -linkmode=external -extldflags '-Wl,-z,muldefs -static'" \
-trimpath \
-o /feeapp/bin/feeappd \
/feeapp/cmd/feeappd/main.go
/feeapp/cmd/feeappd

# --------------------------------------------------------
# Runner
Expand Down
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ LEDGER_ENABLED ?= true
SDK_PACK := $(shell go list -m github.com/cosmos/cosmos-sdk | sed 's/ /\@/g')
TM_VERSION := $(shell go list -m github.com/cometbft/cometbft | sed 's:.* ::')
DOCKER := $(shell which docker)
DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf:1.0.0-rc8
BUF_IMAGE=bufbuild/buf@sha256:3cb1f8a4b48bd5ad8f09168f10f607ddc318af202f5c057d52a45216793d85e5 #v1.4.0
DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(BUF_IMAGE)
BUILDDIR ?= $(CURDIR)/build
HTTPS_GIT := https://github.com/osmosis-labs/fee-abstraction.git

Expand Down Expand Up @@ -128,11 +129,14 @@ ictest-host-zone-proposal:
cd tests/interchaintest && go test -timeout=25m -race -v -run TestHostZoneProposal .

ictest-feeabs:
cd tests/interchaintest && go test -timeout=25m -race -v -run TestFeeabs .
cd tests/interchaintest && go test -timeout=25m -race -v -run '^TestFeeAbs$$' .

ictest-query-osmosis-twap:
cd tests/interchaintest && go test -timeout=25m -race -v -run TestQueryOsmosisTwap .

# ictest-feeabs-ibc-transfer:
# cd tests/interchaintest && go test -timeout=25m -race -v -run TestIBCTransferWithFeeAbs .

# Executes all tests via interchaintest after compling a local image as juno:local
ictest-all: ictest-basic ictest-ibc ictest-packet-forward ictest-host-zone-proposal ictest-query-osmosis-twap ictest-feeabs

Expand Down
20 changes: 10 additions & 10 deletions app/ante.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package app

import (
ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper"
ibcante "github.com/cosmos/ibc-go/v8/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper"

sdkerrors "cosmossdk.io/errors"
"cosmossdk.io/errors"

sdk "github.com/cosmos/cosmos-sdk/types"
errorstypes "github.com/cosmos/cosmos-sdk/types/errors"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/auth/ante"

feeabsante "github.com/osmosis-labs/fee-abstraction/v8/x/feeabs/ante"
Expand All @@ -19,23 +19,23 @@ type HandlerOptions struct {
ante.HandlerOptions

IBCKeeper *ibckeeper.Keeper
FeeAbskeeper feeabskeeper.Keeper
FeeAbsKeeper feeabskeeper.Keeper
}

// NewAnteHandler returns an AnteHandler that checks and increments sequence
// numbers, checks signatures & account numbers, and deducts fees from the first
// signer.
func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
if options.AccountKeeper == nil {
return nil, sdkerrors.Wrap(errorstypes.ErrLogic, "account keeper is required for ante builder")
return nil, errors.Wrap(sdkerrors.ErrLogic, "account keeper is required for ante builder")
}

if options.BankKeeper == nil {
return nil, sdkerrors.Wrap(errorstypes.ErrLogic, "bank keeper is required for ante builder")
return nil, errors.Wrap(sdkerrors.ErrLogic, "bank keeper is required for ante builder")
}

if options.SignModeHandler == nil {
return nil, sdkerrors.Wrap(errorstypes.ErrLogic, "sign mode handler is required for ante builder")
return nil, errors.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder")
}

sigGasConsumer := options.SigGasConsumer
Expand All @@ -46,12 +46,12 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
anteDecorators := []sdk.AnteDecorator{
ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first
ante.RejectExtensionOptionsDecorator{},
feeabsante.NewFeeAbstrationMempoolFeeDecorator(options.FeeAbskeeper),
feeabsante.NewFeeAbstrationMempoolFeeDecorator(options.FeeAbsKeeper),
ante.NewValidateBasicDecorator(),
ante.NewTxTimeoutHeightDecorator(),
ante.NewValidateMemoDecorator(options.AccountKeeper),
ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper),
feeabsante.NewFeeAbstractionDeductFeeDecorate(options.AccountKeeper, options.BankKeeper, options.FeeAbskeeper, options.FeegrantKeeper),
feeabsante.NewFeeAbstractionDeductFeeDecorate(options.AccountKeeper, options.BankKeeper, options.FeeAbsKeeper, options.FeegrantKeeper),
// SetPubKeyDecorator must be called before all signature verification decorators
ante.NewSetPubKeyDecorator(options.AccountKeeper),
ante.NewValidateSigCountDecorator(options.AccountKeeper),
Expand Down
Loading
Loading