@@ -12,7 +12,6 @@ pub mod validator;
1212use std:: {
1313 convert:: TryFrom ,
1414 fmt:: { Display , Formatter } ,
15- future:: Future ,
1615 sync:: Arc ,
1716} ;
1817
@@ -142,11 +141,8 @@ impl CatalystSignedDocument {
142141 /// # Errors
143142 ///
144143 /// Returns a report of verification failures and the source error.
145- pub async fn verify < P , T > ( & self , pk_getter : P ) -> Result < ( ) , CatalystSignedDocError >
146- where
147- P : Fn ( & IdUri ) -> T ,
148- T : Future < Output = Option < VerifyingKey > > ,
149- {
144+ pub fn verify < P > ( & self , pk_getter : P ) -> Result < ( ) , CatalystSignedDocError >
145+ where P : Fn ( & IdUri ) -> Option < VerifyingKey > {
150146 let report = ProblemReport :: new ( "Catalyst Signed Document Verification" ) ;
151147
152148 let cose_sign = match self . as_cose_sign ( ) {
@@ -161,7 +157,7 @@ impl CatalystSignedDocument {
161157 } ;
162158
163159 for ( signature, kid) in self . signatures ( ) . cose_signatures_with_kids ( ) {
164- match pk_getter ( kid) . await {
160+ match pk_getter ( kid) {
165161 Some ( pk) => {
166162 let tbs_data = cose_sign. tbs_data ( & [ ] , signature) ;
167163 match signature. signature . as_slice ( ) . try_into ( ) {
@@ -408,8 +404,8 @@ mod tests {
408404 assert_eq ! ( decoded. doc_meta( ) , metadata. extra( ) ) ;
409405 }
410406
411- #[ tokio :: test]
412- async fn signature_verification_test ( ) {
407+ #[ test]
408+ fn signature_verification_test ( ) {
413409 let mut csprng = OsRng ;
414410 let sk: SigningKey = SigningKey :: generate ( & mut csprng) ;
415411 let content = serde_json:: to_vec ( & serde_json:: Value :: Null ) . unwrap ( ) ;
@@ -430,8 +426,8 @@ mod tests {
430426 . build ( )
431427 . unwrap ( ) ;
432428
433- assert ! ( signed_doc. verify( |_| async { Some ( pk) } ) . await . is_ok( ) ) ;
429+ assert ! ( signed_doc. verify( |_| Some ( pk) ) . is_ok( ) ) ;
434430
435- assert ! ( signed_doc. verify( |_| async { None } ) . await . is_err( ) ) ;
431+ assert ! ( signed_doc. verify( |_| None ) . is_err( ) ) ;
436432 }
437433}
0 commit comments