Skip to content

Commit

Permalink
testutil, wallet: fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
n8maninger committed Jan 13, 2024
1 parent 73f02d7 commit 441f570
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions testutil/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type EphemeralWalletStore struct {
transactions []wallet.Transaction
}

// ProcessChainRevertUpdate implements chain.Subscriber
func (es *EphemeralWalletStore) ProcessChainRevertUpdate(cru *chain.RevertUpdate) error {
es.mu.Lock()
defer es.mu.Unlock()
Expand Down Expand Up @@ -65,6 +66,7 @@ func (es *EphemeralWalletStore) ProcessChainRevertUpdate(cru *chain.RevertUpdate
return nil
}

// ProcessChainApplyUpdate implements chain.Subscriber
func (es *EphemeralWalletStore) ProcessChainApplyUpdate(cau *chain.ApplyUpdate, commit bool) error {
es.mu.Lock()
defer es.mu.Unlock()
Expand Down Expand Up @@ -190,6 +192,7 @@ func (es *EphemeralWalletStore) ProcessChainApplyUpdate(cau *chain.ApplyUpdate,
return nil
}

// Transactions returns the wallet's transactions.
func (es *EphemeralWalletStore) Transactions(limit, offset int) ([]wallet.Transaction, error) {
es.mu.Lock()
defer es.mu.Unlock()
Expand All @@ -205,12 +208,14 @@ func (es *EphemeralWalletStore) Transactions(limit, offset int) ([]wallet.Transa
return es.transactions[offset:end], nil
}

// TransactionCount returns the number of transactions in the wallet.
func (es *EphemeralWalletStore) TransactionCount() (uint64, error) {
es.mu.Lock()
defer es.mu.Unlock()
return uint64(len(es.transactions)), nil
}

// UnspentSiacoinElements returns the wallet's unspent siacoin outputs.
func (es *EphemeralWalletStore) UnspentSiacoinElements() (utxos []types.SiacoinElement, _ error) {
es.mu.Lock()
defer es.mu.Unlock()
Expand Down
2 changes: 1 addition & 1 deletion wallet/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ func (sw *SingleAddressWallet) SignTransaction(cs consensus.State, txn *types.Tr
return nil
}

// ScanHeight returns the block height the wallet has scanned to.
// Tip returns the block height the wallet has scanned to.
func (sw *SingleAddressWallet) Tip() types.ChainIndex {
sw.mu.Lock()
defer sw.mu.Unlock()
Expand Down

0 comments on commit 441f570

Please sign in to comment.