diff --git a/chain/chain/src/chain.rs b/chain/chain/src/chain.rs index 366aa522892..adb3d0a72ea 100644 --- a/chain/chain/src/chain.rs +++ b/chain/chain/src/chain.rs @@ -2308,7 +2308,7 @@ impl Chain { return Err(Error::InvalidGasPrice); } let minted_amount = if self.epoch_manager.is_next_block_epoch_start(&prev_hash)? { - Some(self.epoch_manager.get_epoch_minted_amount(header.next_epoch_id())?) + Some(self.epoch_manager.get_epoch_info(header.next_epoch_id())?.minted_amount()) } else { None }; diff --git a/chain/chain/src/test_utils/kv_runtime.rs b/chain/chain/src/test_utils/kv_runtime.rs index d0bcbb5241c..49c3bb19da7 100644 --- a/chain/chain/src/test_utils/kv_runtime.rs +++ b/chain/chain/src/test_utils/kv_runtime.rs @@ -858,10 +858,6 @@ impl EpochManagerAdapter for MockEpochManager { Ok(self.store.store_update()) } - fn get_epoch_minted_amount(&self, _epoch_id: &EpochId) -> Result { - Ok(0) - } - fn get_epoch_protocol_version( &self, _epoch_id: &EpochId, diff --git a/chain/client/src/client.rs b/chain/client/src/client.rs index cca83f9521c..6109c71a5be 100644 --- a/chain/client/src/client.rs +++ b/chain/client/src/client.rs @@ -765,7 +765,7 @@ impl Client { let next_epoch_id = self.epoch_manager.get_next_epoch_id_from_prev_block(&prev_hash)?; let minted_amount = if self.epoch_manager.is_next_block_epoch_start(&prev_hash)? { - Some(self.epoch_manager.get_epoch_minted_amount(&next_epoch_id)?) + Some(self.epoch_manager.get_epoch_info(&next_epoch_id)?.minted_amount()) } else { None }; diff --git a/chain/epoch-manager/src/adapter.rs b/chain/epoch-manager/src/adapter.rs index cfecd673d62..9960136f2c4 100644 --- a/chain/epoch-manager/src/adapter.rs +++ b/chain/epoch-manager/src/adapter.rs @@ -277,9 +277,6 @@ pub trait EpochManagerAdapter: Send + Sync { random_value: CryptoHash, ) -> Result; - /// Amount of tokens minted in given epoch. - fn get_epoch_minted_amount(&self, epoch_id: &EpochId) -> Result; - /// Epoch active protocol version. fn get_epoch_protocol_version(&self, epoch_id: &EpochId) -> Result; @@ -866,11 +863,6 @@ impl EpochManagerAdapter for EpochManagerHandle { epoch_manager.add_validator_proposals(block_info, random_value) } - fn get_epoch_minted_amount(&self, epoch_id: &EpochId) -> Result { - let epoch_manager = self.read(); - Ok(epoch_manager.get_epoch_info(epoch_id)?.minted_amount()) - } - fn get_epoch_protocol_version( &self, epoch_id: &EpochId,