channeldb/graph_test: assert MaxHTLC field correctness
Co-authored-by: Valentine Wallace <valentine.m.wallace@gmail.com>
This commit is contained in:
1 parent
69d4bf051f
commit
8dd074ee57
1 file changed
+10
-3
+10
-3
@@ -699,10 +699,11 @@ func TestEdgeInfoUpdates(t *testing.T) {
|
|||||||
SigBytes: testSig.Serialize(),
|
SigBytes: testSig.Serialize(),
|
||||||
ChannelID: chanID,
|
ChannelID: chanID,
|
||||||
LastUpdate: time.Unix(433453, 0),
|
LastUpdate: time.Unix(433453, 0),
|
||||||
MessageFlags: 0,
|
MessageFlags: 1,
|
||||||
ChannelFlags: 0,
|
ChannelFlags: 0,
|
||||||
TimeLockDelta: 99,
|
TimeLockDelta: 99,
|
||||||
MinHTLC: 2342135,
|
MinHTLC: 2342135,
|
||||||
|
MaxHTLC: 13928598,
|
||||||
FeeBaseMSat: 4352345,
|
FeeBaseMSat: 4352345,
|
||||||
FeeProportionalMillionths: 3452352,
|
FeeProportionalMillionths: 3452352,
|
||||||
Node: secondNode,
|
Node: secondNode,
|
||||||
@@ -713,10 +714,11 @@ func TestEdgeInfoUpdates(t *testing.T) {
|
|||||||
SigBytes: testSig.Serialize(),
|
SigBytes: testSig.Serialize(),
|
||||||
ChannelID: chanID,
|
ChannelID: chanID,
|
||||||
LastUpdate: time.Unix(124234, 0),
|
LastUpdate: time.Unix(124234, 0),
|
||||||
MessageFlags: 0,
|
MessageFlags: 1,
|
||||||
ChannelFlags: 1,
|
ChannelFlags: 1,
|
||||||
TimeLockDelta: 99,
|
TimeLockDelta: 99,
|
||||||
MinHTLC: 2342135,
|
MinHTLC: 2342135,
|
||||||
|
MaxHTLC: 13928598,
|
||||||
FeeBaseMSat: 4352345,
|
FeeBaseMSat: 4352345,
|
||||||
FeeProportionalMillionths: 90392423,
|
FeeProportionalMillionths: 90392423,
|
||||||
Node: firstNode,
|
Node: firstNode,
|
||||||
@@ -794,10 +796,11 @@ func newEdgePolicy(chanID uint64, op wire.OutPoint, db *DB,
|
|||||||
return &ChannelEdgePolicy{
|
return &ChannelEdgePolicy{
|
||||||
ChannelID: chanID,
|
ChannelID: chanID,
|
||||||
LastUpdate: time.Unix(updateTime, 0),
|
LastUpdate: time.Unix(updateTime, 0),
|
||||||
MessageFlags: 0,
|
MessageFlags: 1,
|
||||||
ChannelFlags: 0,
|
ChannelFlags: 0,
|
||||||
TimeLockDelta: uint16(prand.Int63()),
|
TimeLockDelta: uint16(prand.Int63()),
|
||||||
MinHTLC: lnwire.MilliSatoshi(prand.Int63()),
|
MinHTLC: lnwire.MilliSatoshi(prand.Int63()),
|
||||||
|
MaxHTLC: lnwire.MilliSatoshi(prand.Int63()),
|
||||||
FeeBaseMSat: lnwire.MilliSatoshi(prand.Int63()),
|
FeeBaseMSat: lnwire.MilliSatoshi(prand.Int63()),
|
||||||
FeeProportionalMillionths: lnwire.MilliSatoshi(prand.Int63()),
|
FeeProportionalMillionths: lnwire.MilliSatoshi(prand.Int63()),
|
||||||
db: db,
|
db: db,
|
||||||
@@ -2665,6 +2668,10 @@ func compareEdgePolicies(a, b *ChannelEdgePolicy) error {
|
|||||||
return fmt.Errorf("MinHTLC doesn't match: expected %v, "+
|
return fmt.Errorf("MinHTLC doesn't match: expected %v, "+
|
||||||
"got %v", a.MinHTLC, b.MinHTLC)
|
"got %v", a.MinHTLC, b.MinHTLC)
|
||||||
}
|
}
|
||||||
|
if a.MaxHTLC != b.MaxHTLC {
|
||||||
|
return fmt.Errorf("MaxHTLC doesn't match: expected %v, "+
|
||||||
|
"got %v", a.MaxHTLC, b.MaxHTLC)
|
||||||
|
}
|
||||||
if a.FeeBaseMSat != b.FeeBaseMSat {
|
if a.FeeBaseMSat != b.FeeBaseMSat {
|
||||||
return fmt.Errorf("FeeBaseMSat doesn't match: expected %v, "+
|
return fmt.Errorf("FeeBaseMSat doesn't match: expected %v, "+
|
||||||
"got %v", a.FeeBaseMSat, b.FeeBaseMSat)
|
"got %v", a.FeeBaseMSat, b.FeeBaseMSat)
|
||||||
|
|||||||
Reference in new issue
Block a user