Skip to content

Keys in feerates mapping should be u16, not String. #64

@darosior

Description

@darosior

In get_fee_estimates the confirmation targets are passed as strings:

/// Get an map where the key is the confirmation target (in number of blocks)
/// and the value is the estimated feerate (in sat/vB).
pub fn get_fee_estimates(&self) -> Result<HashMap<String, f64>, Error> {
let resp = self
.agent
.get(&format!("{}/fee-estimates", self.url,))
.call();
let map = match resp {
Ok(resp) => {
let map: HashMap<String, f64> = resp.into_json()?;
Ok(map)
}
Err(ureq::Error::Status(code, resp)) => Err(Error::HttpResponse {
status: code,
message: resp.into_string()?,
}),
Err(e) => Err(Error::Ureq(e)),
}?;
Ok(map)
}

But they are given as u16 by electrs: https://github.com/mempool/electrs/blob/b379d24cb1972976d4b787d6e4c0f664f144bfa6/src/new_index/query.rs#L196-L205 (mempool's fork), https://github.com/Blockstream/electrs/blob/fd35014283c7d3a7a85c77b9fd647c9f09de12c9/src/new_index/query.rs#L184-L193 (Blocktream's fork).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions