forked from btcsuite/btcwallet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mock.go
85 lines (65 loc) · 1.73 KB
/
mock.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package wallet
import (
"time"
"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
"github.com/sjatsh/btcwallet/chain"
"github.com/sjatsh/btcwallet/waddrmgr"
)
type mockChainClient struct {
}
var _ chain.Interface = (*mockChainClient)(nil)
func (m *mockChainClient) Start() error {
return nil
}
func (m *mockChainClient) Stop() {
}
func (m *mockChainClient) WaitForShutdown() {}
func (m *mockChainClient) GetBestBlock() (*chainhash.Hash, int32, error) {
return nil, 0, nil
}
func (m *mockChainClient) GetBlock(*chainhash.Hash) (*wire.MsgBlock, error) {
return nil, nil
}
func (m *mockChainClient) GetBlockHash(int64) (*chainhash.Hash, error) {
return nil, nil
}
func (m *mockChainClient) GetBlockHeader(*chainhash.Hash) (*wire.BlockHeader,
error) {
return nil, nil
}
func (m *mockChainClient) IsCurrent() bool {
return false
}
func (m *mockChainClient) FilterBlocks(*chain.FilterBlocksRequest) (
*chain.FilterBlocksResponse, error) {
return nil, nil
}
func (m *mockChainClient) BlockStamp() (*waddrmgr.BlockStamp, error) {
return &waddrmgr.BlockStamp{
Height: 500000,
Hash: chainhash.Hash{},
Timestamp: time.Unix(1234, 0),
}, nil
}
func (m *mockChainClient) SendRawTransaction(*wire.MsgTx, bool) (
*chainhash.Hash, error) {
return nil, nil
}
func (m *mockChainClient) Rescan(*chainhash.Hash, []btcutil.Address,
map[wire.OutPoint]btcutil.Address) error {
return nil
}
func (m *mockChainClient) NotifyReceived([]btcutil.Address) error {
return nil
}
func (m *mockChainClient) NotifyBlocks() error {
return nil
}
func (m *mockChainClient) Notifications() <-chan interface{} {
return nil
}
func (m *mockChainClient) BackEnd() string {
return "mock"
}