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

chore(feat-223): adjust bux-client methods #59

Merged
merged 3 commits into from
Feb 26, 2024
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
2 changes: 0 additions & 2 deletions domain/transactions/transactions_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,10 @@ func tryRecordTransaction(userWalletClient users.UserWalletClient, draftTx users
retries := uint(3)
tx, recordErr := tryRecord(userWalletClient, draftTx, metadata, log, retries)

// unreserve utxos if failed
if recordErr != nil {
log.Error().
Str("draftTxId", draftTx.GetDraftTransactionId()).
Msgf("record transaction failed: %s", recordErr.Error())

return nil, recordErr
}

Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.21.5

require (
github.com/avast/retry-go/v4 v4.5.1
github.com/bitcoin-sv/spv-wallet-go-client v0.5.0
github.com/bitcoin-sv/spv-wallet-go-client v0.6.0
github.com/bitcoin-sv/spv-wallet/models v0.15.0
github.com/brianvoe/gofakeit/v6 v6.26.3
github.com/centrifugal/centrifuge v0.30.6
Expand Down Expand Up @@ -81,7 +81,7 @@ require (
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/arch v0.6.0 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/crypto v0.19.0 // indirect
golang.org/x/exp v0.0.0-20231226003508-02704c960a9b // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/sync v0.5.0 // indirect
Expand All @@ -103,7 +103,7 @@ require (
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/text v0.14.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ github.com/avast/retry-go/v4 v4.5.1 h1:AxIx0HGi4VZ3I02jr78j5lZ3M6x1E0Ivxa6b0pUUh
github.com/avast/retry-go/v4 v4.5.1/go.mod h1:/sipNsvNB3RRuT5iNcb6h73nw3IBmXJ/H3XrCQYSOpc=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bitcoin-sv/spv-wallet-go-client v0.5.0 h1:KHfOv1YjpR3cAOmYaYTzI6eJbVpldfdxKc742aJeJlY=
github.com/bitcoin-sv/spv-wallet-go-client v0.5.0/go.mod h1:AWfU/n+TTxdT013a7ENeqt6qzZnv2vQ/aeJi5Zr1BTw=
github.com/bitcoin-sv/spv-wallet-go-client v0.6.0 h1:X2ppJxVMlXSDkC+TZ1i9klqXXoJacVBqLMRdfeqS/ac=
github.com/bitcoin-sv/spv-wallet-go-client v0.6.0/go.mod h1:AWfU/n+TTxdT013a7ENeqt6qzZnv2vQ/aeJi5Zr1BTw=
github.com/bitcoin-sv/spv-wallet/models v0.15.0 h1:qMp5mqmfaPpstNmltZ22uAtJrqjhHd+I0h/InaWHo0w=
github.com/bitcoin-sv/spv-wallet/models v0.15.0/go.mod h1:P8vXF1mPg1Zh3xSvB9yqwuPJfOR8Tt/SAG2FYztwENI=
github.com/bitcoinschema/go-bitcoin/v2 v2.0.5 h1:Sgh5Eb746Zck/46rFDrZZEXZWyO53fMuWYhNoZa1tck=
Expand Down Expand Up @@ -251,8 +251,8 @@ golang.org/x/arch v0.6.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo=
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4=
golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
Expand Down Expand Up @@ -285,8 +285,8 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
Expand Down
5 changes: 2 additions & 3 deletions transports/spvwallet/admin_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (c *AdminWalletClient) RegisterXpub(xpriv *bip32.ExtendedKey) (string, erro
}

// Register new xpub in SPV Wallet.
err = c.client.NewXpub(
err = c.client.AdminNewXpub(
context.Background(), xpub.String(), &models.Metadata{},
)

Expand All @@ -56,8 +56,7 @@ func (c *AdminWalletClient) RegisterPaymail(alias, xpub string) (string, error)
// Get avatar url from env.
avatar := viper.GetString(config.EnvPaymailAvatar)

// Register new xpub in SPV Wallet.
err := c.client.NewPaymail(context.Background(), xpub, address, avatar, alias, &models.Metadata{})
_, err := c.client.AdminCreatePaymail(context.Background(), xpub, address, avatar, alias)

if err != nil {
c.log.Error().Msgf("Error while registering new paymail: %v", err.Error())
Expand Down
Loading