-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
mocks.go
32 lines (24 loc) · 883 Bytes
/
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
package routing
import (
"github.com/lightningnetwork/lnd/channeldb/models"
"github.com/lightningnetwork/lnd/lnwire"
"github.com/stretchr/testify/mock"
)
// mockAdditionalEdge is a mock of the AdditionalEdge interface.
type mockAdditionalEdge struct{ mock.Mock }
// IntermediatePayloadSize returns the sphinx payload size defined in BOLT04 if
// this edge were to be included in a route.
func (m *mockAdditionalEdge) IntermediatePayloadSize(amount lnwire.MilliSatoshi,
expiry uint32, legacy bool, channelID uint64) uint64 {
args := m.Called(amount, expiry, legacy, channelID)
return args.Get(0).(uint64)
}
// EdgePolicy return the policy of the mockAdditionalEdge.
func (m *mockAdditionalEdge) EdgePolicy() *models.CachedEdgePolicy {
args := m.Called()
edgePolicy := args.Get(0)
if edgePolicy == nil {
return nil
}
return edgePolicy.(*models.CachedEdgePolicy)
}