contractcourt: update TestChannelArbitratorAnchors
This commit adds a deadline field to mockSweeper that can be used to track the customized conf target (deadline) used for sweeping anchors. The relevant test, TestChannelArbitratorAnchors is updated to reflect that the deadlines are indeed taking effect.
This commit is contained in:
2 files changed
+79
-3
No files matched your search
@@ -108,14 +108,17 @@ type mockSweeper struct {
|
||||
sweepTx *wire.MsgTx
|
||||
sweepErr error
|
||||
createSweepTxChan chan *wire.MsgTx
|
||||
|
||||
deadlines []uint32
|
||||
}
|
||||
|
||||
func newMockSweeper() *mockSweeper {
|
||||
return &mockSweeper{
|
||||
sweptInputs: make(chan input.Input),
|
||||
sweptInputs: make(chan input.Input, 3),
|
||||
updatedInputs: make(chan wire.OutPoint),
|
||||
sweepTx: &wire.MsgTx{},
|
||||
createSweepTxChan: make(chan *wire.MsgTx),
|
||||
deadlines: []uint32{},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,6 +127,11 @@ func (s *mockSweeper) SweepInput(input input.Input, params sweep.Params) (
|
||||
|
||||
s.sweptInputs <- input
|
||||
|
||||
// Update the deadlines used if it's set.
|
||||
if params.Fee.ConfTarget != 0 {
|
||||
s.deadlines = append(s.deadlines, params.Fee.ConfTarget)
|
||||
}
|
||||
|
||||
result := make(chan sweep.Result, 1)
|
||||
result <- sweep.Result{
|
||||
Tx: s.sweepTx,
|
||||
|
||||
Reference in new issue
Block a user