Add TokenID to L2Tx

L2Tx.TokenID is not on the data obtained by the Synchronizer from the
blockchain, but is set by the TxProcessor when processing the
transactions in the StateDB.
This commit is contained in:
arnaucube
2021-01-27 12:40:09 +01:00
parent f3678e8cb8
commit a899f43914
5 changed files with 25 additions and 13 deletions

View File

@@ -818,6 +818,7 @@ func (tc *Context) FillBlocksForgedL1UserTxs(blocks []common.BlockData) error {
// - blocks[].Rollup.Batch.L2Txs[].TxID
// - blocks[].Rollup.Batch.L2Txs[].Position
// - blocks[].Rollup.Batch.L2Txs[].Nonce
// - blocks[].Rollup.Batch.L2Txs[].TokenID
// - blocks[].Rollup.Batch.ExitTree
// - blocks[].Rollup.Batch.CreatedAccounts
// - blocks[].Rollup.Batch.FeeIdxCoordinator
@@ -915,6 +916,7 @@ func (tc *Context) FillBlocksExtra(blocks []common.BlockData, cfg *ConfigExtra)
tx.Position = position
position++
tx.Nonce = tc.extra.nonces[tx.FromIdx]
tx.TokenID = tc.accountsByIdx[int(tx.FromIdx)].TokenID
tc.extra.nonces[tx.FromIdx]++
if err := tx.SetID(); err != nil {
return tracerr.Wrap(err)