diff --git a/programs/hydra/src/processors/signing/sign_metadata.rs b/programs/hydra/src/processors/signing/sign_metadata.rs index 057fcb4..310049c 100644 --- a/programs/hydra/src/processors/signing/sign_metadata.rs +++ b/programs/hydra/src/processors/signing/sign_metadata.rs @@ -52,11 +52,12 @@ pub fn sign_metadata(ctx: Context) -> Result<()> { ctx.accounts.fanout.key().as_ref(), &[*ctx.bumps.get("holding_account").unwrap()], ]], - ).map_err(|e| { - error::Error::ProgramError(ProgramErrorWithOrigin{ + ) + .map_err(|e| { + error::Error::ProgramError(ProgramErrorWithOrigin { program_error: e, error_origin: None, - compared_values: None + compared_values: None, }) })?; Ok(()) diff --git a/programs/hydra/src/processors/stake/set_for.rs b/programs/hydra/src/processors/stake/set_for.rs index f5d182a..f516e84 100644 --- a/programs/hydra/src/processors/stake/set_for.rs +++ b/programs/hydra/src/processors/stake/set_for.rs @@ -50,10 +50,7 @@ pub struct SetForTokenMemberStake<'info> { pub token_program: Program<'info, Token>, } -pub fn set_for_token_member_stake( - ctx: Context, - shares: u64, -) -> Result<()> { +pub fn set_for_token_member_stake(ctx: Context, shares: u64) -> Result<()> { let fanout = &mut ctx.accounts.fanout; let member = &ctx.accounts.member; let membership_voucher = &mut ctx.accounts.membership_voucher; diff --git a/programs/hydra/src/utils/logic/calculation.rs b/programs/hydra/src/utils/logic/calculation.rs index 61bc8f4..0bb1add 100644 --- a/programs/hydra/src/utils/logic/calculation.rs +++ b/programs/hydra/src/utils/logic/calculation.rs @@ -23,10 +23,7 @@ pub fn calculate_dist_amount( Ok(dist_amount as u64) } -pub fn update_fanout_for_add( - fanout: &mut Account, - shares: u64, -) -> Result<()> { +pub fn update_fanout_for_add(fanout: &mut Account, shares: u64) -> Result<()> { let less_shares = fanout .total_available_shares .checked_sub(shares) diff --git a/programs/hydra/src/utils/mod.rs b/programs/hydra/src/utils/mod.rs index 77853f0..6982ede 100644 --- a/programs/hydra/src/utils/mod.rs +++ b/programs/hydra/src/utils/mod.rs @@ -80,10 +80,7 @@ pub fn parse_fanout_mint( Ok(fanout_for_mint_object) } -pub fn parse_token_account( - account: &AccountInfo, - owner: &Pubkey, -) -> Result { +pub fn parse_token_account(account: &AccountInfo, owner: &Pubkey) -> Result { let ref_data = account.try_borrow_data()?; let mut account_data: &[u8] = &ref_data; let account_object = TokenAccount::try_deserialize(&mut account_data)?; diff --git a/programs/hydra/src/utils/validation/mod.rs b/programs/hydra/src/utils/validation/mod.rs index 5348abd..a45154b 100644 --- a/programs/hydra/src/utils/validation/mod.rs +++ b/programs/hydra/src/utils/validation/mod.rs @@ -32,10 +32,7 @@ pub fn assert_owned_by(account: &AccountInfo, owner: &Pubkey) -> Result<()> { } } -pub fn assert_membership_model( - fanout: &Account, - model: MembershipModel, -) -> Result<()> { +pub fn assert_membership_model(fanout: &Account, model: MembershipModel) -> Result<()> { if fanout.membership_model != model { return Err(HydraError::InvalidMembershipModel.into()); } @@ -130,7 +127,6 @@ pub fn assert_owned_by_one(account: &AccountInfo, owners: Vec<&Pubkey>) -> Resul Err(HydraError::IncorrectOwner.into()) } - #[cfg(test)] mod tests { // Note this useful idiom: importing names from outer (for mod tests) scope. @@ -143,7 +139,7 @@ mod tests { let owner2 = Pubkey::new_unique(); let ad = Pubkey::new_unique(); let actual_owner = Pubkey::new_unique(); - let lam= &mut 10000; + let lam = &mut 10000; let a = AccountInfo::new(&ad, false, false, lam, &mut [0; 0], &actual_owner, false, 0); let e = assert_owned_by_one(&a, vec![&owner, &owner2, &owner1]); @@ -153,8 +149,5 @@ mod tests { let e = assert_owned_by_one(&a, vec![&owner, &actual_owner, &owner1]); assert_eq!(e.is_ok(), true); - } - - }