@@ -16,11 +16,13 @@ use thiserror::Error;
1616use mithril_common:: {
1717 certificate_chain:: { CertificateRetriever , CertificateRetrieverError } ,
1818 entities:: { Certificate , Snapshot } ,
19- messages:: { CertificateMessage , SnapshotMessage } ,
19+ messages:: { CertificateMessage , SnapshotListMessage , SnapshotMessage } ,
2020 MITHRIL_API_VERSION ,
2121} ;
2222
23- use crate :: { FromCertificateMessageAdapter , FromSnapshotMessageAdapter } ;
23+ use crate :: {
24+ FromCertificateMessageAdapter , FromSnapshotListMessageAdapter , FromSnapshotMessageAdapter ,
25+ } ;
2426
2527/// [AggregatorHandler] related errors.
2628#[ derive( Error , Debug ) ]
@@ -173,8 +175,8 @@ impl AggregatorHandler for AggregatorHTTPClient {
173175
174176 match response {
175177 Ok ( response) => match response. status ( ) {
176- StatusCode :: OK => match response. json :: < Vec < Snapshot > > ( ) . await {
177- Ok ( snapshots) => Ok ( snapshots) ,
178+ StatusCode :: OK => match response. json :: < SnapshotListMessage > ( ) . await {
179+ Ok ( snapshots) => Ok ( FromSnapshotListMessageAdapter :: adapt ( snapshots) ) ,
178180 Err ( err) => Err ( AggregatorHandlerError :: JsonParseFailed ( err. to_string ( ) ) ) ,
179181 } ,
180182 StatusCode :: PRECONDITION_FAILED => Err ( self . handle_api_error ( & response) ) ,
0 commit comments