Skip to content

Commit

Permalink
make format
Browse files Browse the repository at this point in the history
  • Loading branch information
sampocs committed Aug 11, 2023
1 parent ac34f8b commit e633749
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 6 deletions.
1 change: 1 addition & 0 deletions store/cachekv/benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
1 change: 0 additions & 1 deletion store/streaming/constructor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
1 change: 1 addition & 0 deletions types/module/module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions x/slashing/keeper/hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
6 changes: 2 additions & 4 deletions x/staking/simulation/operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion x/staking/types/delegation.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
11 changes: 11 additions & 0 deletions x/staking/types/hooks_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit e633749

Please sign in to comment.