OSDN Git Service

edit code while reviewing the code (#255)
[bytom/vapor.git] / database / utxo_view_test.go
index a59f07e..0d6bc82 100644 (file)
@@ -14,7 +14,10 @@ import (
 func TestSaveUtxoView(t *testing.T) {
        testDB := dbm.NewDB("testdb", "leveldb", "temp")
        batch := testDB.NewBatch()
-       defer os.RemoveAll("temp")
+       defer func() {
+               testDB.Close()
+               os.RemoveAll("temp")
+       }()
 
        cases := []struct {
                hash      bc.Hash
@@ -51,6 +54,16 @@ func TestSaveUtxoView(t *testing.T) {
                        utxoEntry: storage.NewUtxoEntry(storage.CrosschainUTXOType, 0, false),
                        exist:     false,
                },
+               {
+                       hash:      bc.Hash{V0: 6},
+                       utxoEntry: storage.NewUtxoEntry(storage.VoteUTXOType, 0, true),
+                       exist:     true,
+               },
+               {
+                       hash:      bc.Hash{V0: 7},
+                       utxoEntry: storage.NewUtxoEntry(storage.VoteUTXOType, 0, false),
+                       exist:     true,
+               },
        }
 
        view := state.NewUtxoViewpoint()