You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
664 B

  1. package batchbuilder
  2. import (
  3. "io/ioutil"
  4. "os"
  5. "testing"
  6. "github.com/hermeznetwork/hermez-node/db/statedb"
  7. "github.com/stretchr/testify/assert"
  8. "github.com/stretchr/testify/require"
  9. )
  10. func TestBatchBuilder(t *testing.T) {
  11. dir, err := ioutil.TempDir("", "tmpdb")
  12. require.Nil(t, err)
  13. defer assert.Nil(t, os.RemoveAll(dir))
  14. synchDB, err := statedb.NewStateDB(statedb.Config{Path: dir, Keep: 128,
  15. Type: statedb.TypeBatchBuilder, NLevels: 0})
  16. assert.Nil(t, err)
  17. bbDir, err := ioutil.TempDir("", "tmpBatchBuilderDB")
  18. require.Nil(t, err)
  19. defer assert.Nil(t, os.RemoveAll(bbDir))
  20. _, err = NewBatchBuilder(bbDir, synchDB, 0, 32)
  21. assert.Nil(t, err)
  22. }