Skip to content

Commit

Permalink
Merge pull request #214 from neutron-org/feat/disable-vesting-token-c…
Browse files Browse the repository at this point in the history
…hange-once-set

[NTRN-105] feat: add vesting token immutability once set tests
  • Loading branch information
pr0n00gler authored Oct 11, 2023
2 parents 0f677a7 + fb5a3ea commit a65b977
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/testcases/parallel/tge.investors_vesting_vault.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,23 @@ describe('Neutron / TGE / Investors vesting vault', () => {
).rejects.toThrow(/Unauthorized/);
});

test('set vesting token not allowed more than once', async () => {
await expect(
cmManager.executeContract(
contractAddresses[INVESTORS_VESTING_CONTRACT_KEY],
JSON.stringify({
set_vesting_token: {
vesting_token: {
native_token: {
denom: IBC_ATOM_DENOM,
},
},
},
}),
),
).rejects.toThrow(/Vesting token is already set!/);
});

describe('remove vesting accounts is permissioned', () => {
test('removal not allowed to a stranger', async () => {
await expect(
Expand Down
32 changes: 32 additions & 0 deletions src/testcases/parallel/tge.vesting_lp_vault.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,38 @@ describe('Neutron / TGE / Vesting LP vault', () => {
).rejects.toThrow(/Unauthorized/);
});

test('set vesting token not allowed more than once', async () => {
await expect(
cmManager.executeContract(
contractAddresses[VESTING_LP_USDC_CONTRACT_KEY],
JSON.stringify({
set_vesting_token: {
vesting_token: {
native_token: {
denom: NEUTRON_DENOM,
},
},
},
}),
),
).rejects.toThrow(/Vesting token is already set!/);

await expect(
cmManager.executeContract(
contractAddresses[VESTING_LP_ATOM_CONTRACT_KEY],
JSON.stringify({
set_vesting_token: {
vesting_token: {
native_token: {
denom: NEUTRON_DENOM,
},
},
},
}),
),
).rejects.toThrow(/Vesting token is already set!/);
});

describe('register vesting accounts not allowed to a stranger', () => {
test('via send cw20', async () => {
// create a random cw20 token with allocation to user1
Expand Down

0 comments on commit a65b977

Please sign in to comment.