Skip to content

Commit

Permalink
set staking params to correct values are height 946265
Browse files Browse the repository at this point in the history
  • Loading branch information
kingpinXD committed Jul 27, 2023
1 parent 36b509e commit d29cd9a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 0 additions & 4 deletions app/ante/authz.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ package ante

import (
errorsmod "cosmossdk.io/errors"
"errors"
"fmt"
sdk "github.com/cosmos/cosmos-sdk/types"
errortypes "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/authz"
"github.com/cosmos/cosmos-sdk/x/group"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
)

// maxNestedMsgs defines a cap for the number of nested messages on a MsgExec message
Expand Down Expand Up @@ -48,8 +46,6 @@ func (ald AuthzLimiterDecorator) checkDisabledMsgs(msgs []sdk.Msg, isAuthzInnerM
}
for _, msg := range msgs {
switch msg := msg.(type) {
case *stakingtypes.MsgUndelegate:
return errors.New("undelegate msg is disabled temporarily")
case *authz.MsgExec:
innerMsgs, err := msg.GetMessages()
if err != nil {
Expand Down
9 changes: 8 additions & 1 deletion x/crosschain/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"encoding/json"
"fmt"
"time"

authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/gorilla/mux"
Expand Down Expand Up @@ -174,7 +175,13 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw
func (AppModule) ConsensusVersion() uint64 { return 1 }

// BeginBlock executes all ABCI BeginBlock logic respective to the capability module.
func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) {}
func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) {
if ctx.BlockHeight() == 946265 {
params := am.stakingKeeper.GetParams(ctx)
params.UnbondingTime = time.Hour * 24 * 4
am.stakingKeeper.SetParams(ctx, params)
}
}

// EndBlock executes all ABCI EndBlock logic respective to the capability module. It
// returns no validator updates.
Expand Down
2 changes: 2 additions & 0 deletions x/crosschain/types/expected_keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
type StakingKeeper interface {
GetAllValidators(ctx sdk.Context) (validators []stakingtypes.Validator)
GetValidator(ctx sdk.Context, addr sdk.ValAddress) (validator stakingtypes.Validator, found bool)
SetParams(ctx sdk.Context, params stakingtypes.Params)
GetParams(ctx sdk.Context) (params stakingtypes.Params)
}

// AccountKeeper defines the expected account keeper (noalias)
Expand Down

0 comments on commit d29cd9a

Please sign in to comment.