diff --git a/store/cachekv/benchmark_test.go b/store/cachekv/benchmark_test.go index 2db62ba5d6c6..b899068dec6d 100644 --- a/store/cachekv/benchmark_test.go +++ b/store/cachekv/benchmark_test.go @@ -53,6 +53,7 @@ func BenchmarkDeepContextStack1(b *testing.B) { func BenchmarkDeepContextStack3(b *testing.B) { DoBenchmarkDeepContextStack(b, 3) } + func BenchmarkDeepContextStack10(b *testing.B) { DoBenchmarkDeepContextStack(b, 10) } diff --git a/store/streaming/constructor_test.go b/store/streaming/constructor_test.go index f23fa499e827..d1b9af202e23 100644 --- a/store/streaming/constructor_test.go +++ b/store/streaming/constructor_test.go @@ -23,7 +23,6 @@ type fakeOptions struct{} func (f *fakeOptions) Get(key string) interface{} { if key == "streamers.file.write_dir" { return "data/file_streamer" - } return nil } diff --git a/types/module/module_test.go b/types/module/module_test.go index 35405601d6c9..c9d3ae7234a3 100644 --- a/types/module/module_test.go +++ b/types/module/module_test.go @@ -358,6 +358,7 @@ func (MockCoreAppModule) DefaultGenesis(target appmodule.GenesisTarget) error { someFieldWriter.Write([]byte(`"someValue"`)) return someFieldWriter.Close() } + func (MockCoreAppModule) ValidateGenesis(src appmodule.GenesisSource) error { rdr, err := src("someField") if err != nil { diff --git a/x/slashing/keeper/hooks.go b/x/slashing/keeper/hooks.go index 150cca571c7b..4892541a1527 100644 --- a/x/slashing/keeper/hooks.go +++ b/x/slashing/keeper/hooks.go @@ -80,6 +80,7 @@ func (h Hooks) BeforeValidatorSlashed(_ sdk.Context, _ sdk.ValAddress, _ sdk.Dec func (h Hooks) AfterUnbondingInitiated(_ sdk.Context, _ uint64) error { return nil } + func (h Hooks) BeforeTokenizeShareRecordRemoved(_ sdk.Context, _ uint64) error { return nil } diff --git a/x/staking/simulation/operations.go b/x/staking/simulation/operations.go index d2c42602f0b1..dfbb3acfc84b 100644 --- a/x/staking/simulation/operations.go +++ b/x/staking/simulation/operations.go @@ -15,11 +15,9 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking/types" ) -const () - // Simulation operation weights constants // -//nolint:gosec // these are not hard-coded credentials + const ( OpWeightMsgCreateValidator = "op_weight_msg_create_validator" //nolint:gosec OpWeightMsgEditValidator = "op_weight_msg_edit_validator" //nolint:gosec @@ -786,7 +784,7 @@ func SimulateMsgTokenizeShares(ak types.AccountKeeper, bk types.BankKeeper, k ke params := k.GetParams(ctx) totalStaked := k.TotalBondedTokens(ctx).ToDec() if totalStaked.IsZero() { - return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTokenizeShares, "cannot happend - no validators bonded if stake is 0.0"), nil, nil // skip + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgTokenizeShares, "cannot happened - no validators bonded if stake is 0.0"), nil, nil // skip } totalLiquidStaked := k.GetTotalLiquidStakedTokens(ctx).Add(tokenizeShareAmt).ToDec() liquidStakedPercent := totalLiquidStaked.Quo(totalStaked) diff --git a/x/staking/types/delegation.go b/x/staking/types/delegation.go index 4a945a20531f..fc550ebad348 100644 --- a/x/staking/types/delegation.go +++ b/x/staking/types/delegation.go @@ -412,7 +412,8 @@ func NewRedelegationResponse( // NewRedelegationEntryResponse creates a new RedelegationEntryResponse instance. func NewRedelegationEntryResponse( - creationHeight int64, completionTime time.Time, sharesDst sdk.Dec, initialBalance, balance sdk.Int, id uint64) RedelegationEntryResponse { + creationHeight int64, completionTime time.Time, sharesDst sdk.Dec, initialBalance, balance sdk.Int, id uint64, +) RedelegationEntryResponse { return RedelegationEntryResponse{ RedelegationEntry: NewRedelegationEntry(creationHeight, completionTime, initialBalance, sharesDst, id), Balance: balance, diff --git a/x/staking/types/hooks_template.go b/x/staking/types/hooks_template.go index d6dcf03f1238..2cff3b2cd103 100644 --- a/x/staking/types/hooks_template.go +++ b/x/staking/types/hooks_template.go @@ -10,27 +10,38 @@ var _ StakingHooks = StakingHooksTemplate{} func (h StakingHooksTemplate) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) { } + func (h StakingHooksTemplate) BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress) { } + func (h StakingHooksTemplate) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) { } + func (h StakingHooksTemplate) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) { } + func (h StakingHooksTemplate) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) { } + func (h StakingHooksTemplate) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) { } + func (h StakingHooksTemplate) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) { } + func (h StakingHooksTemplate) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) { } + func (h StakingHooksTemplate) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) { } + func (h StakingHooksTemplate) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) { } + func (h StakingHooksTemplate) AfterUnbondingInitiated(ctx sdk.Context, id uint64) error { return nil } + func (h StakingHooksTemplate) BeforeTokenizeShareRecordRemoved(ctx sdk.Context, recordId uint64) error { return nil }