Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/module/feeburn' into astra
Browse files Browse the repository at this point in the history
# Conflicts:
#	app/app.go
#	x/mint/keeper/keeper_test.go
#	x/mint/keeper/total_minted_provision_test.go
#	x/mint/types/expected_keepers.go
#	x/mint/types/query.pb.gw.go
  • Loading branch information
hoanguyenkh committed Dec 28, 2022
2 parents 564bf70 + 50c50f3 commit e9dea88
Show file tree
Hide file tree
Showing 58 changed files with 3,858 additions and 816 deletions.
14 changes: 12 additions & 2 deletions app/ante/handler_options.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ante

import (
feeBurnKeeper "github.com/AstraProtocol/astra/v2/x/feeburn/keeper"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
Expand All @@ -14,6 +15,8 @@ import (
ethante "github.com/evmos/ethermint/app/ante"
evmtypes "github.com/evmos/ethermint/x/evm/types"

feeburnante "github.com/AstraProtocol/astra/v2/x/feeburn/ante"
feeburntypes "github.com/AstraProtocol/astra/v2/x/feeburn/types"
vestingtypes "github.com/evmos/evmos/v6/x/vesting/types"
)

Expand All @@ -22,11 +25,13 @@ import (
type HandlerOptions struct {
AccountKeeper evmtypes.AccountKeeper
BankKeeper evmtypes.BankKeeper
BankKeeperFork feeburntypes.BankKeeper
IBCKeeper *ibckeeper.Keeper
FeeMarketKeeper evmtypes.FeeMarketKeeper
StakingKeeper vestingtypes.StakingKeeper
EvmKeeper ethante.EVMKeeper
FeegrantKeeper ante.FeegrantKeeper
FeeBurnKeeper feeBurnKeeper.Keeper
SignModeHandler authsigning.SignModeHandler
SigGasConsumer func(meter sdk.GasMeter, sig signing.SignatureV2, params authtypes.Params) error
Cdc codec.BinaryCodec
Expand Down Expand Up @@ -59,8 +64,9 @@ func (options HandlerOptions) Validate() error {
// newCosmosAnteHandler creates the default ante handler for Ethereum transactions
func newEthAnteHandler(options HandlerOptions) sdk.AnteHandler {
return sdk.ChainAnteDecorators(
ethante.NewEthSetUpContextDecorator(options.EvmKeeper), // outermost AnteDecorator. SetUpContext must be called first
ethante.NewEthMempoolFeeDecorator(options.EvmKeeper), // Check eth effective gas price against minimal-gas-prices
ethante.NewEthSetUpContextDecorator(options.EvmKeeper), // outermost AnteDecorator. SetUpContext must be called first
ethante.NewEthMempoolFeeDecorator(options.EvmKeeper), // Check eth effective gas price against minimal-gas-prices
ethante.NewEthMinGasPriceDecorator(options.FeeMarketKeeper, options.EvmKeeper), // Check eth effective gas price against the global MinGasPrice
ethante.NewEthValidateBasicDecorator(options.EvmKeeper),
ethante.NewEthSigVerificationDecorator(options.EvmKeeper),
ethante.NewEthAccountVerificationDecorator(options.AccountKeeper, options.EvmKeeper),
Expand All @@ -80,11 +86,13 @@ func newCosmosAnteHandler(options HandlerOptions) sdk.AnteHandler {
ante.NewSetUpContextDecorator(),
ante.NewRejectExtensionOptionsDecorator(),
ante.NewMempoolFeeDecorator(),
ethante.NewMinGasPriceDecorator(options.FeeMarketKeeper, options.EvmKeeper),
ante.NewValidateBasicDecorator(),
ante.NewTxTimeoutHeightDecorator(),
ante.NewValidateMemoDecorator(options.AccountKeeper),
ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper),
ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper),
feeburnante.NewFeeBurnDecorator(options.BankKeeperFork, options.FeeBurnKeeper),
NewVestingDelegationDecorator(options.AccountKeeper, options.StakingKeeper, options.Cdc),
NewValidatorCommissionDecorator(options.Cdc),
// SetPubKeyDecorator must be called before all signature verification decorators
Expand All @@ -105,10 +113,12 @@ func newCosmosAnteHandlerEip712(options HandlerOptions) sdk.AnteHandler {
ante.NewSetUpContextDecorator(),
ante.NewMempoolFeeDecorator(),
ante.NewValidateBasicDecorator(),
ethante.NewMinGasPriceDecorator(options.FeeMarketKeeper, options.EvmKeeper),
ante.NewTxTimeoutHeightDecorator(),
ante.NewValidateMemoDecorator(options.AccountKeeper),
ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper),
ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper),
feeburnante.NewFeeBurnDecorator(options.BankKeeperFork, options.FeeBurnKeeper),
NewVestingDelegationDecorator(options.AccountKeeper, options.StakingKeeper, options.Cdc),
NewValidatorCommissionDecorator(options.Cdc),
// SetPubKeyDecorator must be called before all signature verification decorators
Expand Down
8 changes: 5 additions & 3 deletions client/docs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
}
},
{
"url": "./tmp-swagger-gen/astra/inflation/v1/query.swagger.json",
"url": "./tmp-swagger-gen/astra/feeburn/v1/query.swagger.json",
"operationIds": {
"rename": {
"Params": "InflationParams",
"TotalSupply": "InflationTotalSupply"
"Params": "FeeBurnParams"
}
}
},
Expand Down Expand Up @@ -82,6 +81,9 @@
{
"url": "./tmp-swagger-gen/cosmos/authz/v1beta1/query.swagger.json"
},
{
"url": "./tmp-swagger-gen/cosmos/mint/v1beta1/query.swagger.json"
},
{
"url": "./tmp-swagger-gen/cosmos/bank/v1beta1/query.swagger.json",
"operationIds": {
Expand Down
3 changes: 1 addition & 2 deletions client/docs/statik/statik.go

Large diffs are not rendered by default.

Loading

0 comments on commit e9dea88

Please sign in to comment.