Avoid concrete rust-bitcoin type in version-specific GetOrphanTxs struct#490
Avoid concrete rust-bitcoin type in version-specific GetOrphanTxs struct#4900xB10C wants to merge 1 commit intorust-bitcoin:masterfrom
Conversation
|
Mad, thanks man. Can we use our funky explicit error style in the integration test to check all the re-exports are good? In let model_v0: Result<mtype::GetOrphanTxs, GetOrphanTxsError> = json_v0.into_model();
let model_v0 = model_v0.unwrap(); |
types/src/v29/hidden/error.rs
Outdated
| /// Error when converting a `GetOrphanTxs` type into the model type. | ||
| #[derive(Debug)] | ||
| pub enum GetOrphanTxsError { | ||
| /// Conversion of the transaction `txid` field failed. |
There was a problem hiding this comment.
Since this error is used in multiple places and there isn't always a txid field perhaps something like this?
/// Conversion of a `txid` from the orphanage failed.
There was a problem hiding this comment.
If that isn't too cute for your likeing.
There was a problem hiding this comment.
used that. I lazily just copy and pasted from GetOrphanTxsVerboseOneEntryError before.
|
Thanks for coming back and picking this up mate, appreciate the work. |
A concrete rust-bitcoin type was added to the version-specific `GetOrphanTxs` struct during rust-bitcoin#435. This is corrected by using a list of strings and converting to the model type via `into_model`. Affects v29 and v30. Also, use the explicit error in the itegration tests to check that the re-exports are good. Fixes rust-bitcoin#484
1733130 to
7a59cff
Compare
|
Addressed #490 (comment)! |
| // use explicit errors here to check that the re-exports are good | ||
| let model_v0: Result<mtype::GetOrphanTxs, GetOrphanTxsError> = json_v0.into_model(); | ||
| let model_v1: Result<mtype::GetOrphanTxsVerboseOne, GetOrphanTxsVerboseOneEntryError> = json_v1.into_model(); | ||
| let model_v2: Result<mtype::GetOrphanTxsVerboseTwo, GetOrphanTxsVerboseTwoEntryError> = json_v2.into_model(); |
There was a problem hiding this comment.
does the formatting job also check the integration test? At least locally that should have been split over multiple lines
A concrete rust-bitcoin type was added to the version-specific
GetOrphanTxsstruct during #435. This is corrected by using a list of strings and converting to the model type viainto_model.Affects v29 and v30.
Fixes #484