-
Notifications
You must be signed in to change notification settings - Fork 40
fix!(types): v24/v28 fixes #375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
2a4264a to
d8e2ac1
Compare
| /// Map of txid to [`MempoolEntry`]. | ||
| #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)] | ||
| #[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))] | ||
| pub struct GetRawMempoolVerbose(pub BTreeMap<String, MempoolEntry>); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thanks man. Can you add an into_model method too please. Copy from v17 also, or here it is.
impl GetRawMempoolVerbose {
/// Converts version specific type to a version nonspecific, more strongly typed type.
pub fn into_model(self) -> Result<model::GetRawMempoolVerbose, MapMempoolEntryError> {
use MapMempoolEntryError as E;
let mut map = BTreeMap::new();
for (k, v) in self.0.into_iter() {
let txid = k.parse::<Txid>().map_err(E::Txid)?;
let relative = v.into_model().map_err(E::MempoolEntry)?;
map.insert(txid, relative);
}
Ok(model::GetRawMempoolVerbose(map))
}
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in a5f9033
| pub address: String, | ||
| /// The associated label, or "" for the default label. | ||
| pub label: String, | ||
| pub label: Option<String>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The need for this change proves what we suspect, our test coverage is not good enough (see #58).
| /// whose fees and vsizes are included in effective-feerate. | ||
| #[serde(rename = "effective-includes")] | ||
| pub effective_includes: Vec<String>, | ||
| pub effective_includes: Option<Vec<String>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this one too. Thanks for finding and fixing these for us @storopoli.
tcharding
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK d8e2ac1
|
Woops I acked forgetting that we need the |
d8e2ac1 to
5bb3b31
Compare
Try now :) |
jamillambert
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 5bb3b31
All looks good to me, thanks for the fix.
tcharding
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 5bb3b31
|
FTR it came to me this morning that during review I did not check if theses modified types had any newer counterparts in more recent Coer versions. Checked just now before merging. |
|
Thanks for this @storopoli, super useful. |
|
No worries. Can we cut a new release of corepc-types? |
|
Yeah mate, sure thing. I'll do it on Monday for you. |
|
Don't forget the tag :) |
A bunch of issues when porting a custom
types.rsmodule frombitcoind-async-clienttocorepc-types.v24::GetRawMempoolVerboseshould use the same versionMempoolEntryand not thev17.v28::SubmitPackageTxResultmight not haveeffective-includesfield.v24::ListUnspentItemmight not have alabelfield.