Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
buffalu committed Feb 8, 2024
1 parent ad90e3c commit e58b04e
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ pub struct BackfillTotalBlocks<'info> {
pub signer: Signer<'info>,
}

pub fn handle_backfill_total_blocks(ctx: Context<BackfillTotalBlocks>, epoch: u64, blocks_in_epoch: u32) -> Result<()> {
pub fn handle_backfill_total_blocks(
ctx: Context<BackfillTotalBlocks>,
epoch: u64,
blocks_in_epoch: u32,
) -> Result<()> {
let mut cluster_history_account = ctx.accounts.cluster_history_account.load_mut()?;

let epoch = cast_epoch(epoch);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ pub struct CopyTipDistributionAccount<'info> {
pub signer: Signer<'info>,
}

pub fn handle_copy_tip_distribution_account(ctx: Context<CopyTipDistributionAccount>, epoch: u64) -> Result<()> {
pub fn handle_copy_tip_distribution_account(
ctx: Context<CopyTipDistributionAccount>,
epoch: u64,
) -> Result<()> {
// cant set data in validator history for future epochs
if epoch > Clock::get()?.epoch {
return Err(ValidatorHistoryError::EpochOutOfRange.into());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ pub struct InitializeClusterHistoryAccount<'info> {
pub signer: Signer<'info>,
}

pub fn handle_initialize_cluster_history_account(_: Context<InitializeClusterHistoryAccount>) -> Result<()> {
pub fn handle_initialize_cluster_history_account(
_: Context<InitializeClusterHistoryAccount>,
) -> Result<()> {
Ok(())
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ pub struct InitializeValidatorHistoryAccount<'info> {
pub signer: Signer<'info>,
}

pub fn handle_initialize_validator_history_account(ctx: Context<InitializeValidatorHistoryAccount>) -> Result<()> {
pub fn handle_initialize_validator_history_account(
ctx: Context<InitializeValidatorHistoryAccount>,
) -> Result<()> {
// Need minimum 5 epochs of vote credits to be valid
let epoch_credits = VoteStateVersions::deserialize_epoch_credits(&ctx.accounts.vote_account)?;
if epoch_credits.len() < MIN_VOTE_EPOCHS {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ pub struct ReallocClusterHistoryAccount<'info> {
pub signer: Signer<'info>,
}

pub fn handle_realloc_cluster_history_account(ctx: Context<ReallocClusterHistoryAccount>) -> Result<()> {
pub fn handle_realloc_cluster_history_account(
ctx: Context<ReallocClusterHistoryAccount>,
) -> Result<()> {
let account_size = ctx.accounts.cluster_history_account.as_ref().data_len();
if account_size >= ClusterHistory::SIZE
&& !is_initialized(ctx.accounts.cluster_history_account.as_ref())?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ pub struct ReallocValidatorHistoryAccount<'info> {
pub signer: Signer<'info>,
}

pub fn handle_realloc_validator_history_account(ctx: Context<ReallocValidatorHistoryAccount>) -> Result<()> {
pub fn handle_realloc_validator_history_account(
ctx: Context<ReallocValidatorHistoryAccount>,
) -> Result<()> {
let account_size = ctx.accounts.validator_history_account.as_ref().data_len();
if account_size >= ValidatorHistory::SIZE
&& !is_initialized(ctx.accounts.validator_history_account.as_ref())?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ pub struct SetNewTipDistributionProgram<'info> {
pub admin: Signer<'info>,
}

pub fn handle_set_new_tip_distribution_program(ctx: Context<SetNewTipDistributionProgram>) -> Result<()> {
pub fn handle_set_new_tip_distribution_program(
ctx: Context<SetNewTipDistributionProgram>,
) -> Result<()> {
ctx.accounts.config.tip_distribution_program = ctx.accounts.new_tip_distribution_program.key();
Ok(())
}

0 comments on commit e58b04e

Please sign in to comment.