Fix expecting string for fee_rate
According to the `serde` docs: > This is used in error messages. The message should complete the > sentence “This Visitor expects to receive …”, for example the message > could be “an integer between 0 and 64”. The message should not be > capitalized and should not end with a period. However we have the `expecting` str using the converted type not the thing the visitor expects. Use `u64` instead of `FeeRate` since that is what is being parsed. Note that in `amount` we got it _almost_ correct, subsequent patch will fix the case.
This commit is contained in:
parent
d6940497fd
commit
3658865a18
|
@ -69,7 +69,7 @@ pub mod as_sat_per_kwu {
|
||||||
type Value = Option<FeeRate>;
|
type Value = Option<FeeRate>;
|
||||||
|
|
||||||
fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
write!(f, "An Option<FeeRate>")
|
write!(f, "an Option<u64>")
|
||||||
}
|
}
|
||||||
|
|
||||||
fn visit_none<E>(self) -> Result<Self::Value, E>
|
fn visit_none<E>(self) -> Result<Self::Value, E>
|
||||||
|
@ -140,7 +140,7 @@ pub mod as_sat_per_vb_floor {
|
||||||
type Value = Option<FeeRate>;
|
type Value = Option<FeeRate>;
|
||||||
|
|
||||||
fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
write!(f, "An Option<FeeRate>")
|
write!(f, "an Option<u64>")
|
||||||
}
|
}
|
||||||
|
|
||||||
fn visit_none<E>(self) -> Result<Self::Value, E>
|
fn visit_none<E>(self) -> Result<Self::Value, E>
|
||||||
|
@ -211,7 +211,7 @@ pub mod as_sat_per_vb_ceil {
|
||||||
type Value = Option<FeeRate>;
|
type Value = Option<FeeRate>;
|
||||||
|
|
||||||
fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
write!(f, "An Option<FeeRate>")
|
write!(f, "an Option<u64>")
|
||||||
}
|
}
|
||||||
|
|
||||||
fn visit_none<E>(self) -> Result<Self::Value, E>
|
fn visit_none<E>(self) -> Result<Self::Value, E>
|
||||||
|
|
Loading…
Reference in New Issue