Skip to content

Commit

Permalink
chore(staking): 🧹 tidy epoch_handler imports
Browse files Browse the repository at this point in the history
  • Loading branch information
cratelyn committed Mar 13, 2024
1 parent 765ed75 commit aa52f6d
Showing 1 changed file with 20 additions and 26 deletions.
46 changes: 20 additions & 26 deletions crates/core/component/stake/src/component/epoch_handler.rs
Original file line number Diff line number Diff line change
@@ -1,38 +1,32 @@
use penumbra_distributions::component::StateReadExt as _;
use penumbra_sct::{component::clock::EpochRead, epoch::Epoch};
use std::collections::{BTreeMap, BTreeSet};

use super::StateWriteExt;
use crate::{
component::{
stake::{
ConsensusIndexRead, ConsensusIndexWrite, ConsensusUpdateWrite, InternalStakingData,
RateDataWrite,
},
validator_handler::{ValidatorDataRead, ValidatorDataWrite, ValidatorManager},
SlashingData,
},
rate::BaseRateData,
state_key, validator, CurrentConsensusKeys, DelegationToken, FundingStreams, IdentityKey,
Penalty, StateReadExt, BPS_SQUARED_SCALING_FACTOR,
};
use anyhow::{Context, Result};
use async_trait::async_trait;
use futures::StreamExt;
use penumbra_asset::STAKING_TOKEN_ASSET_ID;

use cnidarium::StateWrite;
use futures::TryStreamExt;
use futures::{StreamExt, TryStreamExt};
use penumbra_asset::STAKING_TOKEN_ASSET_ID;
use penumbra_distributions::component::StateReadExt as _;
use penumbra_num::{fixpoint::U128x128, Amount};
use penumbra_proto::{StateReadProto, StateWriteProto};
use penumbra_sct::{component::clock::EpochRead, epoch::Epoch};
use penumbra_shielded_pool::component::{SupplyRead, SupplyWrite};
use tendermint::validator::Update;
use tendermint::PublicKey;
use std::collections::{BTreeMap, BTreeSet};
use tendermint::{validator::Update, PublicKey};
use tokio::task::JoinSet;
use tracing::instrument;

use crate::state_key;
use crate::BPS_SQUARED_SCALING_FACTOR;
use crate::{
component::{
stake::{ConsensusUpdateWrite, InternalStakingData, RateDataWrite},
validator_handler::{ValidatorDataRead, ValidatorDataWrite, ValidatorManager},
SlashingData,
},
rate::BaseRateData,
validator, CurrentConsensusKeys, DelegationToken, FundingStreams, IdentityKey, Penalty,
StateReadExt,
};

use super::StateWriteExt;
use crate::component::stake::{ConsensusIndexRead, ConsensusIndexWrite};

#[async_trait]
pub trait EpochHandler: StateWriteExt + ConsensusIndexRead {
#[instrument(skip(self, epoch_to_end), fields(index = epoch_to_end.index))]
Expand Down

0 comments on commit aa52f6d

Please sign in to comment.