-
Notifications
You must be signed in to change notification settings - Fork 1
/
mock_test.go
58 lines (43 loc) · 1.95 KB
/
mock_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package server
import (
"context"
"github.com/bitcoin-sv/go-paymail"
"github.com/bitcoin-sv/go-paymail/spv"
)
// Mock implementation of a service provider
type mockServiceProvider struct{}
// GetPaymailByAlias is a demo implementation of this interface
func (m *mockServiceProvider) GetPaymailByAlias(_ context.Context, _, _ string,
_ *RequestMetadata) (*paymail.AddressInformation, error) {
// Get the data from the demo database
return nil, nil
}
// CreateAddressResolutionResponse is a demo implementation of this interface
func (m *mockServiceProvider) CreateAddressResolutionResponse(_ context.Context, _, _ string,
_ bool, _ *RequestMetadata) (*paymail.ResolutionPayload, error) {
// Generate a new destination / output for the basic address resolution
return nil, nil
}
// CreateP2PDestinationResponse is a demo implementation of this interface
func (m *mockServiceProvider) CreateP2PDestinationResponse(_ context.Context, _, _ string,
_ uint64, _ *RequestMetadata) (*paymail.PaymentDestinationPayload, error) {
// Generate a new destination for the p2p request
return nil, nil
}
// RecordTransaction is a demo implementation of this interface
func (m *mockServiceProvider) RecordTransaction(_ context.Context,
_ *paymail.P2PTransaction, _ *RequestMetadata) (*paymail.P2PTransactionPayload, error) {
// Record the tx into your datastore layer
return nil, nil
}
// VerifyMerkleRoots is a mock implementation of this interface
func (m *mockServiceProvider) VerifyMerkleRoots(_ context.Context, _ []*spv.MerkleRootConfirmationRequestItem) error {
// Verify the merkle roots
return nil
}
func (m *mockServiceProvider) AddContact(ctx context.Context, requesterPaymail string, contact *paymail.PikeContactRequestPayload) error {
return nil
}
func (m *mockServiceProvider) CreatePikeOutputResponse(ctx context.Context, alias, domain, senderPubKey string, satoshis uint64, metaData *RequestMetadata) (*paymail.PikePaymentOutputsResponse, error) {
return nil, nil
}