chainfee: add a new interface method GetFeeMap

This commit adds a new method `GetFeeMap` to handle querying the web API
and parse the response into a map that's used by the fee estimator. In
doing so we can provide a deeper abstraction over the `WebAPIFeeSource`
interface.
This commit is contained in:
yyforyongyu committed 2023-10-29 13:24:27 +08:00
1 parent a1fa195493
commit 8ca48311ee
2 files changed
+51 -29

No files matched your search

+4
View File
@@ -24,6 +24,10 @@ func (e mockSparseConfFeeSource) ParseResponse(r io.Reader) (map[uint32]uint32,
return e.fees, nil
}
func (e mockSparseConfFeeSource) GetFeeMap() (map[uint32]uint32, error) {
return e.fees, nil
}
// TestFeeRateTypes checks that converting fee rates between the
// different types that represent fee rates and calculating fees
// work as expected.