Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions x/coredaos/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (ms MsgServer) UpdateParams(goCtx context.Context, msg *types.MsgUpdatePara
}
if delegatorBonded.GT(math.ZeroInt()) ||
delegatorUnbonded.GT(math.ZeroInt()) {
return nil, types.ErrCannotStake.Wrapf("cannot update params while Steering DAO have bonded or unbonding tokens")
return nil, types.ErrCannotStake.Wrapf("cannot update params while Steering DAO has bonded or unbonding tokens")
}
}
if params.OversightDaoAddress != "" {
Expand All @@ -62,7 +62,7 @@ func (ms MsgServer) UpdateParams(goCtx context.Context, msg *types.MsgUpdatePara
}
if delegatorBonded.GT(math.ZeroInt()) ||
delegatorUnbonded.GT(math.ZeroInt()) {
return nil, types.ErrCannotStake.Wrapf("cannot update params while Oversight DAO have bonded or unbonding tokens")
return nil, types.ErrCannotStake.Wrapf("cannot update params while Oversight DAO has bonded or unbonding tokens")
}
}
if err := ms.k.Params.Set(ctx, params); err != nil {
Expand Down
8 changes: 4 additions & 4 deletions x/coredaos/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func TestMsgServerUpdateParams(t *testing.T) {
VotingPeriodExtensionDuration: &timeDuration,
},
},
expectedErr: "cannot update params while Steering DAO have bonded or unbonding tokens: core DAOs cannot stake",
expectedErr: "cannot update params while Steering DAO has bonded or unbonding tokens: core DAOs cannot stake",
setupMocks: func(ctx sdk.Context, m *testutil.Mocks) {
m.StakingKeeper.EXPECT().GetDelegatorBonded(ctx, sdk.MustAccAddressFromBech32(bondedAcc)).Return(math.NewInt(10), nil)
m.StakingKeeper.EXPECT().GetDelegatorUnbonding(ctx, sdk.MustAccAddressFromBech32(bondedAcc)).Return(math.NewInt(0), nil)
Expand All @@ -90,7 +90,7 @@ func TestMsgServerUpdateParams(t *testing.T) {
VotingPeriodExtensionDuration: &timeDuration,
},
},
expectedErr: "cannot update params while Oversight DAO have bonded or unbonding tokens: core DAOs cannot stake",
expectedErr: "cannot update params while Oversight DAO has bonded or unbonding tokens: core DAOs cannot stake",
setupMocks: func(ctx sdk.Context, m *testutil.Mocks) {
m.StakingKeeper.EXPECT().GetDelegatorBonded(ctx, sdk.MustAccAddressFromBech32(bondedAcc)).Return(math.NewInt(10), nil)
m.StakingKeeper.EXPECT().GetDelegatorUnbonding(ctx, sdk.MustAccAddressFromBech32(bondedAcc)).Return(math.NewInt(0), nil)
Expand Down Expand Up @@ -129,7 +129,7 @@ func TestMsgServerUpdateParams(t *testing.T) {
VotingPeriodExtensionDuration: &timeDuration,
},
},
expectedErr: "cannot update params while Steering DAO have bonded or unbonding tokens: core DAOs cannot stake",
expectedErr: "cannot update params while Steering DAO has bonded or unbonding tokens: core DAOs cannot stake",
setupMocks: func(ctx sdk.Context, m *testutil.Mocks) {
// Address is in unbonding
m.StakingKeeper.EXPECT().GetDelegatorBonded(ctx, sdk.MustAccAddressFromBech32(unbondingAcc)).Return(math.NewInt(0), nil)
Expand All @@ -145,7 +145,7 @@ func TestMsgServerUpdateParams(t *testing.T) {
VotingPeriodExtensionDuration: &timeDuration,
},
},
expectedErr: "cannot update params while Oversight DAO have bonded or unbonding tokens: core DAOs cannot stake",
expectedErr: "cannot update params while Oversight DAO has bonded or unbonding tokens: core DAOs cannot stake",
setupMocks: func(ctx sdk.Context, m *testutil.Mocks) {
// Address is in unbonding
m.StakingKeeper.EXPECT().GetDelegatorBonded(ctx, sdk.MustAccAddressFromBech32(unbondingAcc)).Return(math.NewInt(0), nil)
Expand Down
2 changes: 1 addition & 1 deletion x/gov/types/v1/governor.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func (d GovernorDescription) UpdateDescription(d2 GovernorDescription) (Governor
).EnsureLength()
}

