@@ -357,15 +357,15 @@ where
357357
358358#[ derive( Clone , PartialEq , Eq , Hash , Deserialize ) ]
359359#[ serde( rename_all = "camelCase" ) ]
360- pub struct BlockPtrExt {
360+ pub struct ExtendedBlockPtr {
361361 pub hash : BlockHash ,
362362 #[ serde( deserialize_with = "deserialize_block_number" ) ]
363363 pub number : BlockNumber ,
364364 pub parent_hash : BlockHash ,
365365 pub timestamp : U256 ,
366366}
367367
368- impl BlockPtrExt {
368+ impl ExtendedBlockPtr {
369369 pub fn new (
370370 hash : BlockHash ,
371371 number : BlockNumber ,
@@ -413,7 +413,7 @@ impl BlockPtrExt {
413413 }
414414}
415415
416- impl fmt:: Display for BlockPtrExt {
416+ impl fmt:: Display for ExtendedBlockPtr {
417417 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
418418 write ! (
419419 f,
@@ -425,7 +425,7 @@ impl fmt::Display for BlockPtrExt {
425425 }
426426}
427427
428- impl fmt:: Debug for BlockPtrExt {
428+ impl fmt:: Debug for ExtendedBlockPtr {
429429 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
430430 write ! (
431431 f,
@@ -437,7 +437,7 @@ impl fmt::Debug for BlockPtrExt {
437437 }
438438}
439439
440- impl slog:: Value for BlockPtrExt {
440+ impl slog:: Value for ExtendedBlockPtr {
441441 fn serialize (
442442 & self ,
443443 record : & slog:: Record ,
@@ -448,7 +448,7 @@ impl slog::Value for BlockPtrExt {
448448 }
449449}
450450
451- impl IntoValue for BlockPtrExt {
451+ impl IntoValue for ExtendedBlockPtr {
452452 fn into_value ( self ) -> r:: Value {
453453 object ! {
454454 __typename: "Block" ,
@@ -460,7 +460,7 @@ impl IntoValue for BlockPtrExt {
460460 }
461461}
462462
463- impl TryFrom < ( Option < H256 > , Option < U64 > , H256 , U256 ) > for BlockPtrExt {
463+ impl TryFrom < ( Option < H256 > , Option < U64 > , H256 , U256 ) > for ExtendedBlockPtr {
464464 type Error = anyhow:: Error ;
465465
466466 fn try_from ( tuple : ( Option < H256 > , Option < U64 > , H256 , U256 ) ) -> Result < Self , Self :: Error > {
@@ -474,7 +474,7 @@ impl TryFrom<(Option<H256>, Option<U64>, H256, U256)> for BlockPtrExt {
474474 let block_number =
475475 i32:: try_from ( number) . map_err ( |_| anyhow ! ( "Block number out of range" ) ) ?;
476476
477- Ok ( BlockPtrExt {
477+ Ok ( ExtendedBlockPtr {
478478 hash : hash. into ( ) ,
479479 number : block_number,
480480 parent_hash : parent_hash. into ( ) ,
@@ -483,28 +483,28 @@ impl TryFrom<(Option<H256>, Option<U64>, H256, U256)> for BlockPtrExt {
483483 }
484484}
485485
486- impl TryFrom < ( H256 , i32 , H256 , U256 ) > for BlockPtrExt {
486+ impl TryFrom < ( H256 , i32 , H256 , U256 ) > for ExtendedBlockPtr {
487487 type Error = anyhow:: Error ;
488488
489489 fn try_from ( tuple : ( H256 , i32 , H256 , U256 ) ) -> Result < Self , Self :: Error > {
490490 let ( hash, block_number, parent_hash, timestamp) = tuple;
491491
492- Ok ( BlockPtrExt {
492+ Ok ( ExtendedBlockPtr {
493493 hash : hash. into ( ) ,
494494 number : block_number,
495495 parent_hash : parent_hash. into ( ) ,
496496 timestamp,
497497 } )
498498 }
499499}
500- impl From < BlockPtrExt > for H256 {
501- fn from ( ptr : BlockPtrExt ) -> Self {
500+ impl From < ExtendedBlockPtr > for H256 {
501+ fn from ( ptr : ExtendedBlockPtr ) -> Self {
502502 ptr. hash_as_h256 ( )
503503 }
504504}
505505
506- impl From < BlockPtrExt > for BlockNumber {
507- fn from ( ptr : BlockPtrExt ) -> Self {
506+ impl From < ExtendedBlockPtr > for BlockNumber {
507+ fn from ( ptr : ExtendedBlockPtr ) -> Self {
508508 ptr. number
509509 }
510510}
@@ -653,8 +653,8 @@ mod tests {
653653 }
654654 "# ;
655655
656- // Deserialize the JSON string into a BlockPtrExt
657- let block_ptr_ext: BlockPtrExt =
656+ // Deserialize the JSON string into a ExtendedBlockPtr
657+ let block_ptr_ext: ExtendedBlockPtr =
658658 serde_json:: from_str ( json_data) . expect ( "Deserialization failed" ) ;
659659
660660 // Verify the deserialized values
@@ -672,7 +672,7 @@ mod tests {
672672 }
673673 "# ;
674674
675- let result: Result < BlockPtrExt , _ > = serde_json:: from_str ( invalid_json_data) ;
675+ let result: Result < ExtendedBlockPtr , _ > = serde_json:: from_str ( invalid_json_data) ;
676676
677677 assert ! (
678678 result. is_err( ) ,
0 commit comments