diff --git a/core/chains/evm/logpoller/parser.go b/core/chains/evm/logpoller/parser.go index baa681e5efa..06aa92e8e47 100644 --- a/core/chains/evm/logpoller/parser.go +++ b/core/chains/evm/logpoller/parser.go @@ -432,6 +432,12 @@ func orderToString(dir query.SortDirection) (string, error) { } } +// MakeContractReaderCursor is exported to ensure cursor structure remains consistent. +func FormatContractReaderCursor(log Log) string { + return fmt.Sprintf("%d-%d-%s", log.BlockNumber, log.LogIndex, log.TxHash) +} + +// ensure valuesFromCursor remains consistent with the function above that creates a cursor func valuesFromCursor(cursor string) (int64, int, []byte, error) { partCount := 3 diff --git a/core/services/relay/evm/read/event.go b/core/services/relay/evm/read/event.go index 03bee7472bc..c635b51c9a9 100644 --- a/core/services/relay/evm/read/event.go +++ b/core/services/relay/evm/read/event.go @@ -338,7 +338,7 @@ func (b *EventBinding) decodeLogsIntoSequences(ctx context.Context, logs []logpo for idx := range logs { sequences[idx] = commontypes.Sequence{ - Cursor: fmt.Sprintf("%s-%s-%d", logs[idx].BlockHash, logs[idx].TxHash, logs[idx].LogIndex), + Cursor: logpoller.FormatContractReaderCursor(logs[idx]), Head: commontypes.Head{ Height: fmt.Sprint(logs[idx].BlockNumber), Hash: logs[idx].BlockHash.Bytes(),