Merge pull request #199 from hermeznetwork/feature/tkcio-tokenregister

Add transakcio Token Register instructions parser
This commit is contained in:
Eduard S
2020-10-15 18:34:34 +02:00
committed by GitHub
8 changed files with 192 additions and 66 deletions

View File

@@ -366,10 +366,7 @@ func (s *StateDB) processL2Tx(exitTree *merkletree.MerkleTree, tx *common.PoolL2
return nil, nil, false, err
}
tx.Nonce = acc.Nonce
// TokenID is also not set in the L2Txs from the blockchain
// that the Synchronizer works with, but does not need to be
// defined because is not used later for the L2Txs processing
// (Transfer & Exit)
tx.TokenID = acc.TokenID
}
switch tx.Type {

View File

@@ -22,7 +22,8 @@ func TestProcessTxsSynchronizer(t *testing.T) {
// generate test transactions from test.SetTest0 code
tc := transakcio.NewTestContext()
blocks := tc.GenerateBlocks(transakcio.SetBlockchain0)
blocks, err := tc.GenerateBlocks(transakcio.SetBlockchain0)
require.Nil(t, err)
assert.Equal(t, 29, len(blocks[0].Batches[0].L1UserTxs))
assert.Equal(t, 0, len(blocks[0].Batches[0].L1CoordinatorTxs))