mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-06 19:06:42 +01:00
Set l1tx.EffectiveFromIdx in TxProcessor and til
This commit is contained in:
@@ -268,6 +268,10 @@ func TestMain(m *testing.M) {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
err = tcc.FillBlocksForgedL1UserTxs(blocksData)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
AddAditionalInformation(blocksData)
|
||||
// Generate L2 Txs with til
|
||||
commonPoolTxs, err := tcc.GeneratePoolL2Txs(txsets.SetPoolL2MinimumFlow0)
|
||||
@@ -330,7 +334,6 @@ func TestMain(m *testing.M) {
|
||||
testTokens = append(testTokens, token)
|
||||
}
|
||||
// Set USD value for tokens in DB
|
||||
commonL1Txs = append(commonL1Txs, block.Rollup.L1UserTxs...)
|
||||
for _, batch := range block.Rollup.Batches {
|
||||
commonL2Txs = append(commonL2Txs, batch.L2Txs...)
|
||||
for i := range batch.CreatedAccounts {
|
||||
@@ -339,6 +342,7 @@ func TestMain(m *testing.M) {
|
||||
}
|
||||
commonBatches = append(commonBatches, batch.Batch)
|
||||
commonExitTree = append(commonExitTree, batch.ExitTree...)
|
||||
commonL1Txs = append(commonL1Txs, batch.L1UserTxs...)
|
||||
commonL1Txs = append(commonL1Txs, batch.L1CoordinatorTxs...)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,14 +143,9 @@ func genTestTxs(
|
||||
bn := common.BatchNum(*tx.L1Info.ToForgeL1TxsNum + 2)
|
||||
tx.BatchNum = &bn
|
||||
}
|
||||
// TODO: User L1 txs that create txs will have fromAccountIndex equal to the idx of the
|
||||
// created account. Once this is done this test will be broken and will need to be updated here.
|
||||
// At the moment they are null
|
||||
if l1.Type != common.TxTypeCreateAccountDeposit &&
|
||||
l1.Type != common.TxTypeCreateAccountDepositTransfer {
|
||||
idxStr := idxToHez(l1.FromIdx, token.Symbol)
|
||||
tx.FromIdx = &idxStr
|
||||
}
|
||||
// If FromIdx is not nil
|
||||
idxStr := idxToHez(l1.EffectiveFromIdx, token.Symbol)
|
||||
tx.FromIdx = &idxStr
|
||||
// If tx has a normal ToIdx (>255), set FromEthAddr and FromBJJ
|
||||
if l1.ToIdx >= common.UserThreshold {
|
||||
// find account
|
||||
|
||||
Reference in New Issue
Block a user