forked from stellar/go
/
mocks.go
100 lines (81 loc) · 2.75 KB
/
mocks.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
package historyarchive
import (
"github.com/stellar/go/xdr"
"github.com/stretchr/testify/mock"
)
// MockArchive is a mockable archive.
type MockArchive struct {
mock.Mock
}
func (m *MockArchive) GetCheckpointManager() CheckpointManager {
a := m.Called()
return a.Get(0).(CheckpointManager)
}
func (m *MockArchive) GetPathHAS(path string) (HistoryArchiveState, error) {
a := m.Called(path)
return a.Get(0).(HistoryArchiveState), a.Error(1)
}
func (m *MockArchive) PutPathHAS(path string, has HistoryArchiveState, opts *CommandOptions) error {
a := m.Called(path, has, opts)
return a.Error(0)
}
func (m *MockArchive) BucketExists(bucket Hash) (bool, error) {
a := m.Called(bucket)
return a.Get(0).(bool), a.Error(1)
}
func (m *MockArchive) CategoryCheckpointExists(cat string, chk uint32) (bool, error) {
a := m.Called(cat, chk)
return a.Get(0).(bool), a.Error(1)
}
func (m *MockArchive) GetLedgerHeader(chk uint32) (xdr.LedgerHeaderHistoryEntry, error) {
a := m.Called(chk)
return a.Get(0).(xdr.LedgerHeaderHistoryEntry), a.Error(1)
}
func (m *MockArchive) GetLedgers(start, end uint32) (map[uint32]*Ledger, error) {
a := m.Called(start, end)
return a.Get(0).(map[uint32]*Ledger), a.Error(1)
}
func (m *MockArchive) GetRootHAS() (HistoryArchiveState, error) {
a := m.Called()
return a.Get(0).(HistoryArchiveState), a.Error(1)
}
func (m *MockArchive) GetCheckpointHAS(chk uint32) (HistoryArchiveState, error) {
a := m.Called(chk)
return a.Get(0).(HistoryArchiveState), a.Error(1)
}
func (m *MockArchive) PutCheckpointHAS(chk uint32, has HistoryArchiveState, opts *CommandOptions) error {
a := m.Called(chk, has, opts)
return a.Error(0)
}
func (m *MockArchive) PutRootHAS(has HistoryArchiveState, opts *CommandOptions) error {
a := m.Called(has, opts)
return a.Error(0)
}
func (m *MockArchive) ListBucket(dp DirPrefix) (chan string, chan error) {
m.Called(dp)
panic("Returning channels not implemented")
return make(chan string), make(chan error)
}
func (m *MockArchive) ListAllBuckets() (chan string, chan error) {
m.Called()
panic("Returning channels not implemented")
return make(chan string), make(chan error)
}
func (m *MockArchive) ListAllBucketHashes() (chan Hash, chan error) {
m.Called()
panic("Returning channels not implemented")
return make(chan Hash), make(chan error)
}
func (m *MockArchive) ListCategoryCheckpoints(cat string, pth string) (chan uint32, chan error) {
m.Called(cat, pth)
panic("Returning channels not implemented")
return make(chan uint32), make(chan error)
}
func (m *MockArchive) GetXdrStreamForHash(hash Hash) (*XdrStream, error) {
a := m.Called(hash)
return a.Get(0).(*XdrStream), a.Error(1)
}
func (m *MockArchive) GetXdrStream(pth string) (*XdrStream, error) {
a := m.Called(pth)
return a.Get(0).(*XdrStream), a.Error(1)
}