We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 372560a commit cbf1b0cCopy full SHA for cbf1b0c
data_structures/src/fee.rs
@@ -158,19 +158,16 @@ where
158
#[serde(untagged)]
159
enum Untagged {
160
Fee(Fee),
161
- Float(f64),
162
Integer(u64),
163
String(String),
164
}
165
166
Ok(match Untagged::deserialize(deserializer)? {
167
Untagged::Fee(fee) => fee,
168
- Untagged::Float(float) => Fee::relative_from_float(float),
169
Untagged::Integer(integer) => Fee::absolute_from_nanowits(integer),
170
Untagged::String(string) => string
171
.parse::<u64>()
172
.map(Fee::absolute_from_nanowits)
173
- .or_else(|_| string.parse::<f64>().map(Fee::relative_from_float))
174
.map_err(serde::de::Error::custom)?,
175
})
176
0 commit comments