Fix TxProcessor TokenID use &updates at Til&Common

- Til
  - tests that were using `til.SetBlockchainMinimumFlow0` have been
updated, as now the L1CoordinatorTxs are placed simulating TxSelector
creation (when needed, not before)
  - Add `EthSk` to `tc.User` to allow to sign `AccoutCreationAuths` at
the tests flows
- TxProcessor
  - for L2Txs get TokenID from tx.FromIdx Account.TokenID instead than
  - update tests vectors for new values
from tx.TokenID (which not always is set)
- Common
  - move TxIDsFromL2Txs & TxIDsFromPoolL2Txs from `coordinator` to
`common` to allow usage from other packages
This commit is contained in:
arnaucube
2021-01-02 20:54:08 +01:00
parent 926943cb71
commit 48bdec1397
8 changed files with 57 additions and 43 deletions

View File

@@ -124,6 +124,15 @@ func L2TxsToPoolL2Txs(txs []L2Tx) []PoolL2Tx {
return r
}
// TxIDsFromL2Txs returns an array of TxID from the []L2Tx
func TxIDsFromL2Txs(txs []L2Tx) []TxID {
txIDs := make([]TxID, len(txs))
for i, tx := range txs {
txIDs[i] = tx.TxID
}
return txIDs
}
// BytesDataAvailability encodes a L2Tx into []byte for the Data Availability
func (tx L2Tx) BytesDataAvailability(nLevels uint32) ([]byte, error) {
idxLen := nLevels / 8 //nolint:gomnd