Skip to content

Commit

Permalink
fix test to include transfer_fee calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
urieltan committed Oct 23, 2024
1 parent 7ad2f3e commit c412431
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 4 additions & 1 deletion tests/locker_utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
createAssociatedTokenAccountInstruction,
getAssociatedTokenAddressSync,
getEpochFee,
getMint,
getTransferFeeConfig,
TOKEN_2022_PROGRAM_ID,
TOKEN_PROGRAM_ID,
Expand Down Expand Up @@ -586,7 +587,9 @@ export async function cancelVestingPlan(
.signers([signer])
.rpc();

const feeConfig = getTransferFeeConfig(escrowState.tokenMint);
const feeConfig = getTransferFeeConfig(
await getMint(program.provider.connection, escrowState.tokenMint)
);
const epoch = BigInt(await getCurrentEpoch(program.provider.connection));
const creator_fee = feeConfig
? Number(
Expand Down
2 changes: 0 additions & 2 deletions tests/v2/test_cancel_with_harvest_fees.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import { ADMIN, createMintTransaction } from "../locker_utils/token_2022/mint";

const provider = anchor.AnchorProvider.env();
provider.opts.commitment = "confirmed";
const FEE = 100; // 100 BPS
const MAX_FEE = 10000;

describe("[V2] Cancel, with transfer fees and harvesting", () => {
let TOKEN: web3.PublicKey;
Expand Down

0 comments on commit c412431

Please sign in to comment.