Skip to content

Commit

Permalink
feat: add the proposal based voting
Browse files Browse the repository at this point in the history
  • Loading branch information
atheeshp committed Jul 26, 2024
1 parent 0fc59af commit 7a4da4c
Show file tree
Hide file tree
Showing 10 changed files with 328 additions and 105 deletions.
167 changes: 151 additions & 16 deletions api/cosmos/authz/v1beta1/authz.pulsar.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions proto/cosmos/authz/v1beta1/authz.proto
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,5 @@ message AppAuthzRules {
repeated string max_amount = 2;
repeated string allowed_stake_validators = 3;
repeated string allowed_max_stake_amount = 4;
repeated string allowed_proposal_types = 5;
}
2 changes: 1 addition & 1 deletion simapp/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
ante.NewValidateMemoDecorator(options.AccountKeeper),
ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper),
ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, options.TxFeeChecker),
ante.NewAuthzDecorator(options.AuthzKeeper, options.AccountKeeper),
ante.NewAuthzDecorator(options.AuthzKeeper, options.AccountKeeper, options.GovKeeper),
ante.NewSetPubKeyDecorator(options.AccountKeeper), // SetPubKeyDecorator must be called before all signature verification decorators
ante.NewValidateSigCountDecorator(options.AccountKeeper),
ante.NewSigGasConsumeDecorator(options.AccountKeeper, options.SigGasConsumer),
Expand Down
2 changes: 2 additions & 0 deletions x/auth/ante/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type HandlerOptions struct {
SignModeHandler *txsigning.HandlerMap
SigGasConsumer func(meter storetypes.GasMeter, sig signing.SignatureV2, params types.Params) error
TxFeeChecker TxFeeChecker
GovKeeper GovKeeper
}

// NewAnteHandler returns an AnteHandler that checks and increments sequence
Expand All @@ -47,6 +48,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
NewValidateMemoDecorator(options.AccountKeeper),
NewConsumeGasForTxSizeDecorator(options.AccountKeeper),
NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, options.TxFeeChecker),
NewAuthzDecorator(options.AuthzKeeper, options.AccountKeeper, options.GovKeeper),
NewSetPubKeyDecorator(options.AccountKeeper), // SetPubKeyDecorator must be called before all signature verification decorators
NewValidateSigCountDecorator(options.AccountKeeper),
NewSigGasConsumeDecorator(options.AccountKeeper, options.SigGasConsumer),
Expand Down
Loading

0 comments on commit 7a4da4c

Please sign in to comment.