sweep: assert transaction fee rate in TestDifferentFeePreferences
This commit is contained in:
parent
c70858dc46
commit
f206444e96
@ -1013,14 +1013,13 @@ func TestDifferentFeePreferences(t *testing.T) {
|
|||||||
// with the higher fee preference, and the last with the lower. We do
|
// with the higher fee preference, and the last with the lower. We do
|
||||||
// this to ensure the sweeper can broadcast distinct transactions for
|
// this to ensure the sweeper can broadcast distinct transactions for
|
||||||
// each sweep with a different fee preference.
|
// each sweep with a different fee preference.
|
||||||
lowFeePref := FeePreference{
|
lowFeePref := FeePreference{ConfTarget: 12}
|
||||||
ConfTarget: 12,
|
lowFeeRate := lnwallet.SatPerKWeight(5000)
|
||||||
}
|
ctx.estimator.blocksToFee[lowFeePref.ConfTarget] = lowFeeRate
|
||||||
ctx.estimator.blocksToFee[lowFeePref.ConfTarget] = 5000
|
|
||||||
highFeePref := FeePreference{
|
highFeePref := FeePreference{ConfTarget: 6}
|
||||||
ConfTarget: 6,
|
highFeeRate := lnwallet.SatPerKWeight(10000)
|
||||||
}
|
ctx.estimator.blocksToFee[highFeePref.ConfTarget] = highFeeRate
|
||||||
ctx.estimator.blocksToFee[highFeePref.ConfTarget] = 10000
|
|
||||||
|
|
||||||
input1 := spendableInputs[0]
|
input1 := spendableInputs[0]
|
||||||
resultChan1, err := ctx.sweeper.SweepInput(input1, highFeePref)
|
resultChan1, err := ctx.sweeper.SweepInput(input1, highFeePref)
|
||||||
@ -1045,11 +1044,11 @@ func TestDifferentFeePreferences(t *testing.T) {
|
|||||||
// The first transaction broadcast should be the one spending the higher
|
// The first transaction broadcast should be the one spending the higher
|
||||||
// fee rate inputs.
|
// fee rate inputs.
|
||||||
sweepTx1 := ctx.receiveTx()
|
sweepTx1 := ctx.receiveTx()
|
||||||
assertTxSweepsInputs(t, &sweepTx1, input1, input2)
|
assertTxFeeRate(t, &sweepTx1, highFeeRate, input1, input2)
|
||||||
|
|
||||||
// The second should be the one spending the lower fee rate inputs.
|
// The second should be the one spending the lower fee rate inputs.
|
||||||
sweepTx2 := ctx.receiveTx()
|
sweepTx2 := ctx.receiveTx()
|
||||||
assertTxSweepsInputs(t, &sweepTx2, input3)
|
assertTxFeeRate(t, &sweepTx2, lowFeeRate, input3)
|
||||||
|
|
||||||
// With the transactions broadcast, we'll mine a block to so that the
|
// With the transactions broadcast, we'll mine a block to so that the
|
||||||
// result is delivered to each respective client.
|
// result is delivered to each respective client.
|
||||||
|
Loading…
Reference in New Issue
Block a user