This repository was archived by the owner on Apr 2, 2024. It is now read-only.
generated from mrz1836/go-template
-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathpaymail_mocks_test.go
51 lines (38 loc) · 1.65 KB
/
paymail_mocks_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
package bux
import (
"context"
"github.com/bitcoin-sv/go-paymail"
"github.com/bitcoin-sv/go-paymail/server"
"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,
_ *server.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, _ *server.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, _ *server.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, _ *server.RequestMetadata) (*paymail.P2PTransactionPayload, error) {
// Record the tx into your datastore layer
return nil, nil
}
// RecordTransaction is a demo implementation of this interface
func (m *mockServiceProvider) VerifyMerkleRoots(_ context.Context, _ []*spv.MerkleRootConfirmationRequestItem) error {
// Verify merkle roots
return nil
}