Skip to content

Commit

Permalink
chore(SPV-000): update to spv-wallet's version beta.23 (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-4chain authored Aug 23, 2024
1 parent 46bbd35 commit b2cf4f7
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 9 deletions.
9 changes: 5 additions & 4 deletions admin_contacts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"github.com/bitcoin-sv/spv-wallet-go-client/fixtures"
"github.com/bitcoin-sv/spv-wallet/models"
responsemodels "github.com/bitcoin-sv/spv-wallet/models/response"
"github.com/stretchr/testify/require"
)

Expand All @@ -30,11 +31,11 @@ func TestAdminContactActions(t *testing.T) {
w.WriteHeader(http.StatusOK)
case r.URL.Path == "/v1/admin/contact/accepted/1" && r.Method == http.MethodPatch:
contact := fixtures.Contact
contact.Status = "accepted"
contact.Status = responsemodels.ContactNotConfirmed
json.NewEncoder(w).Encode(contact)
case r.URL.Path == "/v1/admin/contact/rejected/1" && r.Method == http.MethodPatch:
contact := fixtures.Contact
contact.Status = "rejected"
contact.Status = responsemodels.ContactRejected
json.NewEncoder(w).Encode(contact)
default:
w.WriteHeader(http.StatusNotFound)
Expand Down Expand Up @@ -65,12 +66,12 @@ func TestAdminContactActions(t *testing.T) {
t.Run("AdminAcceptContact", func(t *testing.T) {
contact, err := client.AdminAcceptContact(context.Background(), "1")
require.NoError(t, err)
require.Equal(t, models.ContactStatus("accepted"), contact.Status)
require.Equal(t, responsemodels.ContactNotConfirmed, contact.Status)
})

t.Run("AdminRejectContact", func(t *testing.T) {
contact, err := client.AdminRejectContact(context.Background(), "1")
require.NoError(t, err)
require.Equal(t, models.ContactStatus("rejected"), contact.Status)
require.Equal(t, responsemodels.ContactRejected, contact.Status)
})
}
3 changes: 2 additions & 1 deletion contacts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

"github.com/bitcoin-sv/spv-wallet-go-client/fixtures"
"github.com/bitcoin-sv/spv-wallet/models"
responsemodels "github.com/bitcoin-sv/spv-wallet/models/response"
"github.com/stretchr/testify/require"
)

Expand All @@ -24,7 +25,7 @@ func TestContactActionsRouting(t *testing.T) {
}
case r.URL.Path == "/v1/contact/accepted/":
if r.Method == http.MethodPost {
json.NewEncoder(w).Encode(map[string]string{"result": "accepted"})
json.NewEncoder(w).Encode(map[string]string{"result": string(responsemodels.ContactNotConfirmed)})
}
case r.URL.Path == "/v1/contact/search":
if r.Method == http.MethodPost {
Expand Down
2 changes: 1 addition & 1 deletion examples/create_transaction/create_transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func main() {
client := walletclient.NewWithXPriv(server, examples.ExampleXPriv)
ctx := context.Background()

recipient := walletclient.Recipients{To: "test-multiple1@pawel.test.4chain.space", Satoshis: 1}
recipient := walletclient.Recipients{To: "alice@example.com", Satoshis: 1}
recipients := []*walletclient.Recipients{&recipient}
metadata := map[string]any{"some_metadata": "example"}

Expand Down
2 changes: 1 addition & 1 deletion examples/go.mod

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

2 changes: 2 additions & 0 deletions examples/go.sum

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

3 changes: 2 additions & 1 deletion fixtures/fixtures.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/bitcoin-sv/spv-wallet/models"
"github.com/bitcoin-sv/spv-wallet/models/common"
responsemodels "github.com/bitcoin-sv/spv-wallet/models/response"
)

var (
Expand Down Expand Up @@ -212,5 +213,5 @@ var Contact = &models.Contact{
FullName: "Test User",
Paymail: "test@spv-wallet.com",
PubKey: "xpub661MyMwAqRbcGpZVrSHU...",
Status: models.ContactStatus("unconfirmed"),
Status: responsemodels.ContactNotConfirmed,
}
2 changes: 1 addition & 1 deletion go.mod

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

2 changes: 2 additions & 0 deletions go.sum

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

0 comments on commit b2cf4f7

Please sign in to comment.