Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tiendv89 committed Aug 20, 2024
1 parent c2e7956 commit 2b3e4e0
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 22 deletions.
9 changes: 5 additions & 4 deletions tests/v2/locker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,15 @@ describe("[V2] Test full flow", () => {
program.provider.connection
);

const startTime = new BN(currentBlockTime).add(new BN(5));
const cliffTime = new BN(currentBlockTime).add(new BN(5));
let escrow = await createVestingPlan({
ownerKeypair: UserKP,
vestingStartTime: new BN(0),
tokenMint: TOKEN,
isAssertion: true,
startTime,
cliffTime,
frequency: new BN(1),
initialUnlockAmount: new BN(100_000),
cliffUnlockAmount: new BN(100_000),
amountPerPeriod: new BN(50_000),
numberOfPeriod: new BN(2),
recipient: RecipientKP.publicKey,
Expand All @@ -84,7 +85,7 @@ describe("[V2] Test full flow", () => {
const currentBlockTime = await getCurrentBlockTime(
program.provider.connection
);
if (currentBlockTime > startTime.toNumber()) {
if (currentBlockTime > cliffTime.toNumber()) {
break;
} else {
await sleep(1000);
Expand Down
7 changes: 4 additions & 3 deletions tests/v2/unsupported_mint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,16 @@ describe("[V2] Test supported/unsupported Token Mint", () => {
program.provider.connection
);

const startTime = new BN(currentBlockTime).add(new BN(5));
const cliffTime = new BN(currentBlockTime).add(new BN(5));
try {
await createVestingPlan({
ownerKeypair: UserKP,
vestingStartTime: new BN(0),
tokenMint: TOKEN,
isAssertion: true,
startTime,
cliffTime,
frequency: new BN(1),
initialUnlockAmount: new BN(100_000),
cliffUnlockAmount: new BN(100_000),
amountPerPeriod: new BN(50_000),
numberOfPeriod: new BN(2),
recipient: RecipientKP.publicKey,
Expand Down
35 changes: 20 additions & 15 deletions tests/v2/update_recipient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,15 @@ describe("[V2] Update recipient", () => {
program.provider.connection
);

const startTime = new BN(currentBlockTime).add(new BN(5));
const cliffTime = new BN(currentBlockTime).add(new BN(5));
let escrow = await createVestingPlan({
ownerKeypair: UserKP,
vestingStartTime: new BN(0),
tokenMint: TOKEN,
isAssertion: true,
startTime,
cliffTime,
frequency: new BN(1),
initialUnlockAmount: new BN(100_000),
cliffUnlockAmount: new BN(100_000),
amountPerPeriod: new BN(50_000),
numberOfPeriod: new BN(2),
recipient: RecipientKP.publicKey,
Expand Down Expand Up @@ -196,14 +197,15 @@ describe("[V2] Update recipient", () => {
program.provider.connection
);

const startTime = new BN(currentBlockTime).add(new BN(5));
const cliffTime = new BN(currentBlockTime).add(new BN(5));
let escrow = await createVestingPlan({
ownerKeypair: UserKP,
vestingStartTime: new BN(0),
tokenMint: TOKEN,
isAssertion: true,
startTime,
cliffTime,
frequency: new BN(1),
initialUnlockAmount: new BN(100_000),
cliffUnlockAmount: new BN(100_000),
amountPerPeriod: new BN(50_000),
numberOfPeriod: new BN(2),
recipient: RecipientKP.publicKey,
Expand Down Expand Up @@ -242,14 +244,15 @@ describe("[V2] Update recipient", () => {
program.provider.connection
);

const startTime = new BN(currentBlockTime).add(new BN(5));
const cliffTime = new BN(currentBlockTime).add(new BN(5));
let escrow = await createVestingPlan({
ownerKeypair: UserKP,
vestingStartTime: new BN(0),
tokenMint: TOKEN,
isAssertion: true,
startTime,
cliffTime,
frequency: new BN(1),
initialUnlockAmount: new BN(100_000),
cliffUnlockAmount: new BN(100_000),
amountPerPeriod: new BN(50_000),
numberOfPeriod: new BN(2),
recipient: RecipientKP.publicKey,
Expand Down Expand Up @@ -288,14 +291,15 @@ describe("[V2] Update recipient", () => {
program.provider.connection
);

const startTime = new BN(currentBlockTime).add(new BN(5));
const cliffTime = new BN(currentBlockTime).add(new BN(5));
let escrow = await createVestingPlan({
ownerKeypair: UserKP,
vestingStartTime: new BN(0),
tokenMint: TOKEN,
isAssertion: true,
startTime,
cliffTime,
frequency: new BN(1),
initialUnlockAmount: new BN(100_000),
cliffUnlockAmount: new BN(100_000),
amountPerPeriod: new BN(50_000),
numberOfPeriod: new BN(2),
recipient: RecipientKP.publicKey,
Expand Down Expand Up @@ -327,14 +331,15 @@ describe("[V2] Update recipient", () => {
program.provider.connection
);

const startTime = new BN(currentBlockTime).add(new BN(5));
const cliffTime = new BN(currentBlockTime).add(new BN(5));
let escrow = await createVestingPlan({
ownerKeypair: UserKP,
vestingStartTime: new BN(0),
tokenMint: TOKEN,
isAssertion: true,
startTime,
cliffTime,
frequency: new BN(1),
initialUnlockAmount: new BN(100_000),
cliffUnlockAmount: new BN(100_000),
amountPerPeriod: new BN(50_000),
numberOfPeriod: new BN(2),
recipient: RecipientKP.publicKey,
Expand Down

0 comments on commit 2b3e4e0

Please sign in to comment.