Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
nolag committed Dec 14, 2023
1 parent 107298f commit 365242f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion core/services/ocr2/plugins/median/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ type latestRoundRequested struct {
}

func (m *medianContract) LatestTransmissionDetails(ctx context.Context) (configDigest ocr2types.ConfigDigest, epoch uint32, round uint8, latestAnswer *big.Int, latestTimestamp time.Time, err error) {
var resp latestTransmissionDetailsResponse
// init the LatestAnswer so that it's not nil if there have been no events yet
resp := latestTransmissionDetailsResponse{LatestAnswer: new(big.Int)}

err = m.chainReader.GetLatestValue(ctx, m.contract.Name, "LatestTransmissionDetails", nil, &resp)
if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion core/services/relay/evm/chain_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,12 @@ func (cr *chainReader) getLatestValueFromLogPoller(ctx context.Context, contract

log, err := cr.lp.LatestLogByEventSigWithConfs(hash, ae.addr, logpoller.Finalized)
if err != nil {
cr.lggr.Errorf("!!!!!!!!!!\nNo sig err:\n%v\n!!!!!!!!!!\n", err)
errStr := err.Error()
if strings.Contains(errStr, "not found") || strings.Contains(errStr, "no rows") {
cr.lggr.Infof("!!!!!!!!!!\nReturning no error when nothing is found\n!!!!!!!!!!\n")
return nil
}
cr.lggr.Errorf("!!!!!!!!!!\nNo sig err:\n%v\n!!!!!!!!!!\n", err)
return fmt.Errorf("%w: %w", commontypes.ErrInternal, err)
}
err = cr.codec.Decode(ctx, log.Data, returnVal, wrapItemType(contractName, method, false))
Expand Down

0 comments on commit 365242f

Please sign in to comment.