Skip to content

Commit b0d65fa

Browse files
committed
🚨 Fixing linter warnings
1 parent bf0cf12 commit b0d65fa

File tree

3 files changed

+32
-17
lines changed

3 files changed

+32
-17
lines changed

crates/programs/bolt-component/src/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,15 @@ pub mod bolt_component {
2222
Ok(())
2323
}
2424

25-
pub fn delegate(_ctx: Context<DelegateInput>, _commit_frequency_ms: u32, _validator: Option<Pubkey>) -> Result<()> {
25+
pub fn delegate(
26+
_ctx: Context<DelegateInput>,
27+
_commit_frequency_ms: u32,
28+
_validator: Option<Pubkey>,
29+
) -> Result<()> {
2630
Ok(())
2731
}
2832
}
2933

30-
3134
#[derive(Accounts)]
3235
pub struct DelegateInput<'info> {
3336
#[account(mut)]

crates/programs/world/src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ pub enum WorldError {
1717
#[msg("The component owner does not match the program")]
1818
InvalidComponentOwner,
1919
#[msg("Invalid buffer account")]
20-
InvalidBufferAccount
20+
InvalidBufferAccount,
2121
}

crates/programs/world/src/lib.rs

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,11 @@ pub mod world {
277277
from: ctx.accounts.payer.to_account_info(),
278278
to: ctx.accounts.buffer.to_account_info(),
279279
},
280-
&[&[b"buffer", ctx.accounts.data.key.as_ref(), &[ctx.bumps.buffer]]],
280+
&[&[
281+
b"buffer",
282+
ctx.accounts.data.key.as_ref(),
283+
&[ctx.bumps.buffer],
284+
]],
281285
),
282286
lamports,
283287
size as u64,
@@ -288,7 +292,11 @@ pub mod world {
288292
Ok(())
289293
}
290294

291-
pub fn delegate_component(ctx: Context<DelegateComponent>, commit_frequency_ms: u32, validator: Option<Pubkey>) -> Result<()> {
295+
pub fn delegate_component(
296+
ctx: Context<DelegateComponent>,
297+
commit_frequency_ms: u32,
298+
validator: Option<Pubkey>,
299+
) -> Result<()> {
292300
let pda_seeds: &[&[u8]] = &[b"buffer", &ctx.accounts.component.key().to_bytes()];
293301

294302
let del_accounts = ephemeral_rollups_sdk::cpi::DelegateAccounts {
@@ -307,11 +315,7 @@ pub mod world {
307315
validator,
308316
};
309317

310-
ephemeral_rollups_sdk::cpi::delegate_account(
311-
del_accounts,
312-
pda_seeds,
313-
config,
314-
)?;
318+
ephemeral_rollups_sdk::cpi::delegate_account(del_accounts, pda_seeds, config)?;
315319

316320
bolt_component::cpi::delegate(
317321
CpiContext::new(
@@ -325,11 +329,11 @@ pub mod world {
325329
delegation_metadata: ctx.accounts.delegation_metadata.to_account_info(),
326330
delegation_record: ctx.accounts.delegation_record.to_account_info(),
327331
delegation_program: ctx.accounts.delegation_program.to_account_info(),
328-
system_program: ctx.accounts.system_program.to_account_info()
329-
}
332+
system_program: ctx.accounts.system_program.to_account_info(),
333+
},
330334
),
331335
commit_frequency_ms,
332-
validator
336+
validator,
333337
)?;
334338

335339
Ok(())
@@ -374,7 +378,6 @@ pub mod world {
374378
/// CHECK:`
375379
#[account(mut)]
376380
pub buffer_delegation_metadata: AccountInfo<'info>,
377-
378381
}
379382

380383
pub fn destroy_component(ctx: Context<DestroyComponent>) -> Result<()> {
@@ -509,7 +512,10 @@ fn apply_impl<'info>(
509512

510513
require!(buffer.data_len() == 0, WorldError::InvalidBufferAccount);
511514

512-
let index = remaining_accounts.iter().position(|x| x.key() == ID).unwrap_or(remaining_accounts.len());
515+
let index = remaining_accounts
516+
.iter()
517+
.position(|x| x.key() == ID)
518+
.unwrap_or(remaining_accounts.len());
513519

514520
// Authority check against component metadata (partial deserialize)
515521
for component in remaining_accounts[..index].iter().skip(1).step_by(2) {
@@ -590,7 +596,13 @@ fn apply_impl<'info>(
590596
}
591597
}
592598

593-
let cpi_remaining_accounts = remaining_accounts[..index].iter().skip(1).step_by(2).chain(remaining_accounts[index..].iter().skip(1)).cloned().collect::<Vec<_>>();
599+
let cpi_remaining_accounts = remaining_accounts[..index]
600+
.iter()
601+
.skip(1)
602+
.step_by(2)
603+
.chain(remaining_accounts[index..].iter().skip(1))
604+
.cloned()
605+
.collect::<Vec<_>>();
594606
bolt_system::cpi::bolt_execute(
595607
cpi_context.with_remaining_accounts(cpi_remaining_accounts),
596608
args,
@@ -745,7 +757,7 @@ pub struct InitializeComponent<'info> {
745757
pub system_program: Program<'info, System>,
746758
/// CHECK: Buffer account
747759
#[account(mut, seeds = [b"buffer", data.key.as_ref()], bump)]
748-
pub buffer: UncheckedAccount<'info>
760+
pub buffer: UncheckedAccount<'info>,
749761
}
750762

751763
impl<'info> InitializeComponent<'info> {

0 commit comments

Comments
 (0)