Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

finish linting #568

Merged
merged 5 commits into from
Sep 15, 2023
Merged
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
19 changes: 13 additions & 6 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ run:
tests: true
# # timeout for analysis, e.g. 30s, 5m, default is 1m
timeout: 5m
skip-dirs:
- third-party-chains

linters:
disable-all: true
Expand All @@ -26,8 +28,7 @@ linters:
- typecheck
- tenv
- unconvert
# Prefer unparam over revive's unused param. It is more thorough in its checking.
- unparam
- unparam # Prefer unparam over revive's unused param. It is more thorough in its checking.
- unused
- misspell

Expand Down Expand Up @@ -91,6 +92,8 @@ linters-settings:
disabled: true
- name: empty-lines
disabled: true
- name: unused-receiver # remove later
disabled: true
- name: banned-characters
disabled: true
- name: deep-exit
Expand All @@ -107,12 +110,16 @@ linters-settings:
disabled: true
- name: defer
disabled: true
# Disabled in favour of unparam.
- name: unused-parameter
- name: unused-parameter # Disabled in favour of unparam.
disabled: true
- name: unhandled-error # enable later, currently covered by errcheck
disabled: true
- name: unhandled-error
disabled: false
arguments:
- 'b.WriteString'
- 'respJSON.Write'
- 'fmt.Printf'
- 'fmt.Print'
- 'fmt.Println'
- 'fmt.Fprintf'


26 changes: 13 additions & 13 deletions app/upgrades/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,21 +363,21 @@ func V010404beta7UpgradeHandler(
)

