File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ impl Ord for ChainPoint {
68
68
self . block_number
69
69
. cmp ( & other. block_number )
70
70
. then ( self . slot_number . cmp ( & other. slot_number ) )
71
+ . then ( self . block_hash . cmp ( & other. block_hash ) )
71
72
}
72
73
}
73
74
@@ -160,7 +161,7 @@ mod tests {
160
161
}
161
162
162
163
#[ test]
163
- fn chain_point_ord_cmp_block_hash_doesnt_matter ( ) {
164
+ fn chain_point_ord_cmp_if_block_number_and_slot_number_equals_then_compare_block_hash ( ) {
164
165
let chain_point1 = ChainPoint {
165
166
slot_number : 5 ,
166
167
block_number : 10 ,
@@ -172,6 +173,6 @@ mod tests {
172
173
block_hash : "hash2" . to_string ( ) ,
173
174
} ;
174
175
175
- assert_eq ! ( Ordering :: Equal , chain_point1. cmp( & chain_point2) ) ;
176
+ assert_eq ! ( Ordering :: Less , chain_point1. cmp( & chain_point2) ) ;
176
177
}
177
178
}
Original file line number Diff line number Diff line change @@ -20,12 +20,12 @@ where
20
20
/// [TimePointProvider] related errors.
21
21
#[ derive( Error , Debug ) ]
22
22
pub enum TimePointProviderError {
23
- /// Raised reading the current epoch succeeded but yield no result.
24
- #[ error( "No epoch yield by the chain observer, is your cardano node ready ?" ) ]
23
+ /// Raised when reading the current epoch succeeded but yielded no result.
24
+ #[ error( "No epoch yielded by the chain observer, is your cardano node ready?" ) ]
25
25
NoEpoch ,
26
26
27
- /// Raised reading the current chain point succeeded but yield no result.
28
- #[ error( "No chain point yield by the chain observer, is your cardano node ready ?" ) ]
27
+ /// Raised when reading the current chain point succeeded but yielded no result.
28
+ #[ error( "No chain point yielded by the chain observer, is your cardano node ready?" ) ]
29
29
NoChainPoint ,
30
30
}
31
31
You can’t perform that action at this time.
0 commit comments