From c13ec128bca7fe39d6b1234d82ada27d185f6b47 Mon Sep 17 00:00:00 2001 From: ac4ch Date: Tue, 14 May 2024 16:37:39 +0200 Subject: [PATCH] correcting per comments --- admin_contacts_test.go | 19 +++++++++---------- http.go | 2 +- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/admin_contacts_test.go b/admin_contacts_test.go index a202629..71ea798 100644 --- a/admin_contacts_test.go +++ b/admin_contacts_test.go @@ -8,7 +8,6 @@ import ( "testing" "github.com/bitcoin-sv/spv-wallet/models" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/bitcoin-sv/spv-wallet-go-client/fixtures" @@ -47,30 +46,30 @@ func TestAdminContactActions(t *testing.T) { t.Run("AdminGetContacts", func(t *testing.T) { contacts, err := client.AdminGetContacts(context.Background(), nil, nil, nil) - assert.NoError(t, err) - assert.Equal(t, "1", contacts[0].ID) + require.NoError(t, err) + require.Equal(t, "1", contacts[0].ID) }) t.Run("AdminUpdateContact", func(t *testing.T) { contact, err := client.AdminUpdateContact(context.Background(), "1", "Jane Doe", nil) - assert.NoError(t, err) - assert.Equal(t, "Test User", contact.FullName) + require.NoError(t, err) + require.Equal(t, "Test User", contact.FullName) }) t.Run("AdminDeleteContact", func(t *testing.T) { err := client.AdminDeleteContact(context.Background(), "1") - assert.NoError(t, err) + require.NoError(t, err) }) t.Run("AdminAcceptContact", func(t *testing.T) { contact, err := client.AdminAcceptContact(context.Background(), "1") - assert.NoError(t, err) - assert.Equal(t, models.ContactStatus("accepted"), contact.Status) + require.NoError(t, err) + require.Equal(t, models.ContactStatus("accepted"), contact.Status) }) t.Run("AdminRejectContact", func(t *testing.T) { contact, err := client.AdminRejectContact(context.Background(), "1") - assert.NoError(t, err) - assert.Equal(t, models.ContactStatus("rejected"), contact.Status) + require.NoError(t, err) + require.Equal(t, models.ContactStatus("rejected"), contact.Status) }) } diff --git a/http.go b/http.go index 3bfeedd..a9fd69f 100644 --- a/http.go +++ b/http.go @@ -541,7 +541,7 @@ func createSignatureAccessKey(privateKeyHex, bodyString string) (payload *models } publicKey := privateKey.PubKey() - // Get the xPub + // Get the AccessKey payload = new(models.AuthPayload) payload.AccessKey = hex.EncodeToString(publicKey.SerialiseCompressed())