breacharbiter_test: add double handoff event
This commit is contained in:
parent
e9eab3f79f
commit
690992043b
@ -1018,6 +1018,32 @@ func TestBreachHandoffSuccess(t *testing.T) {
|
|||||||
// retribution information and the channel should be shown as pending
|
// retribution information and the channel should be shown as pending
|
||||||
// force closed.
|
// force closed.
|
||||||
assertArbiterBreach(t, brar, chanPoint)
|
assertArbiterBreach(t, brar, chanPoint)
|
||||||
|
|
||||||
|
// Send another breach event. Since the handoff for this channel was
|
||||||
|
// already ACKed, the breach arbiter should immediately ACK and ignore
|
||||||
|
// this event.
|
||||||
|
breach = &ContractBreachEvent{
|
||||||
|
ChanPoint: *chanPoint,
|
||||||
|
ProcessACK: make(chan error, 1),
|
||||||
|
BreachRetribution: &lnwallet.BreachRetribution{
|
||||||
|
BreachTransaction: bobClose.CloseTx,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
contractBreaches <- breach
|
||||||
|
|
||||||
|
// We'll also wait to consume the ACK back from the breach arbiter.
|
||||||
|
select {
|
||||||
|
case err := <-breach.ProcessACK:
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("handoff failed: %v", err)
|
||||||
|
}
|
||||||
|
case <-time.After(time.Second * 15):
|
||||||
|
t.Fatalf("breach arbiter didn't send ack back")
|
||||||
|
}
|
||||||
|
|
||||||
|
// State should not have changed.
|
||||||
|
assertArbiterBreach(t, brar, chanPoint)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TestBreachHandoffFail tests that a channel's close observer properly
|
// TestBreachHandoffFail tests that a channel's close observer properly
|
||||||
|
Loading…
Reference in New Issue
Block a user