mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 11:26:44 +01:00
Extend ethclient test, implement new TxID spec
- Implement new TxID spec that distinguishes L1UserTx and L1CoordinatorTx - Replace some type []*Foo by []Foo - Fix HistoryDB & L2DB bug: in case of error, a rollback was applied and the returned error was nil - Reorder inserts in historydb.NewHistoryDB() to follow foreign key dependencies - Add initial synchronizer test with test.Client (for now, only tested l1UserTxs, blocks, addToken) - Update L1UserTx event in test.Client
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package node
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/ethereum/go-ethereum/ethclient"
|
||||
@@ -83,7 +84,10 @@ func NewNode(mode Mode, cfg *config.Node, coordCfg *config.Coordinator) (*Node,
|
||||
}
|
||||
client := eth.NewClient(ethClient, nil, nil, nil)
|
||||
|
||||
sync := synchronizer.NewSynchronizer(client, historyDB, stateDB)
|
||||
sync, err := synchronizer.NewSynchronizer(client, historyDB, stateDB)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var coord *coordinator.Coordinator
|
||||
if mode == ModeCoordinator {
|
||||
@@ -223,7 +227,7 @@ func (n *Node) StartSynchronizer() {
|
||||
log.Info("Coordinator stopped")
|
||||
return
|
||||
case <-time.After(n.cfg.Synchronizer.SyncLoopInterval.Duration):
|
||||
if err := n.sync.Sync(); err != nil {
|
||||
if err := n.sync.Sync(context.TODO()); err != nil {
|
||||
log.Errorw("Synchronizer.Sync", "error", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user