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

[v16] SDK v47 upgrade #646

Merged
merged 140 commits into from
May 22, 2023
Merged
Show file tree
Hide file tree
Changes from 133 commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
6707a03
add async-icq support to juno
faddat Apr 11, 2023
2aefeef
save keepers.go
faddat Apr 11, 2023
a431cc3
create icq module, and add to ibc router
faddat Apr 11, 2023
331a47a
return the accepted stargate queries for contracts to their correct
faddat Apr 11, 2023
3af562b
Merge remote-tracking branch 'origin/reece/v15-initial' into async-icq
faddat Apr 23, 2023
41d65ee
sdk 47 upgrade
faddat Apr 24, 2023
0268fa7
add token factory
faddat Apr 24, 2023
dd92574
add global fee module to juno's repository directly
faddat Apr 24, 2023
c5d4aa7
add modules
faddat Apr 24, 2023
ab9580c
add ibc hooks
faddat Apr 24, 2023
ba4623a
correct the token factory module path
faddat Apr 24, 2023
e2932e2
tidy
faddat Apr 24, 2023
d490dbb
module import versioning
faddat Apr 24, 2023
b6efe81
resolve import of an old juno
faddat Apr 24, 2023
48de4c4
upgrade tests
faddat Apr 24, 2023
c429f1b
fix simapp import path
faddat Apr 24, 2023
3b7701d
add osmoutils and change import paths
faddat Apr 24, 2023
ae0944f
use ibc-go v7 in osmoutils
faddat Apr 24, 2023
8f79106
tidy finally
faddat Apr 24, 2023
37005ad
tidy
faddat Apr 24, 2023
c8bfbe9
don't send needless params to setup
faddat Apr 24, 2023
b9d1cab
fix RegisterTendermintService
faddat Apr 24, 2023
7ad4ec8
nodeservice
faddat Apr 24, 2023
b58641e
use a global for ModuleManager so we can access it
faddat Apr 24, 2023
0eaa951
remove querier
faddat Apr 24, 2023
6068e92
remove randomized parameters
faddat Apr 24, 2023
d4ec850
remove x/mint/simulation/params.go
faddat Apr 24, 2023
e11adf9
use math.Int
faddat Apr 24, 2023
da9ff57
errorsmod
faddat Apr 24, 2023
bbad07f
errorsmod
faddat Apr 24, 2023
4d3d350
feeshare
faddat Apr 24, 2023
229e327
sdkerrors -> errorsmod
faddat Apr 24, 2023
4ed89fa
errors module
faddat Apr 24, 2023
d56bae1
use storetypes
faddat Apr 24, 2023
9b6f36d
remove randomized params for token factory
faddat Apr 24, 2023
269a080
storetypes for keys
faddat Apr 24, 2023
8b935e4
add simulation params for token factory
faddat Apr 24, 2023
d23d590
cleanup of imports
faddat Apr 25, 2023
a920127
pre-merge changes
faddat Apr 27, 2023
d80493c
Fix some test, fix root.go InterceptConfigsPreRunHandler
Reecepbcups Apr 28, 2023
ed18a69
Fix icagenesistypes
Reecepbcups Apr 28, 2023
62d5df5
Fix root.go
Reecepbcups Apr 28, 2023
4a164a6
storetypes, ConsensusParams, test_helpers
Reecepbcups Apr 28, 2023
21f5941
Fix keepers, add ibchost key
Reecepbcups Apr 28, 2023
af39cfd
Fix IBC-Hooks to match IBCv7 spec
Reecepbcups Apr 28, 2023
2f0866e
Fix 99% of tokenfactory module
Reecepbcups Apr 28, 2023
13a5ed4
Fix maccPerms, appModules&Simulation, ibcexported
Reecepbcups Apr 28, 2023
63b6db1
fix sim_test
Reecepbcups Apr 28, 2023
3aa2c87
Fix test: encoding, appkeepers + simulation
Reecepbcups Apr 28, 2023
9e7f3f5
globalfee: rm Route & LegacyQuerierHandler
Reecepbcups Apr 28, 2023
f8e1309
Fix gov spam filter
Reecepbcups Apr 28, 2023
320fa68
fix ibc-hooks wasm keeper + test
Reecepbcups Apr 28, 2023
dbe6b10
Remove Osmo Utils (keeping ibc.go file for ibc-hooks()
Reecepbcups Apr 28, 2023
42170c1
Comment out legacy x/mint querier
Reecepbcups Apr 28, 2023
a07c1e4
abci CommitInfo, wasmkeeper.NewMsgServerImpl
Reecepbcups Apr 28, 2023
593bfe1
Upgrade ictest to v7 (main) - WIP
Reecepbcups Apr 29, 2023
c833917
Fix app.go + test-suite stakingHandler
Reecepbcups Apr 29, 2023
e034a2e
Fix CollectGenTxsCmd (+script), sort keys
Reecepbcups Apr 29, 2023
0a475b1
wasmtypes.WasmConfig
Reecepbcups Apr 29, 2023
c47ccb6
Consensus Module, StakingKeeper pointer, test_node genesis cmds
Reecepbcups Apr 29, 2023
149fd5c
Fix IBC Keeper (ibcexported type)
Reecepbcups Apr 29, 2023
5341011
Add icqtypes to params keeper
Reecepbcups Apr 29, 2023
d55d91a
Staking WithKeyTable for GlobalFee
Reecepbcups Apr 29, 2023
97e1e09
Merge branch 'main' into 47-upgrade
faddat Apr 29, 2023
8ee0735
golangci-lint run ./... --fix
faddat Apr 29, 2023
6fa6429
comply with golangci-lint
faddat Apr 29, 2023
f428ee4
pass the linter
faddat Apr 29, 2023
0c0c7f0
Cleanup old comments, Fix make TM_VERSION build flag
Reecepbcups May 2, 2023
2d3c154
Merge branch 'main' into 47-upgrade
faddat May 5, 2023
cc2988b
Allow gov contracts to be self registered
Reecepbcups May 5, 2023
d0b4503
Merge remote-tracking branch 'origin/main' into 47-upgrade
faddat May 6, 2023
623074d
Squashed commit of the following:
Reecepbcups May 10, 2023
eccf42a
Fix imported tokenfactory minor touchup
Reecepbcups May 10, 2023
66ca9d2
Merge branch 'reece/gov-feeshare' into 47-upgrade
Reecepbcups May 10, 2023
060512a
Adds FeeShare interchain test
Reecepbcups May 9, 2023
d4bf9d6
cleanup old comments
Reecepbcups May 9, 2023
e3e2279
only test simulate on merge of PR
Reecepbcups May 9, 2023
d65da17
Unity contract CI in house (ictest)
Reecepbcups May 10, 2023
e7813b6
Remove old debug code for gov test
Reecepbcups May 10, 2023
64b40e9
lint
Reecepbcups May 10, 2023
e1183eb
modified v15 upgrade handler (ICQ + consensus modules). Normal block …
Reecepbcups May 10, 2023
822f4ff
initial ICTest conversion (v7 main)
Reecepbcups May 10, 2023
4ab7b21
fix version complaints from dep review
Reecepbcups May 10, 2023
41bbab5
Fixes a lot of test (Tokenfactory & some mint/feeshare still broken)
Reecepbcups May 11, 2023
c37f4fb
Fix x/mint MOduleAccount test
Reecepbcups May 11, 2023
ed74b32
Fix some ictest (new genesis) & crisis upgrade store key
Reecepbcups May 11, 2023
14cf293
FIXES ALL TEST OH MY GOSH FINALLY WOW MUCH FUN
Reecepbcups May 11, 2023
62c7e74
linter linter linter linter
Reecepbcups May 11, 2023
d82d468
comments
Reecepbcups May 11, 2023
fe1792a
remove ante gov filter (v47 does in gov mod)
Reecepbcups May 11, 2023
d729914
Add newer gRPC service support
Reecepbcups May 11, 2023
e6836c9
Remove staking subspace, hardcode ujuno for now
Reecepbcups May 11, 2023
64f29cd
remove broadcastest events which are now in baseapp
Reecepbcups May 11, 2023
1c3bac7
Add rough outline for v47 upgrade handler + hide paramsKeeper.Subspace
Reecepbcups May 11, 2023
c5c5faf
lint
Reecepbcups May 11, 2023
7e54dbb
fix ictest gas issues (my fork)
Reecepbcups May 11, 2023
48a209f
Use CreateThisBranchChain for all test (excl IBC)
Reecepbcups May 11, 2023
a15730c
We do wasm integration CI elsewhere now
Reecepbcups May 12, 2023
e0ee77a
Cleanup node, dep bump, reuse initParamsKeeper
Reecepbcups May 12, 2023
cdfaf6f
gomod tidy ictest
Reecepbcups May 12, 2023
10f1282
add IBC + wasm upgrade handler param keys
Reecepbcups May 12, 2023
aa085d6
Use ictest IBC conformance for v47
Reecepbcups May 12, 2023
99cc71a
MsgSudoContract govv1 proposal ictest
Reecepbcups May 12, 2023
bdb8ca2
Remove duplicate arg
Reecepbcups May 12, 2023
64383e6
setPostHandler & configurator
Reecepbcups May 12, 2023
d7570f3
new Cmds: rosetta & AuxToFee
Reecepbcups May 12, 2023
ea26513
mod tidy
Reecepbcups May 12, 2023
fc3b870
If mod files are edited, ICtest
Reecepbcups May 12, 2023
c2465cc
Fix upgrade test (SDK 45 genesis + longer height delta)
Reecepbcups May 13, 2023
cdaf3ff
Download dependencies (#673)
Reecepbcups May 13, 2023
e060d98
merge main
Reecepbcups May 14, 2023
a185c67
Merge branch '47-upgrade' of github.com:CosmosContracts/juno into 47-…
Reecepbcups May 14, 2023
e0f0548
Empty-Commit
Reecepbcups May 14, 2023
f1ead43
workflow tweaks
Reecepbcups May 14, 2023
9bea7be
See if this fixes v47 test
Reecepbcups May 15, 2023
9870e28
Only build docker on merge to main branch
Reecepbcups May 15, 2023
026f50b
Fix ictest to use local image
Reecepbcups May 15, 2023
5fc2290
Use rly instead of hermes
Reecepbcups May 15, 2023
0af3267
go mod tidy
Reecepbcups May 15, 2023
4a9cfb9
Use rly
Reecepbcups May 15, 2023
e05632f
Re-enable v47 GRPC
Reecepbcups May 15, 2023
1fbc827
Remove PFM for debugging
Reecepbcups May 15, 2023
c58c1c5
Remove ibchooks & PFM fully
Reecepbcups May 15, 2023
9eea99c
Force Flush IBC Packets to Ack
Reecepbcups May 16, 2023
6c710f4
Docker with cache
Reecepbcups May 16, 2023
05ac719
Add back IBCHooks
Reecepbcups May 16, 2023
2491a44
Remove buildx cache
Reecepbcups May 16, 2023
250b715
remove buildx context
Reecepbcups May 16, 2023
236ef8c
Add back PFM but use ChannelKeeper instead of IBCFeeKeeper
Reecepbcups May 16, 2023
eff85c7
Merge pull request #676 from CosmosContracts/reece/v47-fixes-test-check
Reecepbcups May 16, 2023
f5e035e
Remove DSStore
Reecepbcups May 17, 2023
4af8731
Move MinCommission ante -> x/staking params
Reecepbcups May 19, 2023
279a6a4
lint
Reecepbcups May 19, 2023
9f5de1b
Removes old TODO comments which were completed
Reecepbcups May 19, 2023
ae76d8f
go.mod version bumps, remove simapp usage
Reecepbcups May 19, 2023
7b3f076
Remove legacy forcePrune cmd
Reecepbcups May 19, 2023
9cea11c
ictest: ModifyGenesis for Upgrade
Reecepbcups May 19, 2023
7a1ae6f
pin protos, correct buf.yaml and remove superfluous dockerfile
faddat May 19, 2023
3f69251
Use upstream test features
Reecepbcups May 20, 2023
39d2867
Merge pull request #683 from CosmosContracts/reece/47-upstream-test
Reecepbcups May 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
---
name: build

on:
push:
paths:
- '**.go'
- 'go.sum'
pull_request:
pull_request:
types: [review_requested, closed, auto_merge_enabled]
paths:
- '**.go'
- 'go.sum'
name: build

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/build_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ name: Build Docker Image on PR

on:
push:
paths:
- "**docker**"
- "**.sh"
- "**.bash"
branches:
- master
- main

env:
REGISTRY: ghcr.io
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ on:

permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
# pull-requests: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
38 changes: 0 additions & 38 deletions .github/workflows/integration.yml

This file was deleted.

19 changes: 8 additions & 11 deletions .github/workflows/interchaintest-E2E.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: ictest E2E
name: ictest E2E

on:
push:
Expand All @@ -10,7 +9,8 @@ on:
paths:
- '**.yml'
- '**.go'
- 'go.sum'
- '**.mod'
- '**.sum'

env:
REGISTRY: ghcr.io
Expand All @@ -20,9 +20,6 @@ env:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true




jobs:
build-and-push-image:
Expand All @@ -39,11 +36,17 @@ jobs:

# We setup go & cache dependencies here. This way each child job
# does not have to reinstall all dependencies individually.
# Should ID be unique to this job only?
- name: Setup Golang with cache
uses: magnetikonline/action-golang-cache@v4
with:
go-version: ${{ env.GO_VERSION }}
id: go

- name: Download dependencies
run: |
go mod download
cd interchaintest && go mod download

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
Expand Down Expand Up @@ -81,19 +84,13 @@ jobs:

# TODO: Add reusable job template here, just changing the `make` command for each

# make juno:branchname here for all needs.build-and-push-image.outputs.branchTag
# then upload to github. Then download for each as a cache. This way its only built once

test-juno-basic:
runs-on: ubuntu-latest
needs: build-and-push-image
steps:
- name: checkout chain
uses: actions/checkout@v2

- name: checkout chain
uses: actions/checkout@v2

- name: Setup Golang with cache
uses: magnetikonline/action-golang-cache@v4
with:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ tmp-swagger-gen

heighliner*

x/**/data/wasm/*

# emacs editor config
\#*\#
.\#*
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ linters-settings:
gosec:
excludes:
- G404

issues:
max-issues-per-linter: 0
56 changes: 22 additions & 34 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ endif
PACKAGES_SIMTEST=$(shell go list ./... | grep '/simulation')
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/tendermint/tendermint | sed 's:.* ::') # grab everything after the space in "github.com/tendermint/tendermint v0.34.7"
BFT_VERSION := $(shell go list -m github.com/cometbft/cometbft | sed 's:.* ::') # grab everything after the space in "github.com/cometbft/cometbft v0.34.7"
DOCKER := $(shell which docker)
DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf:1.0.0-rc8
BUILDDIR ?= $(CURDIR)/build
Expand Down Expand Up @@ -68,7 +68,7 @@ ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=juno \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)" \
-X github.com/tendermint/tendermint/version.TMCoreSemVer=$(TM_VERSION)
-X github.com/cometbft/cometbft/version.TMCoreSemVer=$(BFT_VERSION)

ifeq (cleveldb,$(findstring cleveldb,$(JUNO_BUILD_OPTIONS)))
ldflags += -X github.com/cosmos/cosmos-sdk/types.DBBackend=cleveldb
Expand Down Expand Up @@ -122,37 +122,37 @@ benchmark:
###############################################################################

# Executes basic chain tests via interchaintest
ictest-basic:
ictest-basic: rm-testcache
cd interchaintest && go test -race -v -run TestBasicJunoStart .

ictest-tokenfactory:
ictest-tokenfactory: rm-testcache
cd interchaintest && go test -race -v -run TestJunoTokenFactory .

ictest-feeshare:
ictest-feeshare: rm-testcache
cd interchaintest && go test -race -v -run TestJunoFeeShare .

# Executes a basic chain upgrade test via interchaintest
ictest-upgrade:
ictest-upgrade: rm-testcache
cd interchaintest && go test -race -v -run TestBasicJunoUpgrade .

# Executes a basic chain upgrade locally via interchaintest after compiling a local image as juno:local
ictest-upgrade-local: local-image ictest-upgrade

# Executes IBC tests via interchaintest
ictest-ibc:
ictest-ibc: rm-testcache
cd interchaintest && go test -race -v -run TestJunoGaiaIBCTransfer .

# Unity contract CI
ictest-unity-deploy:
ictest-unity-deploy: rm-testcache
cd interchaintest && go test -race -v -run TestJunoUnityContractDeploy .

ictest-unity-gov:
ictest-unity-gov: rm-testcache
cd interchaintest && go test -race -v -run TestJunoUnityContractGovSubmit .

# Executes all tests via interchaintest after compling a local image as juno:local
ictest-all: local-image ictest-basic ictest-upgrade ictest-ibc
rm-testcache:
go clean -testcache

.PHONY: test-mutation ictest-basic ictest-upgrade ictest-ibc ictest-all
.PHONY: test-mutation ictest-basic ictest-upgrade ictest-ibc ictest-unity-deploy ictest-unity-gov

###############################################################################
### heighliner ###
Expand All @@ -172,43 +172,31 @@ endif
.PHONY: get-heighliner local-image

###############################################################################
### Proto ###
### Protobuf ###
###############################################################################

protoVer=v0.7
protoImageName=tendermintdev/sdk-proto-gen:$(protoVer)
containerProtoGen=juno-proto-gen-$(protoVer)
containerProtoGenAny=juno-proto-gen-any-$(protoVer)
containerProtoGenSwagger=juno-proto-gen-swagger-$(protoVer)
containerProtoFmt=juno-proto-fmt-$(protoVer)
protoVer=0.11.6
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)

proto-all: proto-format proto-lint proto-gen

proto-gen:
@echo "Generating Protobuf files"
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGen}$$"; then docker start -a $(containerProtoGen); else docker run --name $(containerProtoGen) -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) \
sh ./scripts/protocgen.sh; fi

# This generates the SDK's custom wrapper for google.protobuf.Any. It should only be run manually when needed
proto-gen-any:
@echo "Generating Protobuf Any"
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGenAny}$$"; then docker start -a $(containerProtoGenAny); else docker run --name $(containerProtoGenAny) -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) \
sh ./scripts/protocgen-any.sh; fi
@$(protoImage) sh ./scripts/protocgen.sh

proto-swagger-gen:
@echo "Generating Protobuf Swagger"
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGenSwagger}$$"; then docker start -a $(containerProtoGenSwagger); else docker run --name $(containerProtoGenSwagger) -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) \
sh ./scripts/protoc-swagger-gen.sh; fi
@$(protoImage) sh ./scripts/protoc-swagger-gen.sh
$(MAKE) update-swagger-docs

proto-format:
@echo "Formatting Protobuf files"
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoFmt}$$"; then docker start -a $(containerProtoFmt); else docker run --name $(containerProtoFmt) -v $(CURDIR):/workspace --workdir /workspace tendermintdev/docker-build-proto \
find ./ -not -path "./third_party/*" -name "*.proto" -exec clang-format -i {} \; ; fi
@$(protoImage) find ./ -name "*.proto" -exec clang-format -i {} \;

proto-lint:
@$(DOCKER_BUF) lint --error-format=json
@$(protoImage) buf lint --error-format=json

proto-check-breaking:
@$(DOCKER_BUF) breaking --against $(HTTPS_GIT)#branch=main
@$(protoImage) buf breaking --against $(HTTPS_GIT)#branch=main

.PHONY: proto-all proto-gen proto-gen-any proto-swagger-gen proto-format proto-lint proto-check-breaking proto-update-deps docs
29 changes: 12 additions & 17 deletions app/ante.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package app

import (
errorsmod "cosmossdk.io/errors"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
ibcante "github.com/cosmos/ibc-go/v4/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper"
ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper"

paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"

Expand All @@ -15,19 +16,16 @@ import (

wasmTypes "github.com/CosmWasm/wasmd/x/wasm/types"
decorators "github.com/CosmosContracts/juno/v15/app/decorators"
storetypes "github.com/cosmos/cosmos-sdk/store/types"

feeshareante "github.com/CosmosContracts/juno/v15/x/feeshare/ante"
feesharekeeper "github.com/CosmosContracts/juno/v15/x/feeshare/keeper"

gaiafeeante "github.com/cosmos/gaia/v9/x/globalfee/ante"
gaiafeeante "github.com/CosmosContracts/juno/v15/x/globalfee/ante"
)

const maxBypassMinFeeMsgGasUsage = 1_000_000

func updateAppSimulationFlag(flag bool) {
decorators.DefaultIsAppSimulation = flag
}

// HandlerOptions extends the SDK's AnteHandler options by requiring the IBC
// channel keeper and a BankKeeper with an added method for fee sharing.
type HandlerOptions struct {
Expand All @@ -37,7 +35,7 @@ type HandlerOptions struct {
IBCKeeper *ibckeeper.Keeper
FeeShareKeeper feesharekeeper.Keeper
BankKeeperFork feeshareante.BankKeeper
TxCounterStoreKey sdk.StoreKey
TxCounterStoreKey storetypes.StoreKey
WasmConfig wasmTypes.WasmConfig
Cdc codec.BinaryCodec
StakingSubspace paramtypes.Subspace
Expand All @@ -51,15 +49,15 @@ type HandlerOptions struct {
// signer.
func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
if options.AccountKeeper == nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "account keeper is required for ante builder")
return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "account keeper is required for ante builder")
}

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

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 @@ -69,27 +67,24 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {

anteDecorators := []sdk.AnteDecorator{
ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first
decorators.NewMinCommissionDecorator(options.Cdc),
wasmkeeper.NewLimitSimulationGasDecorator(options.WasmConfig.SimulationGasLimit),
wasmkeeper.NewCountTXDecorator(options.TxCounterStoreKey),
ante.NewRejectExtensionOptionsDecorator(),
ante.NewExtensionOptionsDecorator(options.ExtensionOptionChecker),
decorators.MsgFilterDecorator{},
decorators.NewGovPreventSpamDecorator(options.Cdc, options.GovKeeper),
ante.NewMempoolFeeDecorator(),
ante.NewValidateBasicDecorator(),
ante.NewTxTimeoutHeightDecorator(),
ante.NewValidateMemoDecorator(options.AccountKeeper),
ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper),
gaiafeeante.NewFeeDecorator(options.BypassMinFeeMsgTypes, options.GlobalFeeSubspace, options.StakingSubspace, maxBypassMinFeeMsgGasUsage),
ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper),
ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, options.TxFeeChecker),
feeshareante.NewFeeSharePayoutDecorator(options.BankKeeperFork, options.FeeShareKeeper),
// SetPubKeyDecorator must be called before all signature verification decorators
ante.NewSetPubKeyDecorator(options.AccountKeeper),
ante.NewValidateSigCountDecorator(options.AccountKeeper),
ante.NewSigGasConsumeDecorator(options.AccountKeeper, sigGasConsumer),
ante.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler),
ante.NewIncrementSequenceDecorator(options.AccountKeeper),
ibcante.NewAnteDecorator(options.IBCKeeper),
ibcante.NewRedundantRelayDecorator(options.IBCKeeper),
}

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