sweep: prevent default fee preference fallback

We want to make sure clients are aware of their own fee preferences,
rather than relying on defaults.
This commit is contained in:
Wilmer Paulino
2019-05-29 13:59:00 -07:00
parent 5485101f9f
commit c70858dc46
2 changed files with 16 additions and 0 deletions

View File

@@ -372,6 +372,12 @@ func assertTxFeeRate(t *testing.T, tx *wire.MsgTx,
func TestSuccess(t *testing.T) {
ctx := createSweeperTestContext(t)
// Sweeping an input without a fee preference should result in an error.
_, err := ctx.sweeper.SweepInput( spendableInputs[0], FeePreference{})
if err != ErrNoFeePreference {
t.Fatalf("expected ErrNoFeePreference, got %v", err)
}
resultChan, err := ctx.sweeper.SweepInput(
spendableInputs[0], defaultFeePref,
)