@@ -697,16 +697,16 @@ pub mod config {
697697 use super :: * ;
698698 use helium_proto:: services:: mobile_config:: {
699699 DeviceType , DeviceTypeV2 , GatewayClient , GatewayInfoBatchReqV1 , GatewayInfoReqV1 ,
700- GatewayInfoResV2 , GatewayInfoStreamReqV3 , GatewayInfoStreamResV2 ,
701- GatewayInfoStreamResV3 , GatewayInfoV2 , GatewayInfoV3 ,
700+ GatewayInfoResV2 , GatewayInfoStreamReqV4 , GatewayInfoStreamResV2 ,
701+ GatewayInfoStreamResV4 , GatewayInfoV2 , GatewayInfoV4 ,
702702 } ;
703703
704704 impl_message_sign ! ( GatewayInfoReqV1 ) ;
705- impl_message_sign ! ( GatewayInfoStreamReqV3 ) ;
705+ impl_message_sign ! ( GatewayInfoStreamReqV4 ) ;
706706 impl_message_sign ! ( GatewayInfoBatchReqV1 ) ;
707707 impl_message_verify ! ( GatewayInfoResV2 ) ;
708708 impl_message_verify ! ( GatewayInfoStreamResV2 ) ;
709- impl_message_verify ! ( GatewayInfoStreamResV3 ) ;
709+ impl_message_verify ! ( GatewayInfoStreamResV4 ) ;
710710
711711 #[ derive( Clone ) ]
712712 pub struct Client {
@@ -810,21 +810,21 @@ pub mod config {
810810 BoxStream < ' _ , Result < Vec < ( helium_crypto:: PublicKey , Option < HotspotInfo > ) > , Error > > ,
811811 Error ,
812812 > {
813- let mut req = GatewayInfoStreamReqV3 {
813+ let mut req = GatewayInfoStreamReqV4 {
814814 signer : self . keypair . public_key ( ) . into ( ) ,
815815 batch_size,
816816 min_updated_at : updated_since,
817817 ..Default :: default ( )
818818 } ;
819819 req. sign ( & self . keypair ) ?;
820- let streaming = self . client . info_stream_v3 ( req) . await ?. into_inner ( ) ;
820+ let streaming = self . client . info_stream_v4 ( req) . await ?. into_inner ( ) ;
821821 let streaming = streaming. map_err ( Error :: from) . and_then ( |res| {
822822 let address = self . address . clone ( ) ;
823823 async move {
824824 res. verify ( & address) ?;
825825 res. gateways
826826 . into_iter ( )
827- . map ( info_from_info_v3 )
827+ . map ( info_from_info_v4 )
828828 . collect :: < Result < Vec < _ > , _ > > ( )
829829 }
830830 } ) ;
@@ -875,13 +875,16 @@ pub mod config {
875875 created_at : info. created_at ,
876876 updated_at : info. updated_at ,
877877 location_changed_at : 0 , // Not available in V2
878+ owner : None ,
879+ owner_changed_at : 0 ,
878880 } ) ,
879881 ) )
880882 }
881883
882- fn info_from_info_v3 (
883- info : GatewayInfoV3 ,
884+ fn info_from_info_v4 (
885+ info : GatewayInfoV4 ,
884886 ) -> Result < ( helium_crypto:: PublicKey , Option < HotspotInfo > ) , Error > {
887+ use std:: str:: FromStr ;
885888 let address = info. address . try_into ( ) ?;
886889
887890 let ( device_type, mode) = match DeviceTypeV2 :: try_from ( info. device_type )
@@ -907,6 +910,12 @@ pub mod config {
907910 } )
908911 . unwrap_or ( ( None , 0 , None ) ) ;
909912
913+ let owner = if info. owner . is_empty ( ) {
914+ None
915+ } else {
916+ Some ( Pubkey :: from_str ( & info. owner ) . map_err ( DecodeError :: from) ?)
917+ } ;
918+
910919 Ok ( (
911920 address,
912921 Some ( HotspotInfo :: Mobile {
@@ -918,6 +927,8 @@ pub mod config {
918927 created_at : info. created_at ,
919928 updated_at : info. updated_at ,
920929 location_changed_at,
930+ owner,
931+ owner_changed_at : info. owner_changed_at ,
921932 } ) ,
922933 ) )
923934 }
0 commit comments