fix exec test
@@ -76,19 +76,17 @@ func TestTrade_Exec_SellLimit(t *testing.T) {
"hash",
}
- stateDB, _ := dbm.NewGoMemDB("1", "2", 100)
+ _, ldb, kvdb := util.CreateTestDB()
accB := account.NewCoinsAccount()
- accB.SetDB(stateDB)
+ accB.SetDB(kvdb)
accB.SaveExecAccount(address.ExecAddress("trade"), &accountB)
- accA, _ := account.NewAccountDB(AssetExecToken, Symbol, stateDB)
+ accA, _ := account.NewAccountDB(AssetExecToken, Symbol, kvdb)
accA.SaveExecAccount(address.ExecAddress("trade"), &accountA)
- _, ldb, kvdb := util.CreateTestDB()
-
driver := newTrade()
driver.SetEnv(env.blockHeight, env.blockTime, env.difficulty)
- driver.SetStateDB(stateDB)
+ driver.SetStateDB(kvdb)
driver.SetLocalDB(kvdb)
sell := &pty.TradeSellTx{
@@ -134,7 +132,6 @@ func TestTrade_Exec_SellLimit(t *testing.T) {
}
_, err = driver.ExecLocal(tx, receiptDataSell, env.index)
assert.Nil(t, err)
- kvdb.Commit()
// test buy market
buy := &pty.TradeBuyTx{
