From b2cf4f79be97c84faacea2d6528aa77199f2c3fc Mon Sep 17 00:00:00 2001 From: chris-4chain <152964795+chris-4chain@users.noreply.github.com> Date: Fri, 23 Aug 2024 13:35:48 +0200 Subject: [PATCH] chore(SPV-000): update to spv-wallet's version beta.23 (#263) --- admin_contacts_test.go | 9 +++++---- contacts_test.go | 3 ++- examples/create_transaction/create_transaction.go | 2 +- examples/go.mod | 2 +- examples/go.sum | 2 ++ fixtures/fixtures.go | 3 ++- go.mod | 2 +- go.sum | 2 ++ 8 files changed, 16 insertions(+), 9 deletions(-) diff --git a/admin_contacts_test.go b/admin_contacts_test.go index 8ddeff1..5b2112e 100644 --- a/admin_contacts_test.go +++ b/admin_contacts_test.go @@ -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" ) @@ -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) @@ -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) }) } diff --git a/contacts_test.go b/contacts_test.go index 0c103e1..dc105f6 100644 --- a/contacts_test.go +++ b/contacts_test.go @@ -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" ) @@ -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 { diff --git a/examples/create_transaction/create_transaction.go b/examples/create_transaction/create_transaction.go index b929d40..5aa918b 100644 --- a/examples/create_transaction/create_transaction.go +++ b/examples/create_transaction/create_transaction.go @@ -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"} diff --git a/examples/go.mod b/examples/go.mod index 51849c4..2da659d 100644 --- a/examples/go.mod +++ b/examples/go.mod @@ -6,7 +6,7 @@ replace github.com/bitcoin-sv/spv-wallet-go-client => ../ require ( github.com/bitcoin-sv/spv-wallet-go-client v0.0.0-00010101000000-000000000000 - github.com/bitcoin-sv/spv-wallet/models v1.0.0-beta.22 + github.com/bitcoin-sv/spv-wallet/models v1.0.0-beta.23 ) require ( diff --git a/examples/go.sum b/examples/go.sum index b77e48d..6482c5a 100644 --- a/examples/go.sum +++ b/examples/go.sum @@ -1,5 +1,7 @@ github.com/bitcoin-sv/spv-wallet/models v1.0.0-beta.22 h1:iMVrWwiUBNLLZFhulUHZtwM1aW4usnguP4XQbtnK9Ws= github.com/bitcoin-sv/spv-wallet/models v1.0.0-beta.22/go.mod h1:PEJdH9ZWKOiKHyOZkzYsRbKuZjzlRaEJy3GsM75Icdo= +github.com/bitcoin-sv/spv-wallet/models v1.0.0-beta.23 h1:rM4w5H9INUQlUbSGQKN24eKKglvnk3yXuNVf1tahi0A= +github.com/bitcoin-sv/spv-wallet/models v1.0.0-beta.23/go.mod h1:PEJdH9ZWKOiKHyOZkzYsRbKuZjzlRaEJy3GsM75Icdo= github.com/bitcoinschema/go-bitcoin/v2 v2.0.5 h1:Sgh5Eb746Zck/46rFDrZZEXZWyO53fMuWYhNoZa1tck= github.com/bitcoinschema/go-bitcoin/v2 v2.0.5/go.mod h1:JjO1ivfZv6vhK0uAXzyH08AAHlzNMAfnyK1Fiv9r4ZA= github.com/bitcoinsv/bsvd v0.0.0-20190609155523-4c29707f7173 h1:2yTIV9u7H0BhRDGXH5xrAwAz7XibWJtX2dNezMeNsUo= diff --git a/fixtures/fixtures.go b/fixtures/fixtures.go index ae6b8aa..12990b5 100644 --- a/fixtures/fixtures.go +++ b/fixtures/fixtures.go @@ -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 ( @@ -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, } diff --git a/go.mod b/go.mod index 9abe649..103d426 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/bitcoin-sv/spv-wallet-go-client go 1.22.5 require ( - github.com/bitcoin-sv/spv-wallet/models v1.0.0-beta.22 + github.com/bitcoin-sv/spv-wallet/models v1.0.0-beta.23 github.com/bitcoinschema/go-bitcoin/v2 v2.0.5 github.com/libsv/go-bk v0.1.6 github.com/libsv/go-bt/v2 v2.2.5 diff --git a/go.sum b/go.sum index a31f53a..11a17c0 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,7 @@ github.com/bitcoin-sv/spv-wallet/models v1.0.0-beta.22 h1:iMVrWwiUBNLLZFhulUHZtwM1aW4usnguP4XQbtnK9Ws= github.com/bitcoin-sv/spv-wallet/models v1.0.0-beta.22/go.mod h1:PEJdH9ZWKOiKHyOZkzYsRbKuZjzlRaEJy3GsM75Icdo= +github.com/bitcoin-sv/spv-wallet/models v1.0.0-beta.23 h1:rM4w5H9INUQlUbSGQKN24eKKglvnk3yXuNVf1tahi0A= +github.com/bitcoin-sv/spv-wallet/models v1.0.0-beta.23/go.mod h1:PEJdH9ZWKOiKHyOZkzYsRbKuZjzlRaEJy3GsM75Icdo= github.com/bitcoinschema/go-bitcoin/v2 v2.0.5 h1:Sgh5Eb746Zck/46rFDrZZEXZWyO53fMuWYhNoZa1tck= github.com/bitcoinschema/go-bitcoin/v2 v2.0.5/go.mod h1:JjO1ivfZv6vhK0uAXzyH08AAHlzNMAfnyK1Fiv9r4ZA= github.com/bitcoinsv/bsvd v0.0.0-20190609155523-4c29707f7173 h1:2yTIV9u7H0BhRDGXH5xrAwAz7XibWJtX2dNezMeNsUo=