@@ -18,7 +18,7 @@ use futures::stream::{self, StreamExt};
1818use iota_tls:: Allower ;
1919use iota_types:: {
2020 base_types:: IotaAddress , bridge:: BridgeSummary ,
21- iota_system_state:: iota_system_state_summary:: IotaSystemStateSummary ,
21+ iota_system_state:: iota_system_state_summary:: IotaSystemStateSummaryV2 ,
2222} ;
2323use once_cell:: sync:: Lazy ;
2424use prometheus:: { CounterVec , HistogramVec , register_counter_vec, register_histogram_vec} ;
@@ -134,7 +134,7 @@ impl IotaNodeProvider {
134134 }
135135
136136 /// get_validators will retrieve known validators
137- async fn get_validators ( url : String ) -> Result < IotaSystemStateSummary > {
137+ async fn get_validators ( url : String ) -> Result < IotaSystemStateSummaryV2 > {
138138 let rpc_method = "iotax_getLatestIotaSystemState" ;
139139 let observe = || {
140140 let timer = JSON_RPC_DURATION
@@ -174,7 +174,7 @@ impl IotaNodeProvider {
174174
175175 #[ derive( Debug , Deserialize ) ]
176176 struct ResponseBody {
177- result : IotaSystemStateSummary ,
177+ result : IotaSystemStateSummaryV2 ,
178178 }
179179
180180 let body: ResponseBody = match serde_json:: from_slice ( & raw ) {
@@ -335,7 +335,9 @@ impl IotaNodeProvider {
335335/// This type comes from a full node rpc result. See get_validators for
336336/// details. The key here, if extracted successfully, will ultimately be stored
337337/// in the allow list and let us communicate with those actual peers via tls.
338- fn extract ( summary : IotaSystemStateSummary ) -> impl Iterator < Item = ( Ed25519PublicKey , IotaPeer ) > {
338+ fn extract (
339+ summary : IotaSystemStateSummaryV2 ,
340+ ) -> impl Iterator < Item = ( Ed25519PublicKey , IotaPeer ) > {
339341 summary. active_validators . into_iter ( ) . filter_map ( |vm| {
340342 match Ed25519PublicKey :: from_bytes ( & vm. network_pubkey_bytes ) {
341343 Ok ( public_key) => {
@@ -544,9 +546,7 @@ mod tests {
544546 use iota_types:: {
545547 base_types:: IotaAddress ,
546548 bridge:: { BridgeCommitteeSummary , BridgeSummary , MoveTypeCommitteeMember } ,
547- iota_system_state:: iota_system_state_summary:: {
548- IotaSystemStateSummary , IotaValidatorSummary ,
549- } ,
549+ iota_system_state:: iota_system_state_summary:: IotaValidatorSummary ,
550550 } ;
551551 use multiaddr:: Multiaddr ;
552552 use serde:: Serialize ;
@@ -566,7 +566,7 @@ mod tests {
566566 . expect ( "expected a multiaddr value" ) ;
567567 // all fields here just satisfy the field types, with exception to
568568 // active_validators, we use some of those.
569- let depends_on = IotaSystemStateSummary {
569+ let depends_on = IotaSystemStateSummaryV2 {
570570 active_validators : vec ! [ IotaValidatorSummary {
571571 network_pubkey_bytes: Vec :: from( client_pub_key. as_bytes( ) ) ,
572572 p2p_address: format!( "{p2p_address}" ) ,
@@ -578,14 +578,14 @@ mod tests {
578578
579579 #[ derive( Debug , Serialize , Deserialize ) ]
580580 struct ResponseBody {
581- result : IotaSystemStateSummary ,
581+ result : IotaSystemStateSummaryV2 ,
582582 }
583583
584584 let r = serde_json:: to_string ( & ResponseBody { result : depends_on } )
585- . expect ( "expected to serialize ResponseBody{IotaSystemStateSummary }" ) ;
585+ . expect ( "expected to serialize ResponseBody{IotaSystemStateSummaryV2 }" ) ;
586586
587587 let deserialized = serde_json:: from_str :: < ResponseBody > ( & r)
588- . expect ( "expected to deserialize ResponseBody{IotaSystemStateSummary }" ) ;
588+ . expect ( "expected to deserialize ResponseBody{IotaSystemStateSummaryV2 }" ) ;
589589
590590 let peers = extract ( deserialized. result ) ;
591591 assert_eq ! ( peers. count( ) , 1 , "peers should have been a length of 1" ) ;
0 commit comments