From 4574dd7a3c15d1537d63a87aa61d22f012e39ef2 Mon Sep 17 00:00:00 2001 From: Mikelle Date: Mon, 15 Apr 2024 11:17:19 +0200 Subject: [PATCH] updated bidder_registry event parsing --- pkg/contracts/bidder_registry/bidder_registry.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/contracts/bidder_registry/bidder_registry.go b/pkg/contracts/bidder_registry/bidder_registry.go index 451d12a..ebe41ee 100644 --- a/pkg/contracts/bidder_registry/bidder_registry.go +++ b/pkg/contracts/bidder_registry/bidder_registry.go @@ -83,12 +83,15 @@ func (r *bidderRegistryContract) PrepayAllowance(ctx context.Context, amount *bi } var bidderRegistered struct { - Bidder string + Bidder common.Address PrepaidAmount *big.Int WindowNumber *big.Int } for _, log := range receipt.Logs { - r.logger.Info("bidder registry log", "logData", log.Data) + if len(log.Topics) > 1 { + bidderRegistered.Bidder = common.HexToAddress(log.Topics[1].Hex()) + } + err := r.bidderRegistryABI.UnpackIntoInterface(&bidderRegistered, "BidderRegistered", log.Data) if err != nil { r.logger.Debug("Failed to unpack event", "err", err)