Merge pull request #243 from sigp/fork-choice-tests

Fork choice tests
This commit is contained in:
Paul Hauner
2019-02-22 13:34:58 +13:00
committed by GitHub
15 changed files with 636 additions and 187 deletions

View File

@@ -25,12 +25,14 @@ macro_rules! impl_into_u32 {
($main: ident) => {
impl Into<u32> for $main {
fn into(self) -> u32 {
assert!(self.0 < u64::from(std::u32::MAX), "Lossy conversion to u32");
self.0 as u32
}
}
impl $main {
pub fn as_u32(&self) -> u32 {
assert!(self.0 < u64::from(std::u32::MAX), "Lossy conversion to u32");
self.0 as u32
}
}