File tree Expand file tree Collapse file tree 6 files changed +13
-21
lines changed
cardano-node/mithril-cardano-node-chain/src/entities
mithril-persistence/src/database
mithril-client-cli/src/commands/cardano_stake_distribution
mithril-common/src/certificate_chain Expand file tree Collapse file tree 6 files changed +13
-21
lines changed Original file line number Diff line number Diff line change @@ -178,7 +178,8 @@ mod test {
178
178
179
179
fn dummy_tx_datum ( ) -> TxDatum {
180
180
let mut tx_datum_builder = TxDatumBuilder :: new ( ) ;
181
- let tx_datum = tx_datum_builder
181
+
182
+ tx_datum_builder
182
183
. add_field ( TxDatumFieldValue :: Bytes ( "bytes0" . to_string ( ) ) )
183
184
. add_field ( TxDatumFieldValue :: Int ( 0 ) )
184
185
. add_field ( TxDatumFieldValue :: Int ( 1 ) )
@@ -187,8 +188,7 @@ mod test {
187
188
. add_field ( TxDatumFieldValue :: Int ( 2 ) )
188
189
. add_field ( TxDatumFieldValue :: Bytes ( "012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" . to_string ( ) ) )
189
190
. build ( )
190
- . expect ( "tx_datum build should not fail" ) ;
191
- tx_datum
191
+ . expect ( "tx_datum build should not fail" )
192
192
}
193
193
194
194
#[ test]
Original file line number Diff line number Diff line change @@ -36,15 +36,13 @@ pub fn extract_doc_comment(attrs: &[syn::Attribute]) -> Vec<String> {
36
36
} )
37
37
. skip_while ( |s| is_blank ( s) )
38
38
. flat_map ( |s| {
39
- let lines = s
40
- . split ( '\n' )
39
+ s. split ( '\n' )
41
40
. map ( |s| {
42
41
// remove one leading space no matter what
43
42
let s = s. strip_prefix ( ' ' ) . unwrap_or ( s) ;
44
43
s. to_owned ( )
45
44
} )
46
- . collect :: < Vec < _ > > ( ) ;
47
- lines
45
+ . collect :: < Vec < _ > > ( )
48
46
} )
49
47
. collect ( ) ;
50
48
Original file line number Diff line number Diff line change @@ -125,14 +125,12 @@ fn format_field(field: &syn::Field) -> FieldInfo {
125
125
_ => true ,
126
126
} ;
127
127
128
- let field_info = FieldInfo {
128
+ FieldInfo {
129
129
name : field. ident . as_ref ( ) . unwrap ( ) . to_string ( ) ,
130
130
doc,
131
131
example,
132
132
is_mandatory,
133
- } ;
134
-
135
- field_info
133
+ }
136
134
}
137
135
138
136
/// To extract doc from a struct.
Original file line number Diff line number Diff line change @@ -303,16 +303,15 @@ mod tests {
303
303
304
304
fn get_table_whatever_column_count ( connection : & SqliteConnection ) -> i64 {
305
305
let sql = "select count(*) as column_count from pragma_table_info('whatever');" ;
306
- let column_count = connection
306
+
307
+ connection
307
308
. prepare ( sql)
308
309
. unwrap ( )
309
310
. iter ( )
310
311
. next ( )
311
312
. unwrap ( )
312
313
. unwrap ( )
313
- . read :: < i64 , _ > ( 0 ) ;
314
-
315
- column_count
314
+ . read :: < i64 , _ > ( 0 )
316
315
}
317
316
318
317
fn create_db_checker ( connection : & ConnectionThreadSafe ) -> DatabaseVersionChecker {
Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ impl CardanoStakeDistributionDownloadCommand {
161
161
client : & Client ,
162
162
unique_identifier : & str ,
163
163
) -> MithrilResult < CardanoStakeDistribution > {
164
- let cardano_stake_distribution = if Self :: is_sha256_hash ( unique_identifier) {
164
+ if Self :: is_sha256_hash ( unique_identifier) {
165
165
client
166
166
. cardano_stake_distribution ( )
167
167
. get ( unique_identifier)
@@ -212,9 +212,7 @@ impl CardanoStakeDistributionDownloadCommand {
212
212
"No Cardano stake distribution could be found for epoch: '{}'" ,
213
213
epoch
214
214
) )
215
- } ;
216
-
217
- cardano_stake_distribution
215
+ }
218
216
}
219
217
}
220
218
Original file line number Diff line number Diff line change @@ -1104,9 +1104,8 @@ mod tests {
1104
1104
. to_owned ( )
1105
1105
. try_new_with_protocol_parameters ( forged_protocol_parameters. clone ( ) )
1106
1106
. unwrap ( ) ;
1107
- let signature = s_adversary. protocol_signer . sign ( signed_message. as_bytes ( ) ) ;
1108
1107
1109
- signature
1108
+ s_adversary . protocol_signer . sign ( signed_message . as_bytes ( ) )
1110
1109
} )
1111
1110
. collect :: < Vec < _ > > ( ) ;
1112
1111
let forged_clerk = ProtocolClerk :: from_registration (
You can’t perform that action at this time.
0 commit comments