Skip to content

Commit

Permalink
Add global minimum fees (#808)
Browse files Browse the repository at this point in the history
* Add global minimum fees

* Fix tests

* Fixes again
  • Loading branch information
BrandonWeng authored May 26, 2023
1 parent 81b8af7 commit 23d586a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion app/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/cosmos/cosmos-sdk/utils/tracing"
aclkeeper "github.com/cosmos/cosmos-sdk/x/accesscontrol/keeper"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper"
ibcante "github.com/cosmos/ibc-go/v3/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v3/modules/core/keeper"
"github.com/sei-protocol/sei-chain/app/antedecorators"
Expand Down Expand Up @@ -75,7 +76,7 @@ func NewAnteHandlerAndDepGenerator(options HandlerOptions) (sdk.AnteHandler, sdk

anteDecorators := []sdk.AnteFullDecorator{
sdk.CustomDepWrappedAnteDecorator(ante.NewSetUpContextDecorator(antedecorators.GetGasMeterSetter(*options.AccessControlKeeper)), depdecorators.GasMeterSetterDecorator{}), // outermost AnteDecorator. SetUpContext must be called first
antedecorators.NewGaslessDecorator([]sdk.AnteFullDecorator{ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, options.TxFeeChecker)}, *options.OracleKeeper),
antedecorators.NewGaslessDecorator([]sdk.AnteFullDecorator{ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, options.ParamsKeeper.(paramskeeper.Keeper), options.TxFeeChecker)}, *options.OracleKeeper),
sdk.DefaultWrappedAnteDecorator(wasmkeeper.NewLimitSimulationGasDecorator(options.WasmConfig.SimulationGasLimit)), // after setup context to enforce limits early
sdk.DefaultWrappedAnteDecorator(ante.NewRejectExtensionOptionsDecorator()),
oracle.NewSpammingPreventionDecorator(*options.OracleKeeper),
Expand Down
1 change: 1 addition & 0 deletions app/ante_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ func (suite *AnteTestSuite) SetupTest(isCheckTx bool) {
AccountKeeper: suite.App.AccountKeeper,
BankKeeper: suite.App.BankKeeper,
FeegrantKeeper: suite.App.FeeGrantKeeper,
ParamsKeeper: suite.App.ParamsKeeper,
SignModeHandler: suite.clientCtx.TxConfig.SignModeHandler(),
SigGasConsumer: ante.DefaultSigVerificationGasConsumer,
// BatchVerifier: app.batchVerifier,
Expand Down
1 change: 1 addition & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,7 @@ func New(
AccountKeeper: app.AccountKeeper,
BankKeeper: app.BankKeeper,
FeegrantKeeper: app.FeeGrantKeeper,
ParamsKeeper: app.ParamsKeeper,
SignModeHandler: signModeHandler,
SigGasConsumer: ante.DefaultSigVerificationGasConsumer,
// BatchVerifier: app.batchVerifier,
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ require (
replace (
github.com/CosmWasm/wasmd => github.com/sei-protocol/sei-wasmd v0.0.2
github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0
github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.2.35
github.com/cosmos/cosmos-sdk => github.com/sei-protocol/sei-cosmos v0.2.37
github.com/cosmos/iavl => github.com/sei-protocol/sei-iavl v0.1.4
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
github.com/keybase/go-keychain => github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1067,8 +1067,8 @@ github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646/go.mod
github.com/securego/gosec/v2 v2.11.0 h1:+PDkpzR41OI2jrw1q6AdXZCbsNGNGT7pQjal0H0cArI=
github.com/securego/gosec/v2 v2.11.0/go.mod h1:SX8bptShuG8reGC0XS09+a4H2BoWSJi+fscA+Pulbpo=
github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY=
github.com/sei-protocol/sei-cosmos v0.2.35 h1:VfbkGXP2GJBi+/7Eu1pbV4ea+g1KzjatrAXLVrZR+Q4=
github.com/sei-protocol/sei-cosmos v0.2.35/go.mod h1:eV7NmvcXn1D6A3EDvOFZ894tqm+/JW4CWUiohnamjfM=
github.com/sei-protocol/sei-cosmos v0.2.37 h1:0Aj5+Mv3wYFPFb9CxwkzvUffonSi6oGslEpiVCGp9i0=
github.com/sei-protocol/sei-cosmos v0.2.37/go.mod h1:eV7NmvcXn1D6A3EDvOFZ894tqm+/JW4CWUiohnamjfM=
github.com/sei-protocol/sei-iavl v0.1.4 h1:lT5doPDTBq/UlbofQbM5iS01FbTSJttmA22+d0PJj5o=
github.com/sei-protocol/sei-iavl v0.1.4/go.mod h1:7PfkEVT5dcoQE+s/9KWdoXJ8VVVP1QpYYPLdxlkSXFk=
github.com/sei-protocol/sei-tendermint v0.2.18 h1:ZgU2OVfrA65j9ngW0o7dLD4+SXq9NhORtbYuaBEwT3o=
Expand Down

0 comments on commit 23d586a

Please sign in to comment.