-
Notifications
You must be signed in to change notification settings - Fork 6
/
errors.go
32 lines (24 loc) · 1.02 KB
/
errors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package libbtc
import (
"errors"
"fmt"
)
// ErrPreConditionCheckFailed indicates that the pre-condition for executing
// a transaction failed.
var ErrPreConditionCheckFailed = errors.New("pre-condition check failed")
// ErrPostConditionCheckFailed indicates that the post-condition for executing
// a transaction failed.
var ErrPostConditionCheckFailed = errors.New("post-condition check failed")
var ErrTimedOut = errors.New("timed out")
var ErrNoSpendingTransactions = fmt.Errorf("No spending transactions")
var ErrMismatchedPubKeys = fmt.Errorf("failed to fund the transaction mismatched script public keys")
func NewErrUnsupportedNetwork(network string) error {
return fmt.Errorf("unsupported network %s", network)
}
func NewErrBitcoinSubmitTx(msg string) error {
return fmt.Errorf("error while submitting Bitcoin transaction: %s", msg)
}
func NewErrInsufficientBalance(address string, required, current int64) error {
return fmt.Errorf("insufficient balance in %s "+
"required:%d current:%d", address, required, current)
}