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:
@@ -250,15 +250,15 @@ func (tx *PoolL2Tx) Tx() (*Tx, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
// PoolL2TxsToL2Txs returns an array of []*L2Tx from an array of []*PoolL2Tx
|
||||
func PoolL2TxsToL2Txs(txs []*PoolL2Tx) ([]*L2Tx, error) {
|
||||
var r []*L2Tx
|
||||
// PoolL2TxsToL2Txs returns an array of []L2Tx from an array of []PoolL2Tx
|
||||
func PoolL2TxsToL2Txs(txs []PoolL2Tx) ([]L2Tx, error) {
|
||||
var r []L2Tx
|
||||
for _, poolTx := range txs {
|
||||
tx, err := poolTx.L2Tx()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
r = append(r, tx)
|
||||
r = append(r, *tx)
|
||||
}
|
||||
return r, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user