@@ -348,6 +348,14 @@ impl From<RawChain> for Chain {
348
348
}
349
349
}
350
350
351
+ impl From < RawChainId > for RawChain {
352
+ fn from ( value : RawChainId ) -> Self {
353
+ assert_ne ! ( value. 0 , 0 ) ;
354
+
355
+ RawChain ( value. 0 )
356
+ }
357
+ }
358
+
351
359
//---------------------------------------------------------------------------------------------------- RawChainId
352
360
#[ derive( Copy , Clone , Debug , PartialEq , PartialOrd , Eq , Ord , Hash , Pod , Zeroable ) ]
353
361
#[ repr( transparent) ]
@@ -371,16 +379,16 @@ impl Key for RawChainId {}
371
379
#[ derive( Copy , Clone , Debug , PartialEq , PartialOrd , Eq , Ord , Hash , Pod , Zeroable ) ]
372
380
#[ repr( C ) ]
373
381
pub struct AltChainInfo {
374
- parent_chain : RawChain ,
375
- common_ancestor_height : u64
382
+ pub parent_chain : RawChain ,
383
+ pub common_ancestor_height : usize ,
376
384
}
377
385
378
386
//---------------------------------------------------------------------------------------------------- AltBlockHeight
379
387
#[ derive( Copy , Clone , Debug , PartialEq , PartialOrd , Eq , Ord , Hash , Pod , Zeroable ) ]
380
388
#[ repr( C ) ]
381
389
pub struct AltBlockHeight {
382
- chain_id : u64 ,
383
- height : u64 ,
390
+ pub chain_id : RawChainId ,
391
+ pub height : usize ,
384
392
}
385
393
386
394
impl Key for AltBlockHeight { }
@@ -396,15 +404,14 @@ pub struct CompactAltBlockInfo {
396
404
/// The block's proof-of-work hash.
397
405
pub pow_hash : [ u8 ; 32 ] ,
398
406
/// The block's height.
399
- pub height : u64 ,
407
+ pub height : usize ,
400
408
/// The adjusted block size, in bytes.
401
409
pub weight : usize ,
402
410
/// The long term block weight, which is the weight factored in with previous block weights.
403
411
pub long_term_weight : usize ,
404
412
/// The cumulative difficulty of all blocks up until and including this block.
405
413
pub cumulative_difficulty_low : u64 ,
406
414
pub cumulative_difficulty_high : u64 ,
407
-
408
415
}
409
416
410
417
//---------------------------------------------------------------------------------------------------- AltTransactionInfo
0 commit comments