Add idx for txs that creat account, step1

This commit is contained in:
Arnau B
2021-01-13 13:18:32 +01:00
committed by Eduard S
parent 6651df1e52
commit 50fc607306
6 changed files with 76 additions and 69 deletions

View File

@@ -143,9 +143,14 @@ func genTestTxs(
bn := common.BatchNum(*tx.L1Info.ToForgeL1TxsNum + 2)
tx.BatchNum = &bn
}
// If FromIdx is not nil
idxStr := idxToHez(l1.FromIdx, token.Symbol)
tx.FromIdx = &idxStr
// 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 tx has a normal ToIdx (>255), set FromEthAddr and FromBJJ
if l1.ToIdx >= common.UserThreshold {
// find account