-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* distribution alternative allocation * update distribution to work off of bonded validators not votes * copy of consumer app * added ccvstaking, ccvdistribution, ccvgov and ccvminting * add cmd interchain-security-cdd * distribution tokens should be coming from ConsumerRedistributeName not feeCollector * beginning of tests * Rebase and fix build errors * Democracy chain integration tests, part 1 * Democracy chain integration tests, part 2 * Clean up and e2e test for democracy distribution * gov-distribution module - cr fix * fix small merge issue Co-authored-by: rigelrozanski <[email protected]> Co-authored-by: billy rennekamp <[email protected]> Co-authored-by: dusan-ethernal <[email protected]> Co-authored-by: stana-ethernal <[email protected]> Co-authored-by: Jehan <[email protected]> Co-authored-by: Jehan Tremback <[email protected]>
- Loading branch information
1 parent
12ac66c
commit 4866f12
Showing
18 changed files
with
2,500 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package app | ||
|
||
import ( | ||
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/v3/modules/core/ante" | ||
ibckeeper "github.com/cosmos/ibc-go/v3/modules/core/keeper" | ||
consumerante "github.com/cosmos/interchain-security/app/consumer/ante" | ||
ibcconsumerkeeper "github.com/cosmos/interchain-security/x/ccv/consumer/keeper" | ||
) | ||
|
||
// HandlerOptions extend the SDK's AnteHandler options by requiring the IBC | ||
// channel keeper. | ||
type HandlerOptions struct { | ||
ante.HandlerOptions | ||
|
||
IBCKeeper *ibckeeper.Keeper | ||
ConsumerKeeper ibcconsumerkeeper.Keeper | ||
} | ||
|
||
func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { | ||
if options.AccountKeeper == nil { | ||
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "account keeper is required for AnteHandler") | ||
} | ||
if options.BankKeeper == nil { | ||
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "bank keeper is required for AnteHandler") | ||
} | ||
if options.SignModeHandler == nil { | ||
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder") | ||
} | ||
|
||
var sigGasConsumer = options.SigGasConsumer | ||
if sigGasConsumer == nil { | ||
sigGasConsumer = ante.DefaultSigVerificationGasConsumer | ||
} | ||
|
||
anteDecorators := []sdk.AnteDecorator{ | ||
ante.NewSetUpContextDecorator(), | ||
ante.NewRejectExtensionOptionsDecorator(), | ||
consumerante.NewMsgFilterDecorator(options.ConsumerKeeper), | ||
consumerante.NewDisabledModulesDecorator("/cosmos.evidence", "/cosmos.slashing"), | ||
ante.NewMempoolFeeDecorator(), | ||
ante.NewValidateBasicDecorator(), | ||
ante.NewTxTimeoutHeightDecorator(), | ||
ante.NewValidateMemoDecorator(options.AccountKeeper), | ||
ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper), | ||
ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper), | ||
// 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), | ||
} | ||
|
||
return sdk.ChainAnteDecorators(anteDecorators...), nil | ||
} |
Oops, something went wrong.