@@ -57,14 +57,15 @@ fn sanity_check_subdag_with_dfs<N: Network>(subdag: &BTreeMap<u64, IndexSet<Batc
57
57
commit. entry ( certificate. round ( ) ) . or_default ( ) . insert ( certificate. clone ( ) ) ;
58
58
// Iterate over the previous certificate IDs.
59
59
for previous_certificate_id in certificate. previous_certificate_ids ( ) {
60
- let Some ( previous_certificate) = subdag. get ( & ( certificate. round ( ) - 1 ) ) . and_then ( |map| {
61
- map. iter ( ) . find ( |certificate| certificate. certificate_id ( ) == * previous_certificate_id)
62
- } ) else {
60
+ let Some ( previous_certificate) = subdag
61
+ . get ( & ( certificate. round ( ) - 1 ) )
62
+ . and_then ( |map| map. iter ( ) . find ( |certificate| certificate. id ( ) == * previous_certificate_id) )
63
+ else {
63
64
// It is either ordered or below the GC round.
64
65
continue ;
65
66
} ;
66
67
// Insert the previous certificate into the set of already ordered certificates.
67
- if !already_ordered. insert ( previous_certificate. certificate_id ( ) ) {
68
+ if !already_ordered. insert ( previous_certificate. id ( ) ) {
68
69
// If the previous certificate is already ordered, continue.
69
70
continue ;
70
71
}
@@ -108,7 +109,7 @@ impl<N: Network> Subdag<N> {
108
109
109
110
/// Returns the certificate IDs of the subdag (from earliest round to latest round).
110
111
pub fn certificate_ids ( & self ) -> impl Iterator < Item = Field < N > > + ' _ {
111
- self . values ( ) . flatten ( ) . map ( BatchCertificate :: certificate_id )
112
+ self . values ( ) . flatten ( ) . map ( BatchCertificate :: id )
112
113
}
113
114
114
115
/// Returns the leader certificate.
@@ -157,10 +158,7 @@ impl<N: Network> Subdag<N> {
157
158
// Prepare the leaves.
158
159
let leaves = cfg_iter ! ( self . subdag)
159
160
. map ( |( _, certificates) | {
160
- certificates
161
- . iter ( )
162
- . flat_map ( |certificate| certificate. certificate_id ( ) . to_bits_le ( ) )
163
- . collect :: < Vec < _ > > ( )
161
+ certificates. iter ( ) . flat_map ( |certificate| certificate. id ( ) . to_bits_le ( ) ) . collect :: < Vec < _ > > ( )
164
162
} )
165
163
. collect :: < Vec < _ > > ( ) ;
166
164
@@ -213,7 +211,7 @@ pub mod test_helpers {
213
211
for _ in 0 ..AVAILABILITY_THRESHOLD {
214
212
let certificate =
215
213
narwhal_batch_certificate:: test_helpers:: sample_batch_certificate_for_round ( starting_round, rng) ;
216
- previous_certificate_ids. insert ( certificate. certificate_id ( ) ) ;
214
+ previous_certificate_ids. insert ( certificate. id ( ) ) ;
217
215
subdag. entry ( starting_round) . or_default ( ) . insert ( certificate) ;
218
216
}
219
217
@@ -222,7 +220,7 @@ pub mod test_helpers {
222
220
for _ in 0 ..QUORUM_THRESHOLD {
223
221
let certificate =
224
222
narwhal_batch_certificate:: test_helpers:: sample_batch_certificate_for_round_with_previous_certificate_ids ( starting_round + 1 , previous_certificate_ids. clone ( ) , rng) ;
225
- previous_certificate_ids_2. insert ( certificate. certificate_id ( ) ) ;
223
+ previous_certificate_ids_2. insert ( certificate. id ( ) ) ;
226
224
subdag. entry ( starting_round + 1 ) . or_default ( ) . insert ( certificate) ;
227
225
}
228
226
0 commit comments