Set l1tx.EffectiveFromIdx in TxProcessor and til

This commit is contained in:
Eduard S
2021-01-13 14:51:59 +01:00
parent 50fc607306
commit ec194d5066
10 changed files with 112 additions and 55 deletions

View File

@@ -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