Skip to content

Commit 126fc20

Browse files
fix: change target's type in fee estimate map
1 parent ef1925e commit 126fc20

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/async.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ impl AsyncClient {
380380

381381
/// Get an map where the key is the confirmation target (in number of blocks)
382382
/// and the value is the estimated feerate (in sat/vB).
383-
pub async fn get_fee_estimates(&self) -> Result<HashMap<String, f64>, Error> {
383+
pub async fn get_fee_estimates(&self) -> Result<HashMap<u16, f64>, Error> {
384384
let resp = self
385385
.client
386386
.get(&format!("{}/fee-estimates", self.url,))
@@ -393,7 +393,7 @@ impl AsyncClient {
393393
message: resp.text().await?,
394394
})
395395
} else {
396-
Ok(resp.json::<HashMap<String, f64>>().await?)
396+
Ok(resp.json::<HashMap<u16, f64>>().await?)
397397
}
398398
}
399399

src/blocking.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,15 +343,15 @@ impl BlockingClient {
343343

344344
/// Get an map where the key is the confirmation target (in number of blocks)
345345
/// and the value is the estimated feerate (in sat/vB).
346-
pub fn get_fee_estimates(&self) -> Result<HashMap<String, f64>, Error> {
346+
pub fn get_fee_estimates(&self) -> Result<HashMap<u16, f64>, Error> {
347347
let resp = self
348348
.agent
349349
.get(&format!("{}/fee-estimates", self.url,))
350350
.call();
351351

352352
let map = match resp {
353353
Ok(resp) => {
354-
let map: HashMap<String, f64> = resp.into_json()?;
354+
let map: HashMap<u16, f64> = resp.into_json()?;
355355
Ok(map)
356356
}
357357
Err(ureq::Error::Status(code, resp)) => Err(Error::HttpResponse {

0 commit comments

Comments
 (0)