From 22580bd2fe6b7c44e55cba21030b029aa000b505 Mon Sep 17 00:00:00 2001 From: sotnikov-s Date: Mon, 2 Oct 2023 10:51:37 +0300 Subject: [PATCH] add vesting token immutability once set tests --- .../tge.investors_vesting_vault.test.ts | 17 ++++++++++ .../parallel/tge.vesting_lp_vault.test.ts | 32 +++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/src/testcases/parallel/tge.investors_vesting_vault.test.ts b/src/testcases/parallel/tge.investors_vesting_vault.test.ts index a69029a6..7453f970 100644 --- a/src/testcases/parallel/tge.investors_vesting_vault.test.ts +++ b/src/testcases/parallel/tge.investors_vesting_vault.test.ts @@ -515,6 +515,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('register vesting accounts is permissioned', () => { test('via send cw20 by a stranger', async () => { // create a random cw20 token with allocation to user1 diff --git a/src/testcases/parallel/tge.vesting_lp_vault.test.ts b/src/testcases/parallel/tge.vesting_lp_vault.test.ts index 921fc3da..7ddf0da9 100644 --- a/src/testcases/parallel/tge.vesting_lp_vault.test.ts +++ b/src/testcases/parallel/tge.vesting_lp_vault.test.ts @@ -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