From ac741b51d5319d81dff3f83c0e848571fd82ee25 Mon Sep 17 00:00:00 2001 From: Krzysztof Tomecki <152964795+chris-4chain@users.noreply.github.com> Date: Tue, 23 Jan 2024 10:20:23 +0100 Subject: [PATCH] fix(BUX-497): mockCapabilities --- paymail_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/paymail_test.go b/paymail_test.go index 72478bce..cc878fed 100644 --- a/paymail_test.go +++ b/paymail_test.go @@ -105,7 +105,7 @@ func TestPaymailClient(t *testing.T) { require.NotNil(t, client) } -func exampleGenericCapabilities(t *testing.T, p2pEnabled, beefEnabled bool) *paymail.CapabilitiesPayload { +func mockCapabilities(t *testing.T, p2pEnabled, beefEnabled bool) *paymail.CapabilitiesPayload { options := []server.ConfigOps{ server.WithDomain("test.com"), } @@ -131,7 +131,7 @@ func Test_hasP2P(t *testing.T) { t.Parallel() t.Run("no p2p capabilities", func(t *testing.T) { - capabilities := exampleGenericCapabilities(t, false, false) + capabilities := mockCapabilities(t, false, false) success, p2pDestinationURL, p2pSubmitTxURL, _ := hasP2P(capabilities) assert.Equal(t, false, success) assert.Equal(t, "", p2pDestinationURL) @@ -139,7 +139,7 @@ func Test_hasP2P(t *testing.T) { }) t.Run("valid p2p capabilities", func(t *testing.T) { - capabilities := exampleGenericCapabilities(t, true, false) + capabilities := mockCapabilities(t, true, false) success, p2pDestinationURL, p2pSubmitTxURL, _ := hasP2P(capabilities) assert.Equal(t, true, success) @@ -153,7 +153,7 @@ func Test_hasP2P_beefCapabilities(t *testing.T) { t.Parallel() t.Run("no beef capabilities", func(t *testing.T) { - capabilities := exampleGenericCapabilities(t, false, false) + capabilities := mockCapabilities(t, false, false) success, p2pDestinationURL, p2pSubmitTxURL, format := hasP2P(capabilities) assert.Equal(t, false, success) assert.Equal(t, BasicPaymailPayloadFormat, format) @@ -162,7 +162,7 @@ func Test_hasP2P_beefCapabilities(t *testing.T) { }) t.Run("valid beef capabilities", func(t *testing.T) { - capabilities := exampleGenericCapabilities(t, true, true) + capabilities := mockCapabilities(t, true, true) success, p2pDestinationURL, p2pSubmitTxURL, format := hasP2P(capabilities) assert.Equal(t, true, success) assert.Equal(t, BeefPaymailPayloadFormat, format)