Skip to content

Commit

Permalink
Remove unneeded helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
tonton-sol committed Aug 25, 2024
1 parent 8f0d965 commit b5ce98d
Showing 1 changed file with 12 additions and 20 deletions.
32 changes: 12 additions & 20 deletions token/program-2022-test/tests/transfer_hook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,25 +356,6 @@ async fn setup_with_fee(mint: Keypair, program_id: &Pubkey, authority: &Pubkey)
context
}

fn test_transfer_fee() -> TransferFee {
TransferFee {
epoch: 0.into(),
transfer_fee_basis_points: TEST_FEE_BASIS_POINTS.into(),
maximum_fee: TEST_MAXIMUM_FEE.into(),
}
}

fn test_transfer_fee_config() -> TransferFeeConfig {
let transfer_fee = test_transfer_fee();
TransferFeeConfig {
transfer_fee_config_authority: COption::Some(Pubkey::new_unique()).try_into().unwrap(),
withdraw_withheld_authority: COption::Some(Pubkey::new_unique()).try_into().unwrap(),
withheld_amount: 0.into(),
older_transfer_fee: transfer_fee,
newer_transfer_fee: transfer_fee,
}
}

async fn setup_with_confidential_transfers(
mint: Keypair,
program_id: &Pubkey,
Expand Down Expand Up @@ -682,7 +663,18 @@ async fn success_transfer_with_fee() {
let (alice_account, bob_account) =
setup_accounts(&token_context, Keypair::new(), Keypair::new(), alice_amount).await;

let transfer_fee_config = test_transfer_fee_config();
let transfer_fee = TransferFee {
epoch: 0.into(),
transfer_fee_basis_points: TEST_FEE_BASIS_POINTS.into(),
maximum_fee: TEST_MAXIMUM_FEE.into(),
};
let transfer_fee_config = TransferFeeConfig {
transfer_fee_config_authority: COption::Some(Pubkey::new_unique()).try_into().unwrap(),
withdraw_withheld_authority: COption::Some(Pubkey::new_unique()).try_into().unwrap(),
withheld_amount: 0.into(),
older_transfer_fee: transfer_fee,
newer_transfer_fee: transfer_fee,
};
let fee = transfer_fee_config
.calculate_epoch_fee(0, transfer_amount)
.unwrap();
Expand Down

0 comments on commit b5ce98d

Please sign in to comment.