Commit 573d18c5 authored by Hamdi Allam's avatar Hamdi Allam

ci failures

parent 18779f6d
......@@ -21,8 +21,8 @@ const (
)
// DepositsByAddress mocks returning deposits by an address
func (mbv *MockBridgeView) DepositsByAddress(address common.Address) ([]*database.DepositWithTransactionHash, error) {
return []*database.DepositWithTransactionHash{
func (mbv *MockBridgeView) DepositsByAddress(address common.Address) ([]*database.DepositWithTransactionHashes, error) {
return []*database.DepositWithTransactionHashes{
{
Deposit: database.Deposit{
GUID: uuid.MustParse(guid1),
......
......@@ -2,7 +2,6 @@ package cli
import (
"context"
"errors"
"fmt"
"os"
"os/signal"
......@@ -41,11 +40,11 @@ func runIndexer(ctx *cli.Context) error {
}
signalChannel := make(chan os.Signal, 1)
indexerCtx, indexerCancel := context.WithCancelCause(context.Background())
indexerCtx, indexerCancel := context.WithCancel(context.Background())
signal.Notify(signalChannel, os.Interrupt)
go func() {
<-signalChannel
indexerCancel(errors.New("caught interrrupt"))
indexerCancel()
}()
return indexer.Run(indexerCtx)
......
......@@ -5,6 +5,8 @@ import (
"fmt"
"sync"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum-optimism/optimism/indexer/config"
"github.com/ethereum-optimism/optimism/indexer/database"
"github.com/ethereum-optimism/optimism/indexer/node"
......@@ -14,7 +16,8 @@ import (
// Indexer contains the necessary resources for
// indexing the configured L1 and L2 chains
type Indexer struct {
db *database.DB
db *database.DB
log log.Logger
L1Processor *processor.L1Processor
L2Processor *processor.L2Processor
......@@ -52,6 +55,7 @@ func NewIndexer(cfg config.Config) (*Indexer, error) {
indexer := &Indexer{
db: db,
log: cfg.Logger,
L1Processor: l1Processor,
L2Processor: l2Processor,
}
......@@ -65,14 +69,16 @@ func (i *Indexer) Run(ctx context.Context) error {
errCh := make(chan error)
// If either processor errors out, we stop
processorCtx, cancel := context.WithCancelCause(ctx)
processorCtx, cancel := context.WithCancel(ctx)
run := func(start func(ctx context.Context) error) {
wg.Add(1)
defer wg.Done()
err := start(processorCtx)
if err != nil {
cancel(err)
i.log.Error("halting indexer on error", "err", err)
cancel()
errCh <- err
}
}
......
......@@ -310,7 +310,7 @@ func l1BridgeProcessContractEvents(processLog log.Logger, db *database.DB, ethCl
if withdrawal == nil {
// This needs to be updated to read from config as well as correctly identify if the CrossDomainMessenger message is a standard
// bridge message. This will easier to do once we index passed messages seperately which will include the right To/From fields
// bridge message. This will easier to do once we index passed messages separately which will include the right To/From fields
if provenWithdrawalEvent.From != common.HexToAddress("0x4200000000000000000000000000000000000007") || provenWithdrawalEvent.To != l1Contracts.L1CrossDomainMessenger {
// non-bridge withdrawal
continue
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment