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

Add Fee-Abstraction to Hub #2702

Closed
wants to merge 15 commits into from
Prev Previous commit
Next Next commit
update feeabs
  • Loading branch information
GNaD13 committed Sep 8, 2023
commit f1bdb22321d4953b5c8006bda56f9bbaa444ae31
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require (
github.com/gravity-devs/liquidity v1.6.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/ory/dockertest/v3 v3.10.0
github.com/osmosis-labs/fee-abstraction/v4 v4.0.0-20230827145831-e85e34285517
github.com/osmosis-labs/fee-abstraction/v4 v4.0.0-20230908133936-72dc013241cf
github.com/rakyll/statik v0.1.7
github.com/spf13/cast v1.5.1
github.com/spf13/cobra v1.7.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,8 @@ github.com/ory/dockertest/v3 v3.10.0 h1:4K3z2VMe8Woe++invjaTB7VRyQXQy5UY+loujO4a
github.com/ory/dockertest/v3 v3.10.0/go.mod h1:nr57ZbRWMqfsdGdFNLHz5jjNdDb7VVFnzAeW1n5N1Lg=
github.com/osmosis-labs/fee-abstraction/v4 v4.0.0-20230827145831-e85e34285517 h1:iEZWoshdx6GPUtLjRtnhxmqCm8/DEYKeNWoIhVh5Gz4=
github.com/osmosis-labs/fee-abstraction/v4 v4.0.0-20230827145831-e85e34285517/go.mod h1:tib4FfJ3A59d2MAbhZU2k2PWntwv5C1CsHkWu1TrkUY=
github.com/osmosis-labs/fee-abstraction/v4 v4.0.0-20230908133936-72dc013241cf h1:LG3T4UTVFY3tq/4YQRAfXaNpxHqIjaQyMUKu77p46Xc=
github.com/osmosis-labs/fee-abstraction/v4 v4.0.0-20230908133936-72dc013241cf/go.mod h1:tib4FfJ3A59d2MAbhZU2k2PWntwv5C1CsHkWu1TrkUY=
github.com/otiai10/copy v1.6.0 h1:IinKAryFFuPONZ7cm6T6E2QX/vcJwSnlaA5lfoaXIiQ=
github.com/oxyno-zeta/gomock-extra-matcher v1.1.0 h1:Yyk5ov0ZPKBXtVEeIWtc4J2XVrHuNoIK+0F2BUJgtsc=
github.com/oxyno-zeta/gomock-extra-matcher v1.1.0/go.mod h1:UMGTHYEmJ1dRq8LDZ7VTAYO4nqM3GD1UGC3RJEUxEz0=
Expand Down
6 changes: 3 additions & 3 deletions x/globalfee/ante/fee.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ func (mfd FeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, ne

// If bypass msg, add value to context so feeabs ante can check it
if allowedToBypassMinFee {
return next(ctx.WithValue(feeabstypes.ByPassMsgKey{}, true), tx, simulate)
return next(ctx.WithValue(feeabstypes.ByPassMsgKey{}, true).WithValue(feeabstypes.GlobalFeeKey{}, true), tx, simulate)
}

if allBypassMsgs && !doesNotExceedMaxGasUsage {
return next(ctx.WithMinGasPrices(minGasPrices).WithValue(feeabstypes.ByPassExceedMaxGasUsageKey{}, true), tx, simulate)
return next(ctx.WithMinGasPrices(minGasPrices).WithValue(feeabstypes.ByPassExceedMaxGasUsageKey{}, true).WithValue(feeabstypes.GlobalFeeKey{}, true), tx, simulate)
}

return next(ctx.WithMinGasPrices(minGasPrices), tx, simulate)
return next(ctx.WithMinGasPrices(minGasPrices).WithValue(feeabstypes.GlobalFeeKey{}, true), tx, simulate)
}

// GetTxGasPrices returns the min-gas-prices for the given FeeTx.
Expand Down