File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed
chainstate/nakamoto/tests Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -1100,8 +1100,10 @@ impl BurnchainIndexer for BitcoinIndexer {
1100
1100
start_height : u64 ,
1101
1101
end_height : Option < u64 > ,
1102
1102
) -> Result < u64 , burnchain_error > {
1103
- if end_height. is_some ( ) && end_height <= Some ( start_height) {
1104
- return Ok ( end_height. unwrap ( ) ) ;
1103
+ if let Some ( end_height) = end_height {
1104
+ if end_height <= start_height {
1105
+ return Ok ( end_height) ;
1106
+ }
1105
1107
}
1106
1108
1107
1109
let new_height = self
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ impl BurnchainDB {
59
59
let sql = "SELECT op FROM burnchain_db_block_ops WHERE block_hash = ?1" ;
60
60
let args = params ! [ block_hash] ;
61
61
let mut ops: Vec < BlockstackOperationType > = query_rows ( & self . conn , sql, args) ?;
62
- ops. sort_by ( |a , b| a . vtxindex ( ) . cmp ( & b . vtxindex ( ) ) ) ;
62
+ ops. sort_by_key ( |op| op . vtxindex ( ) ) ;
63
63
Ok ( ops)
64
64
}
65
65
Original file line number Diff line number Diff line change @@ -3049,7 +3049,7 @@ fn filter_one_transaction_per_signer_duplicate_nonces() {
3049
3049
txs. clone ( ) ,
3050
3050
) ;
3051
3051
let filtered_txs: Vec < _ > = filtered_transactions. into_values ( ) . collect ( ) ;
3052
- txs. sort_by ( |a , b| a . txid ( ) . cmp ( & b . txid ( ) ) ) ;
3052
+ txs. sort_by_key ( |tx| tx . txid ( ) ) ;
3053
3053
assert_eq ! ( filtered_txs. len( ) , 1 ) ;
3054
3054
assert ! ( filtered_txs. contains( & txs. first( ) . expect( "failed to get first tx" ) ) ) ;
3055
3055
}
You can’t perform that action at this time.
0 commit comments