mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-06 19:06:42 +01:00
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:
@@ -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
|
||||
|
||||
@@ -345,6 +345,15 @@ func PoolL2TxsToL2Txs(txs []PoolL2Tx) ([]L2Tx, error) {
|
||||
return l2Txs, nil
|
||||
}
|
||||
|
||||
// TxIDsFromPoolL2Txs returns an array of TxID from the []PoolL2Tx
|
||||
func TxIDsFromPoolL2Txs(txs []PoolL2Tx) []TxID {
|
||||
txIDs := make([]TxID, len(txs))
|
||||
for i, tx := range txs {
|
||||
txIDs[i] = tx.TxID
|
||||
}
|
||||
return txIDs
|
||||
}
|
||||
|
||||
// PoolL2TxState is a string that represents the status of a L2 transaction
|
||||
type PoolL2TxState string
|
||||
|
||||
|
||||
Reference in New Issue
Block a user