|
Ran
|
Jobs
1
|
Files
116
|
Run time
99min
|
Badge
README BADGES
|
push
github
Merge rust-bitcoin/rust-bitcoin#3858: Bound `Address` parsing on `NetworkValidationUnchecked` <a class=hub.com/rust-bitcoin/rust-bitcoin/commit/29a71de92817bccd49b42b1055cc570832e6b959">29a71de92<a href="https://github.com/rust-bitcoin/rust-bitcoin/commit/9a8e61393c4b05caaa673efaa1e85bd272ed9ff5"> Bound Address parsing on NetworkValidationUnchecked (Tobin C. Harding) <a class="double-link" href="https://github.com/rust-bitcoin/rust-bitcoin/commit/cf455d3a063079916f0bff8ee0335cce00a50f8e">cf455d3a0</a> Fix typo in prifixes (Tobin C. Harding) Pull request description: Currently it is not possible for downstream to use a generic on the `Address` type in structs in conjuncture with derives (`serde::Deserialize` and `Display`) because our impls are only done for `NetworkUnchecked` (as they should be). However, as observed by dpc, if we add a secondary marker trait and use it to bound the impls, implementing the new marker for `NetworkUnchecked` then downstream can use derives by way of ``` #[derive(Serialize, Deserialize)] struct Foo<V> where V: NetworkValidation, { #[serde(bound(deserialize = "V: NetworkValidationUnchecked"))] address: Address<V>, } ``` This is cool as hell because the `Address` type is currently a royal PITA. Patch 1 is trivial cleanup. To get past a build error in `FromStr` I used this little trick ```rust // We know that `U` is only ever `NetworkUnchecked` but the compiler does not. Ok(Address(address.0, PhantomData::<U>)) ``` Resolve: #3760 and Close: #3856 ACKs for top commit: apoelstra: ACK 29a71de92817bccd49b42b1055cc570832e6b959; successfully ran local tests Tree-SHA512: 7c158dddb82ce82630975743c56080f827e
35 of 38 new or added lines in 1 file covered. (92.11%)
20583 of 24820 relevant lines covered (82.93%)
17446.26 hits per line
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | 12694367970.1 | 0 |
82.93 |
GitHub Action Run |