Add transakcio coordinator tx instruction feature

Transakcio:
- Transaction generation to fail when Transfer to an account that don't exist (not created yet)
- Add CreateAccountDepositCoordinator instruction feature
- Updated lang.go instruction type parser approach for more simplicity of code
- Remove `*testing.T` from transactions generation methods, use `log.Fatal` instead
This commit is contained in:
arnaucube
2020-10-14 17:17:28 +02:00
parent 250f1aa119
commit 17ff917a20
8 changed files with 116 additions and 108 deletions

View File

@@ -21,7 +21,7 @@ func TestProcessTxsSynchronizer(t *testing.T) {
assert.Nil(t, err)
// generate test transactions from test.SetTest0 code
tc := transakcio.NewTestContext(t)
tc := transakcio.NewTestContext()
blocks := tc.GenerateBlocks(transakcio.SetBlockchain0)
assert.Equal(t, 29, len(blocks[0].Batches[0].L1UserTxs))
@@ -31,7 +31,7 @@ func TestProcessTxsSynchronizer(t *testing.T) {
assert.Equal(t, 1, len(blocks[0].Batches[1].L1CoordinatorTxs))
assert.Equal(t, 59, len(blocks[0].Batches[1].L2Txs))
assert.Equal(t, 9, len(blocks[0].Batches[2].L1UserTxs))
assert.Equal(t, 0, len(blocks[0].Batches[2].L1CoordinatorTxs))
assert.Equal(t, 1, len(blocks[0].Batches[2].L1CoordinatorTxs))
assert.Equal(t, 8, len(blocks[0].Batches[2].L2Txs))
// use first batch
@@ -76,7 +76,7 @@ func TestProcessTxsBatchBuilder(t *testing.T) {
assert.Nil(t, err)
// generate test transactions from test.SetTest0 code
tc := transakcio.NewTestContext(t)
tc := transakcio.NewTestContext()
blocks := tc.GenerateBlocks(transakcio.SetBlockchain0)
assert.Equal(t, 29, len(blocks[0].Batches[0].L1UserTxs))
@@ -125,7 +125,7 @@ func TestZKInputsGeneration(t *testing.T) {
assert.Nil(t, err)
// generate test transactions from test.SetTest0 code
tc := transakcio.NewTestContext(t)
tc := transakcio.NewTestContext()
blocks := tc.GenerateBlocks(transakcio.SetBlockchain0)
assert.Equal(t, 29, len(blocks[0].Batches[0].L1UserTxs))
assert.Equal(t, 0, len(blocks[0].Batches[0].L1CoordinatorTxs))