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
utxoEntry: storage.NewUtxoEntry(storage.CrosschainUTXOType, 0, false),
exist: false,
},
+ {
+ hash: bc.Hash{V0: 6},
+ utxoEntry: storage.NewUtxoEntry(storage.VoteUTXOType, 0, true),
+ exist: false,
+ },
+ {
+ hash: bc.Hash{V0: 7},
+ utxoEntry: storage.NewUtxoEntry(storage.VoteUTXOType, 0, false),
+ exist: true,
+ },
}
view := state.NewUtxoViewpoint()