itest: fix existing itests

This commit is contained in:
yyforyongyu
2024-03-17 18:19:06 +08:00
parent 7fb18bc0d5
commit 94390fc775
3 changed files with 16 additions and 2 deletions

View File

@@ -32,6 +32,9 @@ type WebFeeService interface {
// SetFeeRate sets the estimated fee rate for a given confirmation
// target.
SetFeeRate(feeRate chainfee.SatPerKWeight, conf uint32)
// Reset resets the fee rate map to the default value.
Reset()
}
const (
@@ -140,6 +143,16 @@ func (f *FeeService) SetFeeRate(fee chainfee.SatPerKWeight, conf uint32) {
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.
func (f *FeeService) URL() string {
return f.url