Skip to content

Commit

Permalink
Merge branch 'main' into feat/remove-stargate
Browse files Browse the repository at this point in the history
  • Loading branch information
joldie777 committed Jul 31, 2024
2 parents 75044bd + c397747 commit 0edf98e
Show file tree
Hide file tree
Showing 3 changed files with 266 additions and 234 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@cosmos-client/core": "^0.47.4",
"@cosmos-client/cosmwasm": "^0.40.3",
"@cosmos-client/ibc": "^1.2.1",
"@neutron-org/neutronjsplus": "https://github.com/neutron-org/neutronjsplus.git#bac7ed7f8485adcde219e960819dfade7827fa61",
"@neutron-org/neutronjsplus": "https://github.com/neutron-org/neutronjsplus.git#52ceecbc3cddcc0958c902b5a2fcf3985b86e121",
"@types/lodash": "^4.14.182",
"@types/long": "^5.0.0",
"axios": "^0.27.2",
Expand Down
54 changes: 53 additions & 1 deletion src/testcases/run_in_band/chain_manager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import cosmosclient from '@cosmos-client/core';
import { waitSeconds } from '@neutron-org/neutronjsplus/dist/wait';
import {
updateCronParamsProposal,
updateDexParamsProposal,
updateTokenfactoryParamsProposal,
} from '@neutron-org/neutronjsplus/dist/proposal';

Expand Down Expand Up @@ -131,7 +132,7 @@ describe('Neutron / Chain Manager', () => {
});
});

describe('Add an ALLOW_ONLY strategy (Cron module parameter updates, Tokenfactory module parameter updates, legacy param changes)', () => {
describe('Add an ALLOW_ONLY strategy for module parameter updates (Cron, Tokenfactory, Dex), and legacy param changes)', () => {
let proposalId: number;
test('create proposal', async () => {
const chainManagerAddress = (await neutronChain.getChainAdmins())[0];
Expand Down Expand Up @@ -168,6 +169,14 @@ describe('Neutron / Chain Manager', () => {
whitelisted_hooks: true,
},
},
{
update_dex_params_permission: {
fee_tiers: true,
paused: true,
max_jits_per_block: true,
good_til_purge_allowance: true,
},
},
],
},
},
Expand Down Expand Up @@ -288,4 +297,47 @@ describe('Neutron / Chain Manager', () => {
]);
});
});
describe('ALLOW_ONLY: change DEX parameters', () => {
let proposalId: number;
const newParams = {
fee_tiers: [1, 2, 99],
paused: true,
max_jits_per_block: 11,
good_til_purge_allowance: 50000,
};
beforeAll(async () => {
const chainManagerAddress = (await neutronChain.getChainAdmins())[0];
proposalId = await subdaoMember1.submitUpdateParamsDexProposal(
chainManagerAddress,
'Proposal #1',
'dex update params proposal. Will pass',
updateDexParamsProposal(newParams),
'1000',
);

const timelockedProp = await subdaoMember1.supportAndExecuteProposal(
proposalId,
);

expect(timelockedProp.id).toEqual(proposalId);
expect(timelockedProp.status).toEqual('timelocked');
expect(timelockedProp.msgs).toHaveLength(1);
});

test('execute timelocked: success', async () => {
await waitSeconds(10);

await subdaoMember1.executeTimelockedProposal(proposalId);
const timelockedProp = await subDao.getTimelockedProposal(proposalId);
expect(timelockedProp.id).toEqual(proposalId);
expect(timelockedProp.status).toEqual('executed');
expect(timelockedProp.msgs).toHaveLength(1);

const dexParams = await neutronChain.queryDexParams();
expect(dexParams.params.fee_tiers).toEqual(['1', '2', '99']);
expect(dexParams.params.paused).toEqual(true);
expect(dexParams.params.max_jits_per_block).toEqual('11');
expect(dexParams.params.good_til_purge_allowance).toEqual('50000');
});
});
});
Loading

0 comments on commit 0edf98e

Please sign in to comment.