Skip to content

Commit

Permalink
Buck review updates
Browse files Browse the repository at this point in the history
  • Loading branch information
martonp committed Dec 1, 2023
1 parent 996b2a6 commit 5316458
Show file tree
Hide file tree
Showing 29 changed files with 1,651 additions and 204 deletions.
4 changes: 2 additions & 2 deletions client/asset/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ type Wallet interface {
TransactionConfirmations(ctx context.Context, txID string) (confs uint32, err error)
// Send sends the exact value to the specified address. This is different
// from Withdraw, which subtracts the tx fees from the amount sent.
Send(address string, value, feeRate uint64) (coin Coin, err error)
Send(address string, value, feeRate uint64) (Coin, error)
// EstimateRegistrationTxFee returns an estimate for the tx fee needed to
// pay the registration fee using the provided feeRate.
EstimateRegistrationTxFee(feeRate uint64) uint64
Expand Down Expand Up @@ -644,7 +644,7 @@ type Recoverer interface {
type Withdrawer interface {
// Withdraw withdraws funds to the specified address. Fees are subtracted
// from the value.
Withdraw(address string, value, feeRate uint64) (coin Coin, err error)
Withdraw(address string, value, feeRate uint64) (Coin, error)
}

// Sweeper is a wallet that can clear the entire balance of the wallet/account
Expand Down
11 changes: 10 additions & 1 deletion client/asset/zec/zec.go
Original file line number Diff line number Diff line change
Expand Up @@ -2126,7 +2126,16 @@ func (w *zecWallet) Send(address string, value, feeRate uint64) (asset.Coin, err
// TransactionConfirmations gets the number of confirmations for the specified
// transaction.
func (w *zecWallet) TransactionConfirmations(ctx context.Context, txID string) (confs uint32, err error) {
return
txHash, err := chainhash.NewHashFromStr(txID)
if err != nil {
return 0, fmt.Errorf("error decoding txid %q: %w", txID, err)
}
res, err := getWalletTransaction(w, txHash)
if err != nil {
return 0, err
}

return uint32(res.Confirmations), nil
}

// send the value to the address, with the given fee rate. If subtract is true,
Expand Down
Loading

0 comments on commit 5316458

Please sign in to comment.