OSDN Git Service

add error code for veto (#219)
[bytom/vapor.git] / account / accounts_test.go
index 62e07be..cd57219 100644 (file)
@@ -7,13 +7,14 @@ import (
        "strings"
        "testing"
 
-       dbm "github.com/tendermint/tmlibs/db"
-
        "github.com/vapor/blockchain/pseudohsm"
        "github.com/vapor/blockchain/signers"
+       "github.com/vapor/config"
        "github.com/vapor/crypto/ed25519/chainkd"
-       "github.com/vapor/database/leveldb"
+       "github.com/vapor/database"
+       dbm "github.com/vapor/database/leveldb"
        "github.com/vapor/errors"
+       "github.com/vapor/event"
        "github.com/vapor/protocol"
        "github.com/vapor/testutil"
 )
@@ -211,12 +212,12 @@ func mockAccountManager(t *testing.T) *Manager {
        }
        defer os.RemoveAll(dirPath)
 
-       testDB := dbm.NewDB("testdb", "memdb", "temp")
-       defer os.RemoveAll("temp")
-
-       store := leveldb.NewStore(testDB)
-       txPool := protocol.NewTxPool(store)
-       chain, err := protocol.NewChain(store, txPool)
+       testDB := dbm.NewDB("testdb", "memdb", dirPath)
+       dispatcher := event.NewDispatcher()
+       store := database.NewStore(testDB)
+       txPool := protocol.NewTxPool(store, dispatcher)
+       config.CommonConfig = config.DefaultConfig()
+       chain, err := protocol.NewChain(store, txPool, dispatcher)
        if err != nil {
                t.Fatal(err)
        }