• R/O
  • HTTP
  • SSH
  • HTTPS

vapor: Commit

Golang implemented sidechain for Bytom


Commit MetaInfo

Revision6cfe984111597c4e9ec9e15423b295303bc536e7 (tree)
Time2019-07-17 19:58:47
AuthorChengcheng Zhang <943420582@qq.c...>
CommiterChengcheng Zhang

Log Message

update

Change Summary

Incremental Difference

--- a/database/account_store.go
+++ b/database/account_store.go
@@ -314,7 +314,7 @@ func (store *AccountStore) ListControlPrograms() ([]*acc.CtrlProgram, error) {
314314 return cps, nil
315315 }
316316
317-// ListUTXOs get utxos by accountID
317+// ListUTXOs list all utxos includling
318318 func (store *AccountStore) ListUTXOs() ([]*acc.UTXO, error) {
319319 utxoIter := store.db.IteratorPrefix(UTXOPrefix)
320320 defer utxoIter.Release()
--- a/database/account_store_test.go
+++ b/database/account_store_test.go
@@ -253,7 +253,7 @@ func TestDeleteStandardUTXO(t *testing.T) {
253253 },
254254 }
255255
256- for _, c := range cases {
256+ for i, c := range cases {
257257 testDB := dbm.NewDB("testdb", "leveldb", "temp")
258258 accountStore := NewAccountStore(testDB)
259259 as := accountStore.InitBatch()
@@ -270,11 +270,17 @@ func TestDeleteStandardUTXO(t *testing.T) {
270270 t.Fatal(err)
271271 }
272272
273+ gotUTXOs, err := as.ListUTXOs()
274+ if err != nil {
275+ t.Fatal(err)
276+ }
277+
278+ sort.Sort(SortUTXOs(gotUTXOs))
279+ sort.Sort(SortUTXOs(c.want))
280+
273281 // get utxo by outputID
274- for _, utxo := range c.want {
275- if _, err := as.GetUTXO(utxo.OutputID); err != nil {
276- t.Fatal(err)
277- }
282+ if !testutil.DeepEqual(gotUTXOs, c.want) {
283+ t.Errorf("case %v: got Delete Standard UTXOs, got: %v, want: %v.", i, gotUTXOs, c.want)
278284 }
279285
280286 testDB.Close()
Show on old repository browser