From: Chengcheng Zhang <943420582@qq.com> Date: Fri, 28 Jun 2019 07:41:39 +0000 (+0800) Subject: rename GetGlobalTransactionIndex X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=72cbe179ab373a362cc1f9e2088aaee70fab7c06;hp=3d18c34a2b502771af36e6e40731adbf7977a48a;p=bytom%2Fvapor.git rename GetGlobalTransactionIndex --- diff --git a/database/wallet_store.go b/database/wallet_store.go index 57e07dce..3d3c3bb0 100644 --- a/database/wallet_store.go +++ b/database/wallet_store.go @@ -332,8 +332,8 @@ func (store *WalletStore) GetTransaction(txID string) (*query.AnnotatedTx, error return tx, nil } -// GetGlobalTransaction get global tx by txID -func (store *WalletStore) GetGlobalTransaction(txID string) []byte { +// GetGlobalTransactionIndex get global tx by txID +func (store *WalletStore) GetGlobalTransactionIndex(txID string) []byte { return store.walletDB.Get(calcGlobalTxIndexKey(txID)) } diff --git a/wallet/indexer.go b/wallet/indexer.go index 6274179b..4982e647 100644 --- a/wallet/indexer.go +++ b/wallet/indexer.go @@ -153,7 +153,7 @@ func (w *Wallet) getAccountTxByTxID(txID string) (*query.AnnotatedTx, error) { } func (w *Wallet) getGlobalTxByTxID(txID string) (*query.AnnotatedTx, error) { - globalTxIdx := w.store.GetGlobalTransaction(txID) + globalTxIdx := w.store.GetGlobalTransactionIndex(txID) if globalTxIdx == nil { return nil, fmt.Errorf("No transaction(tx_id=%s) ", txID) } diff --git a/wallet/store.go b/wallet/store.go index 0b6f9136..e654e73e 100644 --- a/wallet/store.go +++ b/wallet/store.go @@ -22,7 +22,7 @@ type WalletStorer interface { SetGlobalTransactionIndex(string, *bc.Hash, uint64) GetStandardUTXO(bc.Hash) (*acc.UTXO, error) GetTransaction(string) (*query.AnnotatedTx, error) - GetGlobalTransaction(string) []byte + GetGlobalTransactionIndex(string) []byte GetTransactions() ([]*query.AnnotatedTx, error) GetUnconfirmedTransactions() ([]*query.AnnotatedTx, error) GetUnconfirmedTransaction(string) []byte diff --git a/wallet/wallet_test.go b/wallet/wallet_test.go index c199d9e9..599a4fc4 100644 --- a/wallet/wallet_test.go +++ b/wallet/wallet_test.go @@ -199,7 +199,7 @@ func TestWalletUpdate(t *testing.T) { } for position, tx := range block.Transactions { - get := w.store.GetGlobalTransaction(tx.ID.String()) + get := w.store.GetGlobalTransactionIndex(tx.ID.String()) bh := block.BlockHeader.Hash() expect := database.CalcGlobalTxIndex(&bh, uint64(position)) if !reflect.DeepEqual(get, expect) {