mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-06 19:06:42 +01:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user