@@ -296,11 +296,9 @@ impl<'client> CertificateRecordProvider<'client> {
296
296
}
297
297
298
298
fn condition_by_epoch ( & self , epoch : & Epoch ) -> StdResult < WhereCondition > {
299
- let epoch: i64 = i64:: try_from ( epoch. 0 ) ?;
300
-
301
299
Ok ( WhereCondition :: new (
302
300
"epoch = ?*" ,
303
- vec ! [ Value :: Integer ( epoch) ] ,
301
+ vec ! [ Value :: Integer ( epoch. try_into ( ) ? ) ] ,
304
302
) )
305
303
}
306
304
@@ -385,7 +383,7 @@ protocol_message, signers, initiated_at, sealed_at)";
385
383
Value :: String ( certificate_record. message. to_owned( ) ) ,
386
384
Value :: String ( certificate_record. signature. to_owned( ) ) ,
387
385
Value :: String ( certificate_record. aggregate_verification_key. to_owned( ) ) ,
388
- Value :: Integer ( i64 :: try_from ( certificate_record. epoch. 0 ) . unwrap( ) ) ,
386
+ Value :: Integer ( certificate_record. epoch. try_into ( ) . unwrap( ) ) ,
389
387
Value :: String ( serde_json:: to_string( & certificate_record. beacon) . unwrap( ) ) ,
390
388
Value :: String ( certificate_record. protocol_version. to_owned( ) ) ,
391
389
Value :: String (
@@ -456,7 +454,7 @@ impl<'conn> MasterCertificateProvider<'conn> {
456
454
}
457
455
458
456
pub fn get_master_certificate_condition ( & self , epoch : Epoch ) -> WhereCondition {
459
- let epoch_i64: i64 = epoch. 0 . try_into ( ) . unwrap ( ) ;
457
+ let epoch_i64: i64 = epoch. try_into ( ) . unwrap ( ) ;
460
458
WhereCondition :: new (
461
459
"certificate.epoch between ?* and ?*" ,
462
460
vec ! [ Value :: Integer ( epoch_i64 - 1 ) , Value :: Integer ( epoch_i64) ] ,
@@ -685,7 +683,7 @@ mod tests {
685
683
( 3 , certificate_record. message . into ( ) ) ,
686
684
( 4 , certificate_record. signature . into ( ) ) ,
687
685
( 5 , certificate_record. aggregate_verification_key . into ( ) ) ,
688
- ( 6 , i64 :: try_from ( certificate_record. epoch . 0 ) . unwrap ( ) . into ( ) ) ,
686
+ ( 6 , Value :: Integer ( * certificate_record. epoch as i64 ) ) ,
689
687
(
690
688
7 ,
691
689
serde_json:: to_string ( & certificate_record. beacon )
@@ -878,7 +876,7 @@ mod tests {
878
876
Value :: String ( certificate_record. message) ,
879
877
Value :: String ( certificate_record. signature) ,
880
878
Value :: String ( certificate_record. aggregate_verification_key) ,
881
- Value :: Integer ( i64 :: try_from ( certificate_record. epoch. 0 ) . unwrap ( ) ) ,
879
+ Value :: Integer ( * certificate_record. epoch as i64 ) ,
882
880
Value :: String ( serde_json:: to_string( & certificate_record. beacon) . unwrap( ) ) ,
883
881
Value :: String ( certificate_record. protocol_version) ,
884
882
Value :: String (
@@ -925,7 +923,7 @@ protocol_message, signers, initiated_at, sealed_at) values \
925
923
Value :: String ( certificate_record. message) ,
926
924
Value :: String ( certificate_record. signature) ,
927
925
Value :: String ( certificate_record. aggregate_verification_key) ,
928
- Value :: Integer ( i64 :: try_from ( certificate_record. epoch. 0 ) . unwrap ( ) ) ,
926
+ Value :: Integer ( * certificate_record. epoch as i64 ) ,
929
927
Value :: String ( serde_json:: to_string( & certificate_record. beacon) . unwrap( ) ) ,
930
928
Value :: String ( certificate_record. protocol_version) ,
931
929
Value :: String (
0 commit comments