Skip to content

Commit

Permalink
chore: added logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikelle committed Jun 27, 2024
1 parent 19bb670 commit e32806e
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions p2p/pkg/rpc/bidder/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,15 +381,17 @@ func (s *Service) AutoDeposit(
var ads []*bidderapiv1.AutoDeposit

for _, log := range receipt.Logs {
if registration, err := s.registryContract.ParseBidderRegistered(*log); err == nil {
s.logger.Info("deposit successful", "amount", registration.DepositedAmount, "window", registration.WindowNumber)
ads = append(ads, &bidderapiv1.AutoDeposit{
Amount: registration.DepositedAmount.String(),
WindowNumber: wrapperspb.UInt64(registration.WindowNumber.Uint64()),
})
registration, err := s.registryContract.ParseBidderRegistered(*log)
if err != nil {
s.logger.Error("failed to parse BidderRegistered event", "error", err, "log", log)
continue
}
s.logger.Info("deposit successful", "amount", registration.DepositedAmount, "window", registration.WindowNumber)
ads = append(ads, &bidderapiv1.AutoDeposit{
Amount: registration.DepositedAmount.String(),
WindowNumber: wrapperspb.UInt64(registration.WindowNumber.Uint64()),
})
}

if len(ads) > 0 {
err := s.autoDepositTracker.DoAutoMoveToAnotherWindow(ctx, ads)
if err != nil {
Expand Down

0 comments on commit e32806e

Please sign in to comment.