File tree Expand file tree Collapse file tree 1 file changed +22
-2
lines changed
mithril-aggregator/src/database/repository Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -119,9 +119,29 @@ mod test {
119
119
#[ tokio:: test]
120
120
async fn update_certificate_pending ( ) {
121
121
let store = get_certificate_pending_store ( true ) . await ;
122
- let certificate_pending = store. get ( ) . await . unwrap ( ) . unwrap ( ) ;
122
+ let old_certificate_pending = CertificatePending :: new (
123
+ Epoch ( 2 ) ,
124
+ SignedEntityType :: MithrilStakeDistribution ( Epoch ( 2 ) ) ,
125
+ fake_data:: protocol_parameters ( ) ,
126
+ fake_data:: protocol_parameters ( ) ,
127
+ fake_data:: signers ( 1 ) ,
128
+ fake_data:: signers ( 2 ) ,
129
+ ) ;
130
+ assert ! ( store. save( old_certificate_pending) . await . is_ok( ) ) ;
123
131
124
- assert ! ( store. save( certificate_pending) . await . is_ok( ) ) ;
132
+ let new_certificate_pending = CertificatePending :: new (
133
+ Epoch ( 4 ) ,
134
+ SignedEntityType :: MithrilStakeDistribution ( Epoch ( 4 ) ) ,
135
+ fake_data:: protocol_parameters ( ) ,
136
+ fake_data:: protocol_parameters ( ) ,
137
+ fake_data:: signers ( 3 ) ,
138
+ fake_data:: signers ( 1 ) ,
139
+ ) ;
140
+
141
+ assert ! ( store. save( new_certificate_pending. clone( ) ) . await . is_ok( ) ) ;
142
+
143
+ let certificate_pending = store. get ( ) . await . unwrap ( ) . unwrap ( ) ;
144
+ assert_eq ! ( new_certificate_pending, certificate_pending) ;
125
145
}
126
146
127
147
#[ tokio:: test]
You can’t perform that action at this time.
0 commit comments