Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
gitferry committed Dec 4, 2024
1 parent 4a0f829 commit 6ca0564
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
6 changes: 2 additions & 4 deletions finality-provider/service/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,7 @@ func FuzzStatusUpdate(f *testing.F) {
var err error
require.Eventually(t, func() bool {
fpIns, err = app.GetFinalityProviderInstance()
if err != nil {
return false
}
return true
return err == nil
}, time.Second*5, time.Millisecond*200, "should eventually be registered or active")

if votingPower > 0 {
Expand Down Expand Up @@ -339,6 +336,7 @@ func startFPAppWithRegisteredFp(t *testing.T, r *rand.Rand, homePath string, cfg
cfg.BabylonConfig.KeyringBackend,
input,
)
require.NoError(t, err)
kc, err := keyring.NewChainKeyringControllerWithKeyring(kr, keyName, input)
require.NoError(t, err)
btcPkBytes, err := em.CreateKey(keyName, passphrase, hdPath)
Expand Down
1 change: 1 addition & 0 deletions finality-provider/service/fp_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ func startFinalityProviderAppWithRegisteredFp(t *testing.T, r *rand.Rand, cc cli
fpCfg.BabylonConfig.KeyringBackend,
input,
)
require.NoError(t, err)
kc, err := fpkr.NewChainKeyringControllerWithKeyring(kr, keyName, input)
require.NoError(t, err)
keyInfo, err := kc.CreateChainKey("", "", "")
Expand Down
6 changes: 2 additions & 4 deletions finality-provider/store/fpstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,11 @@ func (s *FinalityProviderStore) UpdateFpStatusFromVotingPower(
return proto.FinalityProviderStatus_ACTIVE, s.SetFpStatus(fp.BtcPk, proto.FinalityProviderStatus_ACTIVE)
}

// voting power == 0 then set status depending on previous status
//nolint:exhaustive
switch fp.Status {
case proto.FinalityProviderStatus_ACTIVE:
if fp.Status == proto.FinalityProviderStatus_ACTIVE {
// previous status is ACTIVE then set to INACTIVE
return proto.FinalityProviderStatus_INACTIVE, s.SetFpStatus(fp.BtcPk, proto.FinalityProviderStatus_INACTIVE)
}

return fp.Status, nil
}

Expand Down

0 comments on commit 6ca0564

Please sign in to comment.