mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-28 13:52:55 +02:00
htlcswitch/test: assert on replied failure message
This commit is contained in:
@@ -1336,6 +1336,7 @@ func TestSkipIneligibleLinksMultiHopForward(t *testing.T) {
|
||||
// Alice.
|
||||
preimage := [sha256.Size]byte{1}
|
||||
rhash := fastsha256.Sum256(preimage[:])
|
||||
obfuscator := NewMockObfuscator()
|
||||
packet = &htlcPacket{
|
||||
incomingChanID: aliceChannelLink.ShortChanID(),
|
||||
incomingHTLCID: 0,
|
||||
@@ -1344,7 +1345,7 @@ func TestSkipIneligibleLinksMultiHopForward(t *testing.T) {
|
||||
PaymentHash: rhash,
|
||||
Amount: 1,
|
||||
},
|
||||
obfuscator: NewMockObfuscator(),
|
||||
obfuscator: obfuscator,
|
||||
}
|
||||
|
||||
// The request to forward should fail as
|
||||
@@ -1353,6 +1354,11 @@ func TestSkipIneligibleLinksMultiHopForward(t *testing.T) {
|
||||
t.Fatalf("forwarding should have failed due to inactive link")
|
||||
}
|
||||
|
||||
failure := obfuscator.(*mockObfuscator).failure
|
||||
if _, ok := failure.(*lnwire.FailTemporaryChannelFailure); !ok {
|
||||
t.Fatalf("unexpected failure %T", failure)
|
||||
}
|
||||
|
||||
if s.circuits.NumOpen() != 0 {
|
||||
t.Fatal("wrong amount of circuits")
|
||||
}
|
||||
|
Reference in New Issue
Block a user