mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 03:16:45 +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:
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
ethCommon "github.com/ethereum/go-ethereum/common"
|
||||
"github.com/hermeznetwork/hermez-node/common"
|
||||
"github.com/hermeznetwork/hermez-node/log"
|
||||
"github.com/iden3/go-iden3-crypto/babyjub"
|
||||
"github.com/jmoiron/sqlx"
|
||||
|
||||
@@ -212,7 +213,10 @@ func (l2db *L2DB) CheckNonces(updatedAccounts []common.Account, batchNum common.
|
||||
defer func() {
|
||||
// Rollback the transaction if there was an error.
|
||||
if err != nil {
|
||||
err = txn.Rollback()
|
||||
errRollback := txn.Rollback()
|
||||
if errRollback != nil {
|
||||
log.Errorw("Rollback", "err", errRollback)
|
||||
}
|
||||
}
|
||||
}()
|
||||
for i := 0; i < len(updatedAccounts); i++ {
|
||||
@@ -257,7 +261,10 @@ func (l2db *L2DB) Purge(currentBatchNum common.BatchNum) (err error) {
|
||||
defer func() {
|
||||
// Rollback the transaction if there was an error.
|
||||
if err != nil {
|
||||
err = txn.Rollback()
|
||||
errRollback := txn.Rollback()
|
||||
if errRollback != nil {
|
||||
log.Errorw("Rollback", "err", errRollback)
|
||||
}
|
||||
}
|
||||
}()
|
||||
// Delete pending txs that have been in the pool after the TTL if maxTxs is reached
|
||||
|
||||
Reference in New Issue
Block a user