@@ -168,16 +168,10 @@ impl<'client> SignerRegistrationRecordProvider<'client> {
168
168
Self { client }
169
169
}
170
170
171
- fn condition_by_signer_id_and_epoch (
172
- & self ,
173
- signer_id : String ,
174
- epoch : & Epoch ,
175
- ) -> Result < WhereCondition , StdError > {
176
- let epoch = i64:: try_from ( epoch. 0 ) . unwrap ( ) ;
177
-
171
+ fn condition_by_signer_id ( & self , signer_id : String ) -> Result < WhereCondition , StdError > {
178
172
Ok ( WhereCondition :: new (
179
- "signer_id = ?1 and epoch_setting_id = ?2 " ,
180
- vec ! [ Value :: String ( signer_id) , Value :: Integer ( epoch ) ] ,
173
+ "signer_id = ?* " ,
174
+ vec ! [ Value :: String ( signer_id) ] ,
181
175
) )
182
176
}
183
177
@@ -196,7 +190,9 @@ impl<'client> SignerRegistrationRecordProvider<'client> {
196
190
signer_id : String ,
197
191
epoch : & Epoch ,
198
192
) -> Result < EntityCursor < SignerRegistrationRecord > , StdError > {
199
- let filters = self . condition_by_signer_id_and_epoch ( signer_id, epoch) ?;
193
+ let filters = self
194
+ . condition_by_signer_id ( signer_id) ?
195
+ . and_where ( self . condition_by_epoch ( epoch) ?) ;
200
196
let signer_registration_record = self . find ( filters) ?;
201
197
202
198
Ok ( signer_registration_record)
@@ -252,7 +248,7 @@ impl<'conn> UpdateSignerRegistrationRecordProvider<'conn> {
252
248
signer_registration_record : SignerRegistrationRecord ,
253
249
) -> WhereCondition {
254
250
WhereCondition :: new (
255
- "(signer_id, epoch_setting_id, verification_key, verification_key_signature, operational_certificate, kes_period, stake, created_at) values (?1 , ?2 , ?3 , ?4 , ?5 , ?6 , ?7 , ?8 )" ,
251
+ "(signer_id, epoch_setting_id, verification_key, verification_key_signature, operational_certificate, kes_period, stake, created_at) values (?* , ?* , ?* , ?* , ?* , ?* , ?* , ?* )" ,
256
252
vec ! [
257
253
Value :: String ( signer_registration_record. signer_id) ,
258
254
Value :: Integer (
0 commit comments