@@ -84,7 +84,7 @@ pub struct CommitteeLengths {
8484
8585impl CommitteeLengths {
8686 /// Instantiate `Self` using `state.current_epoch()`.
87- pub fn new < T : EthSpec > ( state : & BeaconState < T > , spec : & ChainSpec ) -> Result < Self , Error > {
87+ pub fn new < E : EthSpec > ( state : & BeaconState < E > , spec : & ChainSpec ) -> Result < Self , Error > {
8888 let active_validator_indices_len = if let Ok ( committee_cache) =
8989 state. committee_cache ( RelativeEpoch :: Current )
9090 {
@@ -102,21 +102,21 @@ impl CommitteeLengths {
102102 }
103103
104104 /// Get the count of committees per each slot of `self.epoch`.
105- pub fn get_committee_count_per_slot < T : EthSpec > (
105+ pub fn get_committee_count_per_slot < E : EthSpec > (
106106 & self ,
107107 spec : & ChainSpec ,
108108 ) -> Result < usize , Error > {
109- T :: get_committee_count_per_slot ( self . active_validator_indices_len , spec) . map_err ( Into :: into)
109+ E :: get_committee_count_per_slot ( self . active_validator_indices_len , spec) . map_err ( Into :: into)
110110 }
111111
112112 /// Get the length of the committee at the given `slot` and `committee_index`.
113- pub fn get_committee_length < T : EthSpec > (
113+ pub fn get_committee_length < E : EthSpec > (
114114 & self ,
115115 slot : Slot ,
116116 committee_index : CommitteeIndex ,
117117 spec : & ChainSpec ,
118118 ) -> Result < CommitteeLength , Error > {
119- let slots_per_epoch = T :: slots_per_epoch ( ) ;
119+ let slots_per_epoch = E :: slots_per_epoch ( ) ;
120120 let request_epoch = slot. epoch ( slots_per_epoch) ;
121121
122122 // Sanity check.
@@ -128,7 +128,7 @@ impl CommitteeLengths {
128128 }
129129
130130 let slots_per_epoch = slots_per_epoch as usize ;
131- let committees_per_slot = self . get_committee_count_per_slot :: < T > ( spec) ?;
131+ let committees_per_slot = self . get_committee_count_per_slot :: < E > ( spec) ?;
132132 let index_in_epoch = compute_committee_index_in_epoch (
133133 slot,
134134 slots_per_epoch,
@@ -162,7 +162,7 @@ pub struct AttesterCacheValue {
162162
163163impl AttesterCacheValue {
164164 /// Instantiate `Self` using `state.current_epoch()`.
165- pub fn new < T : EthSpec > ( state : & BeaconState < T > , spec : & ChainSpec ) -> Result < Self , Error > {
165+ pub fn new < E : EthSpec > ( state : & BeaconState < E > , spec : & ChainSpec ) -> Result < Self , Error > {
166166 let current_justified_checkpoint = state. current_justified_checkpoint ( ) ;
167167 let committee_lengths = CommitteeLengths :: new ( state, spec) ?;
168168 Ok ( Self {
@@ -172,14 +172,14 @@ impl AttesterCacheValue {
172172 }
173173
174174 /// Get the justified checkpoint and committee length for some `slot` and `committee_index`.
175- fn get < T : EthSpec > (
175+ fn get < E : EthSpec > (
176176 & self ,
177177 slot : Slot ,
178178 committee_index : CommitteeIndex ,
179179 spec : & ChainSpec ,
180180 ) -> Result < ( JustifiedCheckpoint , CommitteeLength ) , Error > {
181181 self . committee_lengths
182- . get_committee_length :: < T > ( slot, committee_index, spec)
182+ . get_committee_length :: < E > ( slot, committee_index, spec)
183183 . map ( |committee_length| ( self . current_justified_checkpoint , committee_length) )
184184 }
185185}
@@ -216,12 +216,12 @@ impl AttesterCacheKey {
216216 /// ## Errors
217217 ///
218218 /// May error if `epoch` is out of the range of `state.block_roots`.
219- pub fn new < T : EthSpec > (
219+ pub fn new < E : EthSpec > (
220220 epoch : Epoch ,
221- state : & BeaconState < T > ,
221+ state : & BeaconState < E > ,
222222 latest_block_root : Hash256 ,
223223 ) -> Result < Self , Error > {
224- let slots_per_epoch = T :: slots_per_epoch ( ) ;
224+ let slots_per_epoch = E :: slots_per_epoch ( ) ;
225225 let decision_slot = epoch. start_slot ( slots_per_epoch) . saturating_sub ( 1_u64 ) ;
226226
227227 let decision_root = if decision_slot. epoch ( slots_per_epoch) == epoch {
@@ -255,7 +255,7 @@ pub struct AttesterCache {
255255impl AttesterCache {
256256 /// Get the justified checkpoint and committee length for the `slot` and `committee_index` in
257257 /// the state identified by the cache `key`.
258- pub fn get < T : EthSpec > (
258+ pub fn get < E : EthSpec > (
259259 & self ,
260260 key : & AttesterCacheKey ,
261261 slot : Slot ,
@@ -265,14 +265,14 @@ impl AttesterCache {
265265 self . cache
266266 . read ( )
267267 . get ( key)
268- . map ( |cache_item| cache_item. get :: < T > ( slot, committee_index, spec) )
268+ . map ( |cache_item| cache_item. get :: < E > ( slot, committee_index, spec) )
269269 . transpose ( )
270270 }
271271
272272 /// Cache the `state.current_epoch()` values if they are not already present in the state.
273- pub fn maybe_cache_state < T : EthSpec > (
273+ pub fn maybe_cache_state < E : EthSpec > (
274274 & self ,
275- state : & BeaconState < T > ,
275+ state : & BeaconState < E > ,
276276 latest_block_root : Hash256 ,
277277 spec : & ChainSpec ,
278278 ) -> Result < ( ) , Error > {
0 commit comments