Skip to content

Commit 4048791

Browse files
tnv1tuantran1702nghuyenthevinh2000
authored
Upgrate to cosmos-sdk v0.50 and ibc-go v8 (#170)
* Draft upgrate to cosmos-sdk v0.50 and ibc-go v8 * Change dependencies compatible with cosmos-sdk 0.50 * Change Dec to LegacyDec * Fix some lints * Fix bugs * Fix test and lint * Fix: Fix workflow to run all interchaintest tests as expected (#174) * fix running wrong test in Makefile, also catching bug when upload contract * add missing field in init message of xcsV2 * fix interchaintest * fix interchaintest ictest-ibc --------- Co-authored-by: nghuyenthevinh2000 <[email protected]> * Fix conflicts * Go mod tidy * Make lint * Update interchaintest * Fix linys * Fix dockerfile * Fix bech32 addr prefix * Fix interchaintest * Fix missing light clients * Fix lint --------- Co-authored-by: Tuan Tran <[email protected]> Co-authored-by: nghuyenthevinh2000 <[email protected]>
1 parent 2aec475 commit 4048791

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+3402
-3571
lines changed

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
4040
-w -s -linkmode=external -extldflags '-Wl,-z,muldefs -static'" \
4141
-trimpath \
4242
-o /feeapp/bin/feeappd \
43-
/feeapp/cmd/feeappd/main.go
43+
/feeapp/cmd/feeappd
4444

4545
# --------------------------------------------------------
4646
# Runner

Makefile

+6-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ LEDGER_ENABLED ?= true
1515
SDK_PACK := $(shell go list -m github.com/cosmos/cosmos-sdk | sed 's/ /\@/g')
1616
TM_VERSION := $(shell go list -m github.com/cometbft/cometbft | sed 's:.* ::')
1717
DOCKER := $(shell which docker)
18-
DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf:1.0.0-rc8
18+
BUF_IMAGE=bufbuild/buf@sha256:3cb1f8a4b48bd5ad8f09168f10f607ddc318af202f5c057d52a45216793d85e5 #v1.4.0
19+
DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(BUF_IMAGE)
1920
BUILDDIR ?= $(CURDIR)/build
2021
HTTPS_GIT := https://github.com/osmosis-labs/fee-abstraction.git
2122

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

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

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

137+
# ictest-feeabs-ibc-transfer:
138+
# cd tests/interchaintest && go test -timeout=25m -race -v -run TestIBCTransferWithFeeAbs .
139+
136140
# Executes all tests via interchaintest after compling a local image as juno:local
137141
ictest-all: ictest-basic ictest-ibc ictest-packet-forward ictest-host-zone-proposal ictest-query-osmosis-twap ictest-feeabs
138142

app/ante.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package app
22

33
import (
4-
ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante"
5-
ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper"
4+
ibcante "github.com/cosmos/ibc-go/v8/modules/core/ante"
5+
ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper"
66

7-
sdkerrors "cosmossdk.io/errors"
7+
"cosmossdk.io/errors"
88

99
sdk "github.com/cosmos/cosmos-sdk/types"
10-
errorstypes "github.com/cosmos/cosmos-sdk/types/errors"
10+
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
1111
"github.com/cosmos/cosmos-sdk/x/auth/ante"
1212

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

2121
IBCKeeper *ibckeeper.Keeper
22-
FeeAbskeeper feeabskeeper.Keeper
22+
FeeAbsKeeper feeabskeeper.Keeper
2323
}
2424

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

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

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

4141
sigGasConsumer := options.SigGasConsumer
@@ -46,12 +46,12 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
4646
anteDecorators := []sdk.AnteDecorator{
4747
ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first
4848
ante.RejectExtensionOptionsDecorator{},
49-
feeabsante.NewFeeAbstrationMempoolFeeDecorator(options.FeeAbskeeper),
49+
feeabsante.NewFeeAbstrationMempoolFeeDecorator(options.FeeAbsKeeper),
5050
ante.NewValidateBasicDecorator(),
5151
ante.NewTxTimeoutHeightDecorator(),
5252
ante.NewValidateMemoDecorator(options.AccountKeeper),
5353
ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper),
54-
feeabsante.NewFeeAbstractionDeductFeeDecorate(options.AccountKeeper, options.BankKeeper, options.FeeAbskeeper, options.FeegrantKeeper),
54+
feeabsante.NewFeeAbstractionDeductFeeDecorate(options.AccountKeeper, options.BankKeeper, options.FeeAbsKeeper, options.FeegrantKeeper),
5555
// SetPubKeyDecorator must be called before all signature verification decorators
5656
ante.NewSetPubKeyDecorator(options.AccountKeeper),
5757
ante.NewValidateSigCountDecorator(options.AccountKeeper),

0 commit comments

Comments
 (0)