Skip to content

Commit

Permalink
correcting per comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ac4ch committed May 14, 2024
1 parent cc5db48 commit c13ec12
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
19 changes: 9 additions & 10 deletions admin_contacts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
})
}
2 changes: 1 addition & 1 deletion http.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down

0 comments on commit c13ec12

Please sign in to comment.