mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-10 22:27:22 +01:00
itest: fix existing itests
This commit is contained in:
@@ -451,7 +451,8 @@ func channelForceClosureTest(ht *lntest.HarnessTest,
|
|||||||
|
|
||||||
// Allow some deviation because weight estimates during tx generation
|
// Allow some deviation because weight estimates during tx generation
|
||||||
// are estimates.
|
// are estimates.
|
||||||
require.InEpsilon(ht, expectedFeeRate, feeRate, 0.005)
|
require.InEpsilonf(ht, expectedFeeRate, feeRate, 0.005, "fee rate not "+
|
||||||
|
"match: want %v, got %v", expectedFeeRate, feeRate)
|
||||||
|
|
||||||
// Find alice's commit sweep and anchor sweep (if present) in the
|
// Find alice's commit sweep and anchor sweep (if present) in the
|
||||||
// mempool.
|
// mempool.
|
||||||
|
|||||||
@@ -32,6 +32,9 @@ type WebFeeService interface {
|
|||||||
// SetFeeRate sets the estimated fee rate for a given confirmation
|
// SetFeeRate sets the estimated fee rate for a given confirmation
|
||||||
// target.
|
// target.
|
||||||
SetFeeRate(feeRate chainfee.SatPerKWeight, conf uint32)
|
SetFeeRate(feeRate chainfee.SatPerKWeight, conf uint32)
|
||||||
|
|
||||||
|
// Reset resets the fee rate map to the default value.
|
||||||
|
Reset()
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -140,6 +143,16 @@ func (f *FeeService) SetFeeRate(fee chainfee.SatPerKWeight, conf uint32) {
|
|||||||
f.feeRateMap[conf] = uint32(fee.FeePerKVByte())
|
f.feeRateMap[conf] = uint32(fee.FeePerKVByte())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reset resets the fee rate map to the default value.
|
||||||
|
func (f *FeeService) Reset() {
|
||||||
|
f.lock.Lock()
|
||||||
|
f.feeRateMap = make(map[uint32]uint32)
|
||||||
|
f.lock.Unlock()
|
||||||
|
|
||||||
|
// Initialize default fee estimate.
|
||||||
|
f.SetFeeRate(DefaultFeeRateSatPerKw, 1)
|
||||||
|
}
|
||||||
|
|
||||||
// URL returns the service endpoint.
|
// URL returns the service endpoint.
|
||||||
func (f *FeeService) URL() string {
|
func (f *FeeService) URL() string {
|
||||||
return f.url
|
return f.url
|
||||||
|
|||||||
@@ -396,7 +396,7 @@ func (h *HarnessTest) Subtest(t *testing.T) *HarnessTest {
|
|||||||
st.resetStandbyNodes(t)
|
st.resetStandbyNodes(t)
|
||||||
|
|
||||||
// Reset fee estimator.
|
// Reset fee estimator.
|
||||||
st.SetFeeEstimate(DefaultFeeRateSatPerKw)
|
st.feeService.Reset()
|
||||||
|
|
||||||
// Record block height.
|
// Record block height.
|
||||||
_, startHeight := h.Miner.GetBestBlock()
|
_, startHeight := h.Miner.GetBestBlock()
|
||||||
|
|||||||
Reference in New Issue
Block a user