X-Git-Url: http://git.osdn.net/view?p=bytom%2Fvapor.git;a=blobdiff_plain;f=wallet%2Funconfirmed_test.go;h=590484556246ea626e8b80a9036e57146a6139f4;hp=60ece6041b21dc6fc04481e84645554990c07b20;hb=refs%2Fheads%2Fblock_fetcher;hpb=089cb9074ed375e28850d2ff8b5e91164a04046d diff --git a/wallet/unconfirmed_test.go b/wallet/unconfirmed_test.go index 60ece604..59048455 100644 --- a/wallet/unconfirmed_test.go +++ b/wallet/unconfirmed_test.go @@ -27,9 +27,11 @@ func TestWalletUnconfirmedTxs(t *testing.T) { defer os.RemoveAll(dirPath) testDB := dbm.NewDB("testdb", "leveldb", "temp") + testStore := NewMockWalletStore(testDB) defer os.RemoveAll("temp") - accountManager := account.NewManager(testDB, nil) + accountStore := NewMockAccountStore(testDB) + accountManager := account.NewManager(accountStore, nil) hsm, err := pseudohsm.New(dirPath) if err != nil { t.Fatal(err) @@ -56,7 +58,7 @@ func TestWalletUnconfirmedTxs(t *testing.T) { asset := bc.AssetID{V0: 5} dispatcher := event.NewDispatcher() - w := mockWallet(testDB, accountManager, reg, nil, dispatcher, false) + w := mockWallet(testStore, accountManager, reg, nil, dispatcher, false) utxos := []*account.UTXO{} btmUtxo := mockUTXO(controlProg, consensus.BTMAssetID) utxos = append(utxos, btmUtxo) @@ -126,7 +128,7 @@ func AnnotatedTxs(txs []*types.Tx, w *Wallet) []*query.AnnotatedTx { annotatedTxs = append(annotatedTxs, annotatedTx) } - annotateTxsAccount(annotatedTxs, w.DB) + w.annotateTxsAccount(annotatedTxs) annotateTxsAsset(w, annotatedTxs) return annotatedTxs