"strings"
"testing"
- dbm "github.com/tendermint/tmlibs/db"
-
"github.com/vapor/blockchain/pseudohsm"
"github.com/vapor/blockchain/signers"
- "github.com/vapor/consensus"
+ "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"
)
}
func mockAccountManager(t *testing.T) *Manager {
-
- consensus.ActiveNetParams.Signer = "78673764e0ba91a4c5ba9ec0c8c23c69e3d73bf27970e05e0a977e81e13bde475264d3b177a96646bc0ce517ae7fd63504c183ab6d330dea184331a4cf5912d5"
-
dirPath, err := ioutil.TempDir(".", "")
if err != nil {
t.Fatal(err)
}
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)
}