contractcourt: test commitment deadline logic

This commit adds two tests to check that a) the correct deadline is used
given different HTLC sets and b) when sweeping anchors the correct
deadlines are used.
This commit is contained in:
yyforyongyu committed 2021-06-29 20:25:47 +08:00
1 parent 0dc3190fec
commit 614884dcb8
2 files changed
+252 -3

No files matched your search

+3 -3
View File
@@ -109,7 +109,7 @@ type mockSweeper struct {
sweepErr error
createSweepTxChan chan *wire.MsgTx
deadlines []uint32
deadlines []int
}
func newMockSweeper() *mockSweeper {
@@ -118,7 +118,7 @@ func newMockSweeper() *mockSweeper {
updatedInputs: make(chan wire.OutPoint),
sweepTx: &wire.MsgTx{},
createSweepTxChan: make(chan *wire.MsgTx),
deadlines: []uint32{},
deadlines: []int{},
}
}
@@ -129,7 +129,7 @@ func (s *mockSweeper) SweepInput(input input.Input, params sweep.Params) (
// Update the deadlines used if it's set.
if params.Fee.ConfTarget != 0 {
s.deadlines = append(s.deadlines, params.Fee.ConfTarget)
s.deadlines = append(s.deadlines, int(params.Fee.ConfTarget))
}
result := make(chan sweep.Result, 1)