appKeepers.InterchainstakingKeeper.IterateRedelegationRecords(ctx, func(idx int64, key []byte, redelegation icstypes.RedelegationRecord) (stop bool) {
var UnbondingPeriod int64
var unbondingPeriod int64
switch redelegation.ChainId {
case "theta-testnet-001":
UnbondingPeriod = thetaUnbondingPeriod
unbondingPeriod = thetaUnbondingPeriod
case "uni-6":
UnbondingPeriod = uniUnbondingPeriod
unbondingPeriod = uniUnbondingPeriod
case "osmo-test-5":
UnbondingPeriod = osmoUnbondingPeriod
unbondingPeriod = osmoUnbondingPeriod
case "regen-redwood-1":
UnbondingPeriod = regenUnbondingPeriod
unbondingPeriod = regenUnbondingPeriod
}

epochInfo := appKeepers.EpochsKeeper.GetEpochInfo(ctx, epochtypes.EpochIdentifierEpoch)

if UnbondingPeriod < (epochInfo.CurrentEpoch-redelegation.EpochNumber)*epochDurations {
if unbondingPeriod < (epochInfo.CurrentEpoch-redelegation.EpochNumber)*epochDurations {
appKeepers.InterchainstakingKeeper.Logger(ctx).Info("garbage collecting completed redelegations", "key", key, "completion", redelegation.CompletionTime)
appKeepers.InterchainstakingKeeper.DeleteRedelegationRecordByKey(ctx, append(icstypes.KeyPrefixRedelegationRecord, key...))
}
Expand All @@ -404,21 +404,21 @@ func V010404rc0UpgradeHandler(
)

appKeepers.InterchainstakingKeeper.IterateRedelegationRecords(ctx, func(idx int64, key []byte, redelegation icstypes.RedelegationRecord) (stop bool) {
var UnbondingPeriod int64
var unbondingPeriod int64
switch redelegation.ChainId {
case "theta-testnet-001":
UnbondingPeriod = thetaUnbondingPeriod
unbondingPeriod = thetaUnbondingPeriod
case "uni-6":
UnbondingPeriod = uniUnbondingPeriod
unbondingPeriod = uniUnbondingPeriod
case "osmo-test-5":
UnbondingPeriod = osmoUnbondingPeriod
unbondingPeriod = osmoUnbondingPeriod
case "regen-redwood-1":
UnbondingPeriod = regenUnbondingPeriod
unbondingPeriod = regenUnbondingPeriod
}

epochInfo := appKeepers.EpochsKeeper.GetEpochInfo(ctx, epochtypes.EpochIdentifierEpoch)

if UnbondingPeriod < (epochInfo.CurrentEpoch-redelegation.EpochNumber)*epochDurations {
if unbondingPeriod < (epochInfo.CurrentEpoch-redelegation.EpochNumber)*epochDurations {
appKeepers.InterchainstakingKeeper.Logger(ctx).Info("garbage collecting completed redelegations", "key", key, "completion", redelegation.CompletionTime)
appKeepers.InterchainstakingKeeper.DeleteRedelegationRecordByKey(ctx, append(icstypes.KeyPrefixRedelegationRecord, key...))
}
Expand Down Expand Up @@ -685,7 +685,7 @@ func V010404beta10UpgradeHandler(
// }
// return mm.RunMigrations(ctx, configurator, fromVM)
// }
//}
// }
//
// func V010400rc6UpgradeHandler(
// mm *module.Manager,
Expand Down
10 changes: 7 additions & 3 deletions app/upgrades_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,13 +314,17 @@ func (s *AppTestSuite) TestV010402rc3UpgradeHandler() {

app.ParticipationRewardsKeeper.SetProtocolData(ctx, prtypes.GetProtocolDataKey(prtypes.ProtocolDataType(pdType), []byte("rege-redwood-1")), &prData)
val0 := icstypes.Validator{ValoperAddress: "osmovaloper1zxavllftfx3a3y5ldfyze7jnu5uyuktsfx2jcc", CommissionRate: sdk.MustNewDecFromStr("1"), VotingPower: sdk.NewInt(2000), Status: stakingtypes.BondStatusBonded}
app.InterchainstakingKeeper.SetValidator(ctx, upgrades.OsmosisTestnetChainID, val0)
err := app.InterchainstakingKeeper.SetValidator(ctx, upgrades.OsmosisTestnetChainID, val0)
s.Require().NoError(err)

val1 := icstypes.Validator{ValoperAddress: "osmovaloper13eq5c99ym05jn02e78l8cac2fagzgdhh4294zk", CommissionRate: sdk.MustNewDecFromStr("1"), VotingPower: sdk.NewInt(2000), Status: stakingtypes.BondStatusBonded}
app.InterchainstakingKeeper.SetValidator(ctx, upgrades.OsmosisTestnetChainID, val1)
err = app.InterchainstakingKeeper.SetValidator(ctx, upgrades.OsmosisTestnetChainID, val1)
s.Require().NoError(err)

vals := app.InterchainstakingKeeper.GetValidators(ctx, upgrades.OsmosisTestnetChainID)
s.Require().Equal(2, len(vals))

_, err := handler(ctx, types.Plan{}, app.mm.GetVersionMap())
_, err = handler(ctx, types.Plan{}, app.mm.GetVersionMap())
s.Require().NoError(err)

_, found := app.InterchainstakingKeeper.GetZone(ctx, upgrades.OsmosisTestnetChainID)
Expand Down
10 changes: 7 additions & 3 deletions cmd/quicksilverd/bulk_airdrop.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,18 @@ func BulkGenesisAirdropCmd(defaultNodeHome string) *cobra.Command {

var zoneDrop *types.ZoneDrop
// assert zonedrop exists
if len(claimRecords) == 0 {
return fmt.Errorf("claimRecords is empty")
}

for _, zd := range airdropGenState.ZoneDrops {
if zd.ChainId == claimRecords[0].ChainId {
if zd.ChainId == claimRecords[0].ChainId { //nolint:gosec
zoneDrop = zd
}
}

if zoneDrop == nil {
return fmt.Errorf("zoneDrop doesn't exist for chain ID: %s", claimRecords[0].ChainId)
return fmt.Errorf("zoneDrop doesn't exist for chain ID: %s", claimRecords[0].ChainId) //nolint:gosec // TODO: remove
}

authGenState := authtypes.GetGenesisStateFromAppState(clientCtx.Codec, appState)
Expand All @@ -207,7 +211,7 @@ func BulkGenesisAirdropCmd(defaultNodeHome string) *cobra.Command {
existing := airdropGenState.ClaimRecords

for _, i := range existing {
if i.ChainId == claimRecords[0].ChainId {
if i.ChainId == claimRecords[0].ChainId { //nolint:gosec // TODO: remove
zoneclaims[i.Address] = true
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/simulation/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var (
)

// GetSimulatorFlags gets the values of all the available simulation flags.
func GetSimulatorFlags() {
func SimulatorFlags() {
// config fields
flag.StringVar(&FlagGenesisFileValue, "Genesis", "", "custom simulation genesis file; cannot be used with params file")
flag.StringVar(&FlagParamsFileValue, "Params", "", "custom simulation params file which overrides any random params; cannot be used with genesis")
Expand Down
2 changes: 1 addition & 1 deletion test/simulation/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
)

func init() {
simulation.GetSimulatorFlags()
simulation.SimulatorFlags()
}

// interBlockCacheOpt returns a BaseApp option function that sets the persistent
Expand Down
4 changes: 2 additions & 2 deletions wasmbinding/query_plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ func (s *StargateTestSuite) TestDeterministicJsonMarshal() {
responseProtoStruct interface{}
expectedProto func() proto.Message
}{
/**
/*
* Origin Response
* balances:<denom:"bar" amount:"30" > pagination:<next_key:"foo" >
* New Version Response
Expand Down Expand Up @@ -274,7 +274,7 @@ func (s *StargateTestSuite) TestDeterministicJsonMarshal() {
}
},
},
/**
/*
// Origin proto
message QueryAccountResponse {
// account defines the account of the corresponding address.
Expand Down
3 changes: 2 additions & 1 deletion wasmbinding/test/store_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ func TestInstantiateContract(t *testing.T) {
quicksilverApp, ctx := CreateTestInput(t)
funder := RandomAccountAddress()
benefit, arb := RandomAccountAddress(), RandomAccountAddress()
FundAccount(quicksilverApp.BankKeeper, ctx, funder, sdk.NewCoins(coin))
err := FundAccount(quicksilverApp.BankKeeper, ctx, funder, sdk.NewCoins(coin))
require.NoError(t, err)

storeCodeViaProposal(t, ctx, quicksilverApp, funder)
contractKeeper := keeper.NewDefaultPermissionKeeper(quicksilverApp.WasmKeeper)
Expand Down
2 changes: 0 additions & 2 deletions x/airdrop/types/msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ func (msg MsgClaim) GetSigners() []sdk.AccAddress {
return []sdk.AccAddress{address}
}

//////////////////////////////////////////////////////////////////////////////////////////////////////

// NewMsgIncentivePoolSpend constructs a msg to claim from a zone airdrop.
func NewMsgIncentivePoolSpend(authority, toAddress sdk.Address, amt sdk.Coins) *MsgIncentivePoolSpend {
return &MsgIncentivePoolSpend{
Expand Down
12 changes: 6 additions & 6 deletions x/interchainstaking/client/cli/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,13 @@ func (s *IntegrationTestSuite) TestGetDelegatorIntentCmd() {
&types.QueryDelegatorIntentResponse{},
&types.QueryDelegatorIntentResponse{},
},
/*{
/* {
"valid",
[]string{s.cfg.ChainID, ""},
false,
&types.QueryDelegatorIntentResponse{},
&types.QueryDelegatorIntentResponse{},
},*/
}, */
}
for _, tt := range tests {
tt := tt
Expand Down Expand Up @@ -266,13 +266,13 @@ func (s *IntegrationTestSuite) TestGetDepositAccountCmd() {
&types.QueryDepositAccountForChainResponse{},
&types.QueryDepositAccountForChainResponse{},
},
/*{
/* {
"valid",
[]string{s.cfg.ChainID},
false,
&types.QueryDepositAccountForChainResponse{},
&types.QueryDepositAccountForChainResponse{},
},*/
}, */
}
for _, tt := range tests {
tt := tt
Expand Down Expand Up @@ -378,7 +378,7 @@ func (s *IntegrationTestSuite) TestGetSignalIntentTxCmd() {
0,
&sdk.TxResponse{},
},
/*{
/* {
"valid",
[]string{
s.network.Config.ChainID,
Expand All @@ -388,7 +388,7 @@ func (s *IntegrationTestSuite) TestGetSignalIntentTxCmd() {
false,
0,
&sdk.TxResponse{},
},*/
}, */
}
for _, tt := range tests {
tt := tt
Expand Down
20 changes: 15 additions & 5 deletions x/interchainstaking/keeper/callbacks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,11 +348,20 @@ func (suite *KeeperTestSuite) TestHandleValidatorCallbackNilValue() {
func (suite *KeeperTestSuite) TestHandleValidatorCallback() {
newVal := addressutils.GenerateAddressForTestWithPrefix("cosmosvaloper")
zone := icstypes.Zone{ConnectionId: "connection-0", ChainId: "cosmoshub-4", AccountPrefix: "cosmos", LocalDenom: "uqatom", BaseDenom: "uatom", Is_118: true}
suite.GetQuicksilverApp(suite.chainA).InterchainstakingKeeper.SetValidator(suite.chainA.GetContext(), zone.ChainId, icstypes.Validator{ValoperAddress: "cosmosvaloper1sjllsnramtg3ewxqwwrwjxfgc4n4ef9u2lcnj0", CommissionRate: sdk.MustNewDecFromStr("0.2"), VotingPower: sdk.NewInt(2000), DelegatorShares: sdk.NewDec(2000)})
suite.GetQuicksilverApp(suite.chainA).InterchainstakingKeeper.SetValidator(suite.chainA.GetContext(), zone.ChainId, icstypes.Validator{ValoperAddress: "cosmosvaloper156gqf9837u7d4c4678yt3rl4ls9c5vuursrrzf", CommissionRate: sdk.MustNewDecFromStr("0.2"), VotingPower: sdk.NewInt(2000), DelegatorShares: sdk.NewDec(2000)})
suite.GetQuicksilverApp(suite.chainA).InterchainstakingKeeper.SetValidator(suite.chainA.GetContext(), zone.ChainId, icstypes.Validator{ValoperAddress: "cosmosvaloper14lultfckehtszvzw4ehu0apvsr77afvyju5zzy", CommissionRate: sdk.MustNewDecFromStr("0.2"), VotingPower: sdk.NewInt(2000), DelegatorShares: sdk.NewDec(2000)})
suite.GetQuicksilverApp(suite.chainA).InterchainstakingKeeper.SetValidator(suite.chainA.GetContext(), zone.ChainId, icstypes.Validator{ValoperAddress: "cosmosvaloper1a3yjj7d3qnx4spgvjcwjq9cw9snrrrhu5h6jll", CommissionRate: sdk.MustNewDecFromStr("0.2"), VotingPower: sdk.NewInt(2000), DelegatorShares: sdk.NewDec(2000)})
suite.GetQuicksilverApp(suite.chainA).InterchainstakingKeeper.SetValidator(suite.chainA.GetContext(), zone.ChainId, icstypes.Validator{ValoperAddress: "cosmosvaloper1z8zjv3lntpwxua0rtpvgrcwl0nm0tltgpgs6l7", CommissionRate: sdk.MustNewDecFromStr("0.2"), VotingPower: sdk.NewInt(2000), DelegatorShares: sdk.NewDec(2000)})
err := suite.GetQuicksilverApp(suite.chainA).InterchainstakingKeeper.SetValidator(suite.chainA.GetContext(), zone.ChainId, icstypes.Validator{ValoperAddress: "cosmosvaloper1sjllsnramtg3ewxqwwrwjxfgc4n4ef9u2lcnj0", CommissionRate: sdk.MustNewDecFromStr("0.2"), VotingPower: sdk.NewInt(2000), DelegatorShares: sdk.NewDec(2000)})
suite.NoError(err)

err = suite.GetQuicksilverApp(suite.chainA).InterchainstakingKeeper.SetValidator(suite.chainA.GetContext(), zone.ChainId, icstypes.Validator{ValoperAddress: "cosmosvaloper156gqf9837u7d4c4678yt3rl4ls9c5vuursrrzf", CommissionRate: sdk.MustNewDecFromStr("0.2"), VotingPower: sdk.NewInt(2000), DelegatorShares: sdk.NewDec(2000)})
suite.NoError(err)

err = suite.GetQuicksilverApp(suite.chainA).InterchainstakingKeeper.SetValidator(suite.chainA.GetContext(), zone.ChainId, icstypes.Validator{ValoperAddress: "cosmosvaloper14lultfckehtszvzw4ehu0apvsr77afvyju5zzy", CommissionRate: sdk.MustNewDecFromStr("0.2"), VotingPower: sdk.NewInt(2000), DelegatorShares: sdk.NewDec(2000)})
suite.NoError(err)

err = suite.GetQuicksilverApp(suite.chainA).InterchainstakingKeeper.SetValidator(suite.chainA.GetContext(), zone.ChainId, icstypes.Validator{ValoperAddress: "cosmosvaloper1a3yjj7d3qnx4spgvjcwjq9cw9snrrrhu5h6jll", CommissionRate: sdk.MustNewDecFromStr("0.2"), VotingPower: sdk.NewInt(2000), DelegatorShares: sdk.NewDec(2000)})
suite.NoError(err)

err = suite.GetQuicksilverApp(suite.chainA).InterchainstakingKeeper.SetValidator(suite.chainA.GetContext(), zone.ChainId, icstypes.Validator{ValoperAddress: "cosmosvaloper1z8zjv3lntpwxua0rtpvgrcwl0nm0tltgpgs6l7", CommissionRate: sdk.MustNewDecFromStr("0.2"), VotingPower: sdk.NewInt(2000), DelegatorShares: sdk.NewDec(2000)})
suite.NoError(err)

tests := []struct {
name string
Expand Down Expand Up @@ -383,6 +392,7 @@ func (suite *KeeperTestSuite) TestHandleValidatorCallback() {

for _, test := range tests {
suite.Run(test.name, func() {
test := test
suite.SetupTest()
suite.setupTestZones()

Expand Down
2 changes: 1 addition & 1 deletion x/interchainstaking/keeper/ibc_packet_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ func (*Keeper) HandleTimeout(_ sdk.Context, _ channeltypes.Packet) error {
return nil
}

//----------------------------------------------------------------
// ----------------------------------------------------------------

func (k *Keeper) HandleMsgTransfer(ctx sdk.Context, msg sdk.Msg) error {
k.Logger(ctx).Info("Received MsgTransfer acknowledgement")
Expand Down
36 changes: 26 additions & 10 deletions x/interchainstaking/keeper/ibc_packet_handlers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,7 @@ func (suite *KeeperTestSuite) TestHandleWithdrawForUser() {

for _, test := range tests {
suite.Run(test.name, func() {
test := test
suite.SetupTest()
suite.setupTestZones()

Expand Down Expand Up @@ -1222,13 +1223,20 @@ func (suite *KeeperTestSuite) TestRebalanceDueToIntentChange() {
}

val0 := icstypes.Validator{ValoperAddress: "cosmosvaloper1sjllsnramtg3ewxqwwrwjxfgc4n4ef9u2lcnj0", CommissionRate: sdk.MustNewDecFromStr("1"), VotingPower: sdk.NewInt(2000), Status: stakingtypes.BondStatusBonded}
quicksilver.InterchainstakingKeeper.SetValidator(ctx, zone.ChainId, val0)
err := quicksilver.InterchainstakingKeeper.SetValidator(ctx, zone.ChainId, val0)
suite.NoError(err)

val1 := icstypes.Validator{ValoperAddress: "cosmosvaloper156gqf9837u7d4c4678yt3rl4ls9c5vuursrrzf", CommissionRate: sdk.MustNewDecFromStr("1"), VotingPower: sdk.NewInt(2000), Status: stakingtypes.BondStatusBonded}
quicksilver.InterchainstakingKeeper.SetValidator(ctx, zone.ChainId, val1)
err = quicksilver.InterchainstakingKeeper.SetValidator(ctx, zone.ChainId, val1)
suite.NoError(err)

val2 := icstypes.Validator{ValoperAddress: "cosmosvaloper14lultfckehtszvzw4ehu0apvsr77afvyju5zzy", CommissionRate: sdk.MustNewDecFromStr("1"), VotingPower: sdk.NewInt(2000), Status: stakingtypes.BondStatusBonded}
quicksilver.InterchainstakingKeeper.SetValidator(ctx, zone.ChainId, val2)
err = quicksilver.InterchainstakingKeeper.SetValidator(ctx, zone.ChainId, val2)
suite.NoError(err)

val3 := icstypes.Validator{ValoperAddress: "cosmosvaloper1z8zjv3lntpwxua0rtpvgrcwl0nm0tltgpgs6l7", CommissionRate: sdk.MustNewDecFromStr("1"), VotingPower: sdk.NewInt(2000), Status: stakingtypes.BondStatusBonded}
quicksilver.InterchainstakingKeeper.SetValidator(ctx, zone.ChainId, val3)
err = quicksilver.InterchainstakingKeeper.SetValidator(ctx, zone.ChainId, val3)
suite.NoError(err)

vals = quicksilver.InterchainstakingKeeper.GetValidators(ctx, zone.ChainId)

Expand Down Expand Up @@ -1270,7 +1278,7 @@ func (suite *KeeperTestSuite) TestRebalanceDueToIntentChange() {
quicksilver.InterchainstakingKeeper.SetZone(ctx, &zone)

// trigger rebalance
err := quicksilver.InterchainstakingKeeper.Rebalance(ctx, &zone, 1)
err = quicksilver.InterchainstakingKeeper.Rebalance(ctx, &zone, 1)
suite.NoError(err)

// change intents to trigger redelegations from val[3]
Expand Down Expand Up @@ -1352,13 +1360,21 @@ func (suite *KeeperTestSuite) TestRebalanceDueToDelegationChange() {
}

val0 := icstypes.Validator{ValoperAddress: "cosmosvaloper1sjllsnramtg3ewxqwwrwjxfgc4n4ef9u2lcnj0", CommissionRate: sdk.MustNewDecFromStr("1"), VotingPower: sdk.NewInt(2000), Status: stakingtypes.BondStatusBonded}
quicksilver.InterchainstakingKeeper.SetValidator(ctx, zone.ChainId, val0)
err := quicksilver.InterchainstakingKeeper.SetValidator(ctx, zone.ChainId, val0)
suite.NoError(err)

val1 := icstypes.Validator{ValoperAddress: "cosmosvaloper156gqf9837u7d4c4678yt3rl4ls9c5vuursrrzf", CommissionRate: sdk.MustNewDecFromStr("1"), VotingPower: sdk.NewInt(2000), Status: stakingtypes.BondStatusBonded}
quicksilver.InterchainstakingKeeper.SetValidator(ctx, zone.ChainId, val1)
err = quicksilver.InterchainstakingKeeper.SetValidator(ctx, zone.ChainId, val1)
suite.NoError(err)

val2 := icstypes.Validator{ValoperAddress: "cosmosvaloper14lultfckehtszvzw4ehu0apvsr77afvyju5zzy", CommissionRate: sdk.MustNewDecFromStr("1"), VotingPower: sdk.NewInt(2000), Status: stakingtypes.BondStatusBonded}
quicksilver.InterchainstakingKeeper.SetValidator(ctx, zone.ChainId, val2)
err = quicksilver.InterchainstakingKeeper.SetValidator(ctx, zone.ChainId, val2)
suite.NoError(err)

val3 := icstypes.Validator{ValoperAddress: "cosmosvaloper1z8zjv3lntpwxua0rtpvgrcwl0nm0tltgpgs6l7", CommissionRate: sdk.MustNewDecFromStr("1"), VotingPower: sdk.NewInt(2000), Status: stakingtypes.BondStatusBonded}
quicksilver.InterchainstakingKeeper.SetValidator(ctx, zone.ChainId, val3)
err = quicksilver.InterchainstakingKeeper.SetValidator(ctx, zone.ChainId, val3)
suite.NoError(err)

delegations := []icstypes.Delegation{
{
DelegationAddress: zone.DelegationAddress.Address,
Expand Down Expand Up @@ -1399,7 +1415,7 @@ func (suite *KeeperTestSuite) TestRebalanceDueToDelegationChange() {
}

// trigger rebalance
err := quicksilver.InterchainstakingKeeper.Rebalance(ctx, &zone, 1)
err = quicksilver.InterchainstakingKeeper.Rebalance(ctx, &zone, 1)
suite.NoError(err)

quicksilver.InterchainstakingKeeper.IterateAllDelegations(ctx, &zone, func(delegation icstypes.Delegation) bool {
Expand Down
Loading