hermez-node/test/til/sets_test.go
test/til/sets_test.goRaw
1package til
2
3import (
4 "strings"
5 "testing"
6
7 "github.com/hermeznetwork/hermez-node/eth"
8 "github.com/stretchr/testify/assert"
9)
10
11func TestCompileSetsBase(t *testing.T) {
12 parser := newParser(strings.NewReader(SetBlockchain0))
13 _, err := parser.parse()
14 assert.Nil(t, err)
15 parser = newParser(strings.NewReader(SetPool0))
16 _, err = parser.parse()
17 assert.Nil(t, err)
18
19 tc := NewContext(eth.RollupConstMaxL1UserTx)
20 _, err = tc.GenerateBlocks(SetBlockchain0)
21 assert.Nil(t, err)
22 _, err = tc.GeneratePoolL2Txs(SetPool0)
23 assert.Nil(t, err)
24}
25
26func TestCompileSetsMinimumFlow(t *testing.T) {
27 // minimum flow
28 tc := NewContext(eth.RollupConstMaxL1UserTx)
29 _, err := tc.GenerateBlocks(SetBlockchainMinimumFlow0)
30 assert.Nil(t, err)
31 _, err = tc.GeneratePoolL2Txs(SetPoolL2MinimumFlow0)
32 assert.Nil(t, err)
33}