Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(SPV-1013): swaps errors to those in spverrors, bumps versions of imports #674

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 33 additions & 4 deletions regression_tests/go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

113 changes: 105 additions & 8 deletions regression_tests/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions regression_tests/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

walletclient "github.com/bitcoin-sv/spv-wallet-go-client"
"github.com/bitcoin-sv/spv-wallet-go-client/xpriv"
"github.com/bitcoin-sv/spv-wallet/engine/spverrors"
)

const (
Expand All @@ -26,8 +27,7 @@ const (
)

var (
ErrPaymailAlreadyExists = errors.New("paymail already exists")
ErrTimeout = errors.New("timeout reached")
ErrTimeout = errors.New("timeout reached")
)

func main() {
Expand Down Expand Up @@ -133,7 +133,7 @@ func handleUserCreation(paymailAlias string, config *regressionTestConfig) (*reg

// handleCreateUserError handles the error when creating a user.
func handleCreateUserError(err error, paymailAlias string, config *regressionTestConfig) (*regressionTestUser, error) {
if err.Error() == ErrPaymailAlreadyExists.Error() {
if err.Error() == spverrors.ErrPaymailAlreadyExists.Error() {
return handleExistingPaymail(paymailAlias, config)
} else {
return nil, fmt.Errorf("error creating user: %w", err)
Expand Down
3 changes: 2 additions & 1 deletion regression_tests/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (

walletclient "github.com/bitcoin-sv/spv-wallet-go-client"
"github.com/bitcoin-sv/spv-wallet-go-client/xpriv"
"github.com/bitcoin-sv/spv-wallet/engine/spverrors"
"github.com/bitcoin-sv/spv-wallet/models"
"github.com/joho/godotenv"
)
Expand Down Expand Up @@ -226,7 +227,7 @@ func createUser(paymail string, config *regressionTestConfig) (*regressionTestUs

createPaymailRes, err := adminClient.AdminCreatePaymail(ctx, user.XPub, user.Paymail, "Regression tests", "")
if err != nil {
if err.Error() == ErrPaymailAlreadyExists.Error() {
if err.Error() == spverrors.ErrPaymailAlreadyExists.Error() {
return user, err
}
return nil, err
Expand Down
Loading