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

Feat (spv-827) switch contacts capability from brfc temporary pike to brfc pike.invite #97

9 changes: 3 additions & 6 deletions brfc_definintions.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,9 @@ const (
BRFCSFPBuildAction = "189e32d93d28" // more info: https://docs.moneybutton.com/docs/sfp/paymail-09-sfp-build.html
BRFCVerifyPublicKeyOwner = "a9f510c16bde" // more info: http://bsvalias.org/05-verify-public-key-owner.html
BRFCBeefTransaction = "5c55a7fdb7bb" // more info: https://bsv.brc.dev/payments/0070

BRFCTemporaryPike = "8c4ed5ef8ace" // Temporary BRFC ID for PIKE

BRFCPike = "935478af7bf2"
BRFCPikeInvite = "invite"
BRFCPikeOutputs = "outputs"
BRFCPike = "8c4ed5ef8ace"
BRFCPikeInvite = "invite"
BRFCPikeOutputs = "outputs"
)

// BRFCKnownSpecifications is a running list of all known BRFC specifications
Expand Down
2 changes: 1 addition & 1 deletion capabilities_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ func mockCapabilitiesWithPIKE(statusCode int) {
"6745385c3fc0": false,
"pki": "https://examples.com/{alias}@{domain.tld}/id",
"paymentDestination": "https://examples.com/{alias}@{domain.tld}/payment-destination",
"935478af7bf2": {
"8c4ed5ef8ace": {
"invite": "https://examples.com/v1/bsvalias/contact/invite/{alias}@{domain.tld}",
"outputs": "https://examples.com/v1/bsvalias/pike/outputs/{alias}@{domain.tld}"
}
Expand Down
12 changes: 2 additions & 10 deletions server/capabilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package server

import (
"fmt"
"github.com/gin-gonic/gin"
"net/http"
"strings"

"github.com/gin-gonic/gin"

"github.com/bitcoin-sv/go-paymail"
)

Expand Down Expand Up @@ -81,15 +82,6 @@ func (c *Configuration) SetBeefCapabilities() {
}

func (c *Configuration) SetPikeContactCapabilities() {
_addCapabilities(c.callableCapabilities,
CallableCapabilitiesMap{
paymail.BRFCTemporaryPike: CallableCapability{
Path: fmt.Sprintf("/pike/%s", PaymailAddressTemplate),
Method: http.MethodPost,
Handler: c.pikeNewContact,
},
},
)
_addNestedCapabilities(c.nestedCapabilities,
NestedCapabilitiesMap{
paymail.BRFCPike: CallableCapabilitiesMap{
Expand Down
7 changes: 4 additions & 3 deletions server/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import (
"testing"
"time"

"github.com/bitcoin-sv/go-paymail"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/bitcoin-sv/go-paymail"
)

// testConfig loads a basic test configuration
Expand Down Expand Up @@ -490,7 +491,7 @@ func TestNewConfig(t *testing.T) {
)
require.NoError(t, err)
require.NotNil(t, c)
assert.Equal(t, 7, len(c.callableCapabilities))
assert.Equal(t, 6, len(c.callableCapabilities))
assert.Equal(t, 1, len(c.nestedCapabilities))
})

Expand Down Expand Up @@ -526,7 +527,7 @@ func TestNewConfig(t *testing.T) {
)
require.NoError(t, err)
require.NotNil(t, c)
assert.Equal(t, 7, len(c.callableCapabilities))
assert.Equal(t, 6, len(c.callableCapabilities))
assert.Equal(t, 1, len(c.nestedCapabilities))
})

Expand Down
Loading