@@ -11,7 +11,7 @@ pub struct CertificatePendingRecord {
11
11
pub epoch : Epoch ,
12
12
13
13
/// Pending certificate serialization as json
14
- pub certificate : String ,
14
+ pub pending_certificate : String ,
15
15
16
16
/// Date and time when the pending certificate was created
17
17
pub created_at : DateTime < Utc > ,
@@ -35,7 +35,7 @@ impl SqLiteEntity for CertificatePendingRecord {
35
35
let created_at = & row. read :: < & str , _ > ( 2 ) ;
36
36
37
37
let record = Self {
38
- certificate : pending_certificate_json. to_string ( ) ,
38
+ pending_certificate : pending_certificate_json. to_string ( ) ,
39
39
created_at : DateTime :: parse_from_rfc3339 ( created_at)
40
40
. map_err ( |e| {
41
41
HydrationError :: InvalidData ( format ! (
@@ -57,7 +57,11 @@ impl SqLiteEntity for CertificatePendingRecord {
57
57
let mut projection = Projection :: default ( ) ;
58
58
59
59
projection. add_field ( "epoch" , "{:pending_certificate:}.epoch" , "integer" ) ;
60
- projection. add_field ( "certificate" , "{:pending_certificate:}.certificate" , "text" ) ;
60
+ projection. add_field (
61
+ "pending_certificate" ,
62
+ "{:pending_certificate:}.pending_certificate" ,
63
+ "text" ,
64
+ ) ;
61
65
projection. add_field ( "created_at" , "{:pending_certificate:}.created_at" , "text" ) ;
62
66
63
67
projection
@@ -70,7 +74,7 @@ impl TryFrom<CertificatePending> for CertificatePendingRecord {
70
74
fn try_from ( value : CertificatePending ) -> Result < Self , Self :: Error > {
71
75
let record = Self {
72
76
epoch : value. epoch ,
73
- certificate : serde_json:: to_string ( & value) ?,
77
+ pending_certificate : serde_json:: to_string ( & value) ?,
74
78
created_at : Utc :: now ( ) ,
75
79
} ;
76
80
Ok ( record)
@@ -80,7 +84,7 @@ impl TryFrom<CertificatePending> for CertificatePendingRecord {
80
84
impl TryFrom < CertificatePendingRecord > for CertificatePending {
81
85
type Error = StdError ;
82
86
fn try_from ( record : CertificatePendingRecord ) -> Result < Self , Self :: Error > {
83
- let c: CertificatePending = serde_json:: from_str ( & record. certificate ) ?;
87
+ let c: CertificatePending = serde_json:: from_str ( & record. pending_certificate ) ?;
84
88
let pending_certificate = Self {
85
89
epoch : record. epoch ,
86
90
signed_entity_type : c. signed_entity_type ,
0 commit comments