Skip to content

Commit 342741b

Browse files
committed
fix: remove unused GetBlocksMintedByPools query from epochs_state
1 parent 8995074 commit 342741b

File tree

3 files changed

+0
-20
lines changed

3 files changed

+0
-20
lines changed

common/src/queries/epochs.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ pub enum EpochsStateQuery {
1515
GetEpochBlockDistributionByPool { epoch_number: u64 },
1616

1717
// Pools related queries
18-
GetBlocksMintedByPools { vrf_key_hashes: Vec<KeyHash> },
1918
GetTotalBlocksMintedByPools { vrf_key_hashes: Vec<KeyHash> },
2019
GetBlocksMintedInfoByPool { vrf_key_hash: KeyHash },
2120
GetBlockHashesByPool { vrf_key_hash: KeyHash },
@@ -33,7 +32,6 @@ pub enum EpochsStateQueryResponse {
3332
EpochBlockDistributionByPool(EpochBlockDistributionByPool),
3433

3534
// Pools related responses
36-
BlocksMintedByPools(Vec<u64>),
3735
TotalBlocksMintedByPools(Vec<u64>),
3836
BlocksMintedInfoByPool(BlocksMintedInfoByPool),
3937
BlockHashesByPool(Vec<BlockHash>),

modules/epochs_state/src/epochs_state.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,12 +230,6 @@ impl EpochsState {
230230
}
231231
}
232232

233-
EpochsStateQuery::GetBlocksMintedByPools { vrf_key_hashes } => {
234-
EpochsStateQueryResponse::BlocksMintedByPools(
235-
state.get_blocks_minted_by_pools(vrf_key_hashes),
236-
)
237-
}
238-
239233
EpochsStateQuery::GetTotalBlocksMintedByPools { vrf_key_hashes } => {
240234
EpochsStateQueryResponse::TotalBlocksMintedByPools(
241235
state.get_total_blocks_minted_by_pools(vrf_key_hashes),

modules/epochs_state/src/state.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,6 @@ impl State {
113113
}
114114
}
115115

116-
/// Get current epoch's blocks minted for each vrf key hash
117-
pub fn get_blocks_minted_by_pools(&self, vrf_key_hashes: &Vec<KeyHash>) -> Vec<u64> {
118-
vrf_key_hashes
119-
.iter()
120-
.map(|key_hash| self.blocks_minted.get(key_hash).map(|v| *v as u64).unwrap_or(0))
121-
.collect()
122-
}
123-
124116
/// Get epoch's total blocks minted for each vrf key hash till current block number
125117
pub fn get_total_blocks_minted_by_pools(&self, vrf_key_hashes: &Vec<KeyHash>) -> Vec<u64> {
126118
vrf_key_hashes
@@ -330,10 +322,6 @@ mod tests {
330322
let state = history.lock().await.get_current_state();
331323
assert_eq!(state.epoch_blocks, 1);
332324
assert_eq!(state.epoch_fees, 123);
333-
assert_eq!(
334-
1,
335-
state.get_blocks_minted_by_pools(&vec![keyhash(b"vrf_1")])[0]
336-
);
337325
assert_eq!(
338326
3,
339327
state.get_total_blocks_minted_by_pools(&vec![keyhash(b"vrf_1")])[0]

0 commit comments

Comments
 (0)