Use flags for effective amounts in SQL schema

This commit is contained in:
Arnau B
2020-12-03 17:32:45 +01:00
parent 3e3eb3ffe6
commit 5fd258ee07
8 changed files with 100 additions and 77 deletions

View File

@@ -750,7 +750,7 @@ func (s *Synchronizer) rollupSync(ethBlock *common.Block) (*common.RollupData, e
// that stateDB can process them.
// First try to find them in HistoryDB.
l1UserTxs, err = s.historyDB.GetL1UserTxs(nextForgeL1TxsNum)
l1UserTxs, err = s.historyDB.GetUnforgedL1UserTxs(nextForgeL1TxsNum)
if err != nil {
return nil, tracerr.Wrap(err)
}

View File

@@ -101,6 +101,8 @@ func checkSyncBlock(t *testing.T, s *Synchronizer, blockNum int, block, syncBloc
break
}
}
tx.EffectiveAmount = tx.Amount
tx.EffectiveLoadAmount = tx.LoadAmount
assert.Equal(t, &tx, dbTx) //nolint:gosec
}
@@ -457,7 +459,6 @@ func TestSync(t *testing.T) {
assert.Equal(t, int64(2), stats.Sync.LastBlock.Num)
checkSyncBlock(t, s, 2, &blocks[0], syncBlock)
// Block 3
syncBlock, discards, err = s.Sync2(ctx, nil)