File tree Expand file tree Collapse file tree 2 files changed +6
-13
lines changed
mithril-aggregator/src/database Expand file tree Collapse file tree 2 files changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -151,6 +151,7 @@ create table open_message (
151
151
// Migration 6
152
152
// Add the `signer_registration` table and migration data from the previous
153
153
// `verification_key` JSON format.
154
+ // TODO: activate FK w/ signer table exists `foreign key (signer_id) references signer(signer_id)`
154
155
SqlMigration :: new(
155
156
6 ,
156
157
r#"
@@ -164,9 +165,7 @@ create table signer_registration (
164
165
stake integer,
165
166
created_at text not null default current_timestamp,
166
167
primary key (epoch_setting_id, signer_id)
167
- -- TODO: activate FK w/ signer table exists
168
- -- foreign key (signer_id) references signer(signer_id)
169
- foreign key (epoch_setting_id) references epoch_settings(epoch_setting_id)
168
+ foreign key (epoch_setting_id) references epoch_setting(epoch_setting_id)
170
169
);
171
170
create table if not exists verification_key (key_hash text primary key, key json not null, value json not null);
172
171
insert into signer_registration (signer_id,
Original file line number Diff line number Diff line change @@ -653,22 +653,16 @@ mod tests {
653
653
}
654
654
655
655
#[ test]
656
- fn get_signer_registration_record_by_signer_id_and_epoch ( ) {
656
+ fn get_signer_registration_record_by_signer_id ( ) {
657
657
let connection = Connection :: open ( ":memory:" ) . unwrap ( ) ;
658
658
let provider = SignerRegistrationRecordProvider :: new ( & connection) ;
659
659
let condition = provider
660
- . condition_by_signer_id_and_epoch ( "signer-123" . to_string ( ) , & Epoch ( 1 ) )
660
+ . condition_by_signer_id ( "signer-123" . to_string ( ) )
661
661
. unwrap ( ) ;
662
662
let ( filter, values) = condition. expand ( ) ;
663
663
664
- assert_eq ! (
665
- "signer_id = ?1 and epoch_setting_id = ?2" . to_string( ) ,
666
- filter
667
- ) ;
668
- assert_eq ! (
669
- vec![ Value :: String ( "signer-123" . to_string( ) ) , Value :: Integer ( 1 ) ] ,
670
- values
671
- ) ;
664
+ assert_eq ! ( "signer_id = ?1" . to_string( ) , filter) ;
665
+ assert_eq ! ( vec![ Value :: String ( "signer-123" . to_string( ) ) ] , values) ;
672
666
}
673
667
674
668
#[ test]
You can’t perform that action at this time.
0 commit comments