sweep: allow updating all sweep parameters

This is a preparation for adding additional parameters besides the fee
preference.
This commit is contained in:
Joost Jager committed 2020-01-15 16:56:40 +01:00
1 parent 280611ab6e
commit 16832cefa3
3 files changed
+52 -39

No files matched your search

+7 -3
View File
@@ -1178,7 +1178,9 @@ func TestBumpFeeRBF(t *testing.T) {
// We'll first try to bump the fee of an output currently unknown to the
// UtxoSweeper. Doing so should result in a lnwallet.ErrNotMine error.
bumpResult, err := ctx.sweeper.BumpFee(wire.OutPoint{}, lowFeePref)
_, err := ctx.sweeper.UpdateParams(
wire.OutPoint{}, Params{Fee: lowFeePref},
)
if err != lnwallet.ErrNotMine {
t.Fatalf("expected error lnwallet.ErrNotMine, got \"%v\"", err)
}
@@ -1206,12 +1208,14 @@ func TestBumpFeeRBF(t *testing.T) {
ctx.estimator.blocksToFee[highFeePref.ConfTarget] = highFeeRate
// We should expect to see an error if a fee preference isn't provided.
_, err = ctx.sweeper.BumpFee(*input.OutPoint(), FeePreference{})
_, err = ctx.sweeper.UpdateParams(*input.OutPoint(), Params{})
if err != ErrNoFeePreference {
t.Fatalf("expected ErrNoFeePreference, got %v", err)
}
bumpResult, err = ctx.sweeper.BumpFee(*input.OutPoint(), highFeePref)
bumpResult, err := ctx.sweeper.UpdateParams(
*input.OutPoint(), Params{Fee: highFeePref},
)
if err != nil {
t.Fatalf("unable to bump input's fee: %v", err)
}