Skip to content

Commit

Permalink
removed commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
joanestebanr committed Sep 6, 2024
1 parent 74fbd80 commit b43627e
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions synchronizer/synchronizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,40 +149,30 @@ func NewSynchronizerFromConfigfile(ctx context.Context, configFile string) (Sync
}

func NewSynchronizer(ctx context.Context, config config.Config) (Synchronizer, error) {
/* configStorage := pgstorage.Config{
Name: config.DB.Name,
User: config.DB.User,
Password: config.DB.Password,
Host: config.DB.Host,
Port: config.DB.Port,
MaxConns: config.DB.MaxConns,
}
*/
log.Init(config.Log)

//storage, err := pgstorage.NewPostgresStorage(configStorage)

log.Debugf("Creating storage")
storage, err := storage.NewStorage(config.SQLDB)

Check failure on line 154 in synchronizer/synchronizer.go

View workflow job for this annotation

GitHub Actions / lint

undefined: storage.NewStorage (typecheck)

Check failure on line 154 in synchronizer/synchronizer.go

View workflow job for this annotation

GitHub Actions / lint

undefined: storage.NewStorage) (typecheck)

Check failure on line 154 in synchronizer/synchronizer.go

View workflow job for this annotation

GitHub Actions / check_version

undefined: storage.NewStorage

Check failure on line 154 in synchronizer/synchronizer.go

View workflow job for this annotation

GitHub Actions / unittest

undefined: storage.NewStorage

Check failure on line 154 in synchronizer/synchronizer.go

View workflow job for this annotation

GitHub Actions / unittest

undefined: storage.NewStorage

Check failure on line 154 in synchronizer/synchronizer.go

View workflow job for this annotation

GitHub Actions / check_version

undefined: storage.NewStorage

Check failure on line 154 in synchronizer/synchronizer.go

View workflow job for this annotation

GitHub Actions / lint

undefined: storage.NewStorage (typecheck)

Check failure on line 154 in synchronizer/synchronizer.go

View workflow job for this annotation

GitHub Actions / lint

undefined: storage.NewStorage) (typecheck)
if err != nil {
log.Error(err)
return nil, err
}

log.Debugf("Creating etherman")
etherman, err := etherman.NewClient(config.Etherman)
if err != nil {
log.Error("Error creating etherman", err)
return nil, err
}
log.Debugf("Creating state")
state := state.NewState(storage)
storageCompatibilityChecker := internal.NewSanityStorageCheckerImpl(state, etherman, config.Synchronizer.OverrideStorageCheck)
sync, err := internal.NewSynchronizerImpl(ctx, storage, state, etherman, storageCompatibilityChecker, config.Synchronizer)
if err != nil {
log.Error("Error creating synchronizer", err)
return nil, err
}

log.Debugf("Creating synchronizer adapter")
syncAdapter := NewSynchronizerAdapter(NewSyncrhronizerQueries(state, storage, ctx), sync)

log.Debugf("Starting RPC if enabled")
rpcsync.StartRPC(state)

return syncAdapter, nil
Expand Down

0 comments on commit b43627e

Please sign in to comment.