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

fix: ResubscribeToMissedBtcNotifications error #83

Merged
merged 1 commit into from
Dec 3, 2024
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
2 changes: 1 addition & 1 deletion config/config-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ btc:
retryinterval: 500ms
netparams: signet
bbn:
rpc-addr: https://rpc.devnet.babylonlabs.io:443
rpc-addr: https://rpc-dapp.devnet.babylonlabs.io:443
timeout: 30s
maxretrytimes: 5
retryinterval: 500ms
Expand Down
2 changes: 1 addition & 1 deletion config/config-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ btc:
retryinterval: 500ms
netparams: signet
bbn:
rpc-addr: https://rpc.devnet.babylonlabs.io:443
rpc-addr: https://rpc-dapp.devnet.babylonlabs.io:443
timeout: 30s
maxretrytimes: 5
retryinterval: 500ms
Expand Down
7 changes: 0 additions & 7 deletions internal/db/delegation.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,12 +314,5 @@ func (db *Database) GetBTCDelegationsByStates(
return nil, err
}

if len(delegations) == 0 {
return nil, &NotFoundError{
Key: "specified states",
Message: "No BTC delegations found for the specified states",
}
}

return delegations, nil
}
2 changes: 1 addition & 1 deletion internal/services/subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (s *Service) SubscribeToBbnEvents(ctx context.Context) {
// Resubscribe to missed BTC notifications
func (s *Service) ResubscribeToMissedBtcNotifications(ctx context.Context) {
go func() {
defer s.wg.Done()
log.Info().Msg("Resubscribing to missed BTC notifications")
delegations, err := s.db.GetBTCDelegationsByStates(ctx, []types.DelegationState{types.StateUnbonding, types.StateSlashed})
if err != nil {
log.Fatal().Msgf("Failed to get BTC delegations: %v", err)
Expand Down
Loading