OSDN Git Service

fix test
authorChengcheng Zhang <943420582@qq.com>
Tue, 25 Jun 2019 15:36:10 +0000 (23:36 +0800)
committerChengcheng Zhang <943420582@qq.com>
Tue, 25 Jun 2019 15:36:10 +0000 (23:36 +0800)
account/accounts.go
account/utxo_keeper_test.go
database/account_store.go

index 42c04b2..c01592b 100644 (file)
@@ -299,7 +299,7 @@ func (m *Manager) deleteAccountUtxos(accountID string) error {
                        return err
                }
                if accountID == utxo.AccountID {
-                       m.store.DeleteUTXO(utxo.OutputID)
+                       m.store.DeleteStandardUTXO(utxo.OutputID)
                }
        }
 
index 55f6559..abd3209 100644 (file)
@@ -952,7 +952,7 @@ func TestFindUtxos(t *testing.T) {
                        if err != nil {
                                t.Error(err)
                        }
-                       testDB.Set(database.StandardUTXOKey(u.OutputID), data)
+                       c.uk.store.SetStandardUTXO(u.OutputID, data)
                }
 
                gotUtxos, immatureAmount := c.uk.findUtxos("testAccount", &bc.AssetID{}, c.useUnconfirmed, c.vote)
@@ -964,7 +964,7 @@ func TestFindUtxos(t *testing.T) {
                }
 
                for _, u := range c.dbUtxos {
-                       testDB.Delete(database.StandardUTXOKey(u.OutputID))
+                       c.uk.store.DeleteStandardUTXO(u.OutputID)
                }
        }
 }
@@ -1069,7 +1069,7 @@ func TestFindUtxo(t *testing.T) {
                }
 
                for _, u := range c.dbUtxos {
-                       testDB.Delete(database.StandardUTXOKey(u.OutputID))
+                       c.uk.store.DeleteStandardUTXO(u.OutputID)
                }
        }
 }
index 5c7e21e..cb010a8 100644 (file)
@@ -24,9 +24,8 @@ type AccountStorer interface {
        DeleteBip44ContractIndex(string)
        DeleteContractIndex(string)
        GetContractIndex(string) []byte
-       // DeleteAccountUTXOs(string) error
        GetAccountUTXOs(string) [][]byte
-       DeleteUTXO(bc.Hash)
+       DeleteStandardUTXO(bc.Hash)
        GetCoinbaseArbitrary() []byte
        SetCoinbaseArbitrary([]byte)
        GetMiningAddress() []byte
@@ -190,8 +189,8 @@ func (store *AccountStore) GetAccountUTXOs(accountID string) [][]byte {
        return utxos
 }
 
-// DeleteUTXO delete utxo by outpu id
-func (store *AccountStore) DeleteUTXO(outputID bc.Hash) {
+// DeleteStandardUTXO delete utxo by outpu id
+func (store *AccountStore) DeleteStandardUTXO(outputID bc.Hash) {
        if store.batch == nil {
                store.accountDB.Delete(StandardUTXOKey(outputID))
        } else {