// EnsureLength ensures the length of a vovernor's description.
// EnsureLength ensures the length of a governor's description.
func (d GovernorDescription) EnsureLength() (GovernorDescription, error) {
if len(d.Moniker) > stakingtypes.MaxMonikerLength {
return d, errors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid moniker length; got: %d, max: %d", len(d.Moniker), stakingtypes.MaxMonikerLength)
Expand Down
16 changes: 8 additions & 8 deletions x/gov/types/v1/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ var (
DefaultLawThreshold = math.LegacyNewDecWithPrec(9, 1)
// DefaultMinInitialDepositRatio = math.LegacyZeroDec()
DefaultBurnProposalPrevote = false // set to false to replicate behavior of when this change was made (0.47)
DefaultBurnVoteQuorom = false // set to false to replicate behavior of when this change was made (0.47)
DefaultBurnVoteQuorum = false // set to false to replicate behavior of when this change was made (0.47)
DefaultMinDepositRatio = math.LegacyNewDecWithPrec(1, 2) // NOTE: backport from v50

DefaultQuorumTimeout time.Duration = DefaultVotingPeriod - (time.Hour * 24 * 1) // disabled by default (DefaultQuorumCheckCount must be set to a non-zero value to enable)
Expand Down Expand Up @@ -183,7 +183,7 @@ func DefaultParams() Params {
DefaultLawThreshold.String(),
// DefaultMinInitialDepositRatio.String(),
DefaultBurnProposalPrevote,
DefaultBurnVoteQuorom,
DefaultBurnVoteQuorum,
DefaultMinDepositRatio.String(),
DefaultQuorumTimeout,
DefaultMaxVotingPeriodExtension,
Expand Down Expand Up @@ -324,27 +324,27 @@ func (p Params) ValidateBasic() error {

// minInitialDepositRatio, err := math.LegacyNewDecFromStr(p.MinInitialDepositRatio)
// if err != nil {
// return fmt.Errorf("invalid mininum initial deposit ratio of proposal: %w", err)
// return fmt.Errorf("invalid minimum initial deposit ratio of proposal: %w", err)
// }
// if minInitialDepositRatio.IsNegative() {
// return fmt.Errorf("mininum initial deposit ratio of proposal must be positive: %s", minInitialDepositRatio)
// return fmt.Errorf("minimum initial deposit ratio of proposal must be positive: %s", minInitialDepositRatio)
// }
// if minInitialDepositRatio.GT(math.LegacyOneDec()) {
// return fmt.Errorf("mininum initial deposit ratio of proposal is too large: %s", minInitialDepositRatio)
// return fmt.Errorf("minimum initial deposit ratio of proposal is too large: %s", minInitialDepositRatio)
// }
if len(p.MinInitialDepositRatio) > 0 {
return fmt.Errorf("manually setting min initial deposit ratio is deprecated in favor of a dynamic min initial deposit")
}

minDepositRatio, err := math.LegacyNewDecFromStr(p.MinDepositRatio)
if err != nil {
return fmt.Errorf("invalid mininum deposit ratio of proposal: %w", err)
return fmt.Errorf("invalid minimum deposit ratio of proposal: %w", err)
}
if minDepositRatio.IsNegative() {
return fmt.Errorf("mininum deposit ratio of proposal must be positive: %s", minDepositRatio)
return fmt.Errorf("minimum deposit ratio of proposal must be positive: %s", minDepositRatio)
}
if minDepositRatio.GT(math.LegacyOneDec()) {
return fmt.Errorf("mininum deposit ratio of proposal is too large: %s", minDepositRatio)
return fmt.Errorf("minimum deposit ratio of proposal is too large: %s", minDepositRatio)
}

if p.QuorumCheckCount > 0 {
Expand Down
4 changes: 2 additions & 2 deletions x/gov/types/v1/params_legacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ func validateTallyParams(i any) error {
return fmt.Errorf("invalid quorum string: %w", err)
}
if quorum.IsNegative() {
return fmt.Errorf("quorom cannot be negative: %s", quorum)
return fmt.Errorf("quorum cannot be negative: %s", quorum)
}
if quorum.GT(math.LegacyOneDec()) {
return fmt.Errorf("quorom too large: %s", v)
return fmt.Errorf("quorum too large: %s", v)
}

threshold, err := math.LegacyNewDecFromStr(v.Threshold)
Expand Down
Loading