Skip to content

Commit 5208633

Browse files
committed
Merge branch 'main' into feat/dynamic-fees
2 parents 158adec + 43b9d50 commit 5208633

File tree

5 files changed

+1184
-921
lines changed

5 files changed

+1184
-921
lines changed

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"scripts": {
77
"test": "yarn test:parallel && yarn test:run_in_band",
88
"test:parallel": "jest -b src/testcases/parallel",
9-
"test:run_in_band": "yarn test:tge:auction && yarn test:tge:credits && yarn test:interchaintx && yarn test:interchain_kv_query && yarn test:interchain_tx_query_plain && yarn test:tokenomics && yarn test:reserve && yarn test:ibc_hooks && yarn test:float && yarn test:parameters && yarn test:dex_stargate && yarn test:dex_bindings && yarn test:slinky && yarn test:chain_manager && yarn test:feemarket && yarn test:globalfee",
9+
"test:run_in_band": "yarn test:tge:auction && yarn test:tge:credits && yarn test:interchaintx && yarn test:interchain_kv_query && yarn test:interchain_tx_query_plain && yarn test:tokenomics && yarn test:reserve && yarn test:ibc_hooks && yarn test:float && yarn test:parameters && yarn test:dex_stargate && yarn test:dex_bindings && yarn test:slinky && yarn test:chain_manager && yarn test:feemarket && yarn test:globalfee && yarn test:tokenfactory",
1010
"test:simple": "jest -b src/testcases/parallel/simple",
1111
"test:slinky": "jest -b src/testcases/run_in_band/slinky",
1212
"test:stargate_queries": "jest -b src/testcases/parallel/stargate_queries",
@@ -24,7 +24,7 @@
2424
"test:ibc_hooks": "jest -b src/testcases/run_in_band/ibc_hooks",
2525
"test:parameters": "jest -b src/testcases/run_in_band/parameters",
2626
"test:chain_manager": "jest -b src/testcases/run_in_band/chain_manager",
27-
"test:tokenfactory": "jest -b src/testcases/parallel/tokenfactory",
27+
"test:tokenfactory": "jest -b src/testcases/run_in_band/tokenfactory",
2828
"test:overrule": "jest -b src/testcases/parallel/overrule",
2929
"test:tge:vesting_lp_vault": "jest -b src/testcases/parallel/tge.vesting_lp_vault",
3030
"test:tge:credits_vault": "jest -b src/testcases/parallel/tge.credits_vault",
@@ -47,7 +47,7 @@
4747
"@cosmos-client/core": "^0.47.4",
4848
"@cosmos-client/cosmwasm": "^0.40.3",
4949
"@cosmos-client/ibc": "^1.2.1",
50-
"@neutron-org/neutronjsplus": "0.4.1",
50+
"@neutron-org/neutronjsplus": "https://github.com/neutron-org/neutronjsplus.git#40c2c30434e63ab989e42408a94034589d5985d8",
5151
"@types/lodash": "^4.14.182",
5252
"@types/long": "^5.0.0",
5353
"axios": "^0.27.2",
@@ -93,4 +93,4 @@
9393
"engines": {
9494
"node": ">=16.0 <17"
9595
}
96-
}
96+
}

src/testcases/run_in_band/chain_manager.test.ts

+76-7
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ import {
1515
import { Wallet } from '@neutron-org/neutronjsplus/dist/types';
1616
import cosmosclient from '@cosmos-client/core';
1717
import { waitSeconds } from '@neutron-org/neutronjsplus/dist/wait';
18-
import { updateCronParamsProposal } from '@neutron-org/neutronjsplus/dist/proposal';
18+
import {
19+
updateCronParamsProposal,
20+
updateTokenfactoryParamsProposal,
21+
} from '@neutron-org/neutronjsplus/dist/proposal';
1922

2023
import config from '../../config.json';
2124

@@ -128,7 +131,7 @@ describe('Neutron / Chain Manager', () => {
128131
});
129132
});
130133

131-
describe('Add an ALLOW_ONLY strategy (Cron module parameter updates, legacy param changes)', () => {
134+
describe('Add an ALLOW_ONLY strategy (Cron module parameter updates, Tokenfactory module parameter updates, legacy param changes)', () => {
132135
let proposalId: number;
133136
test('create proposal', async () => {
134137
const chainManagerAddress = (await neutronChain.getChainAdmins())[0];
@@ -152,11 +155,17 @@ describe('Neutron / Chain Manager', () => {
152155
},
153156
},
154157
{
155-
update_params_permission: {
156-
cron_update_params_permission: {
157-
security_address: true,
158-
limit: true,
159-
},
158+
update_cron_params_permission: {
159+
security_address: true,
160+
limit: true,
161+
},
162+
},
163+
{
164+
update_tokenfactory_params_permission: {
165+
denom_creation_fee: true,
166+
denom_creation_gas_consume: true,
167+
fee_collector_address: true,
168+
whitelisted_hooks: true,
160169
},
161170
},
162171
],
@@ -219,4 +228,64 @@ describe('Neutron / Chain Manager', () => {
219228
expect(cronParams.params.limit).toEqual('42');
220229
});
221230
});
231+
232+
describe('ALLOW_ONLY: change TOKENFACTORY parameters', () => {
233+
let proposalId: number;
234+
beforeAll(async () => {
235+
const chainManagerAddress = (await neutronChain.getChainAdmins())[0];
236+
proposalId = await subdaoMember1.submitUpdateParamsTokenfactoryProposal(
237+
chainManagerAddress,
238+
'Proposal #2',
239+
'Cron update params proposal. Will pass',
240+
updateTokenfactoryParamsProposal({
241+
denom_creation_fee: [{ denom: 'untrn', amount: '1' }],
242+
denom_creation_gas_consume: 20,
243+
fee_collector_address:
244+
'neutron1m9l358xunhhwds0568za49mzhvuxx9ux8xafx2',
245+
whitelisted_hooks: [
246+
{
247+
code_id: 1,
248+
denom_creator: 'neutron1m9l358xunhhwds0568za49mzhvuxx9ux8xafx2',
249+
},
250+
],
251+
}),
252+
'1000',
253+
);
254+
255+
const timelockedProp = await subdaoMember1.supportAndExecuteProposal(
256+
proposalId,
257+
);
258+
259+
expect(timelockedProp.id).toEqual(proposalId);
260+
expect(timelockedProp.status).toEqual('timelocked');
261+
expect(timelockedProp.msgs).toHaveLength(1);
262+
});
263+
264+
test('execute timelocked: success', async () => {
265+
await waitSeconds(10);
266+
267+
await subdaoMember1.executeTimelockedProposal(proposalId);
268+
const timelockedProp = await subDao.getTimelockedProposal(proposalId);
269+
expect(timelockedProp.id).toEqual(proposalId);
270+
expect(timelockedProp.status).toEqual('executed');
271+
expect(timelockedProp.msgs).toHaveLength(1);
272+
273+
const tokenfactoryParams = await neutronChain.queryTokenfactoryParams();
274+
expect(tokenfactoryParams.params.denom_creation_fee).toEqual([
275+
{ denom: 'untrn', amount: '1' },
276+
]);
277+
expect(tokenfactoryParams.params.denom_creation_gas_consume).toEqual(
278+
'20',
279+
);
280+
expect(tokenfactoryParams.params.fee_collector_address).toEqual(
281+
'neutron1m9l358xunhhwds0568za49mzhvuxx9ux8xafx2',
282+
);
283+
expect(tokenfactoryParams.params.whitelisted_hooks).toEqual([
284+
{
285+
code_id: '1',
286+
denom_creator: 'neutron1m9l358xunhhwds0568za49mzhvuxx9ux8xafx2',
287+
},
288+
]);
289+
});
290+
});
222291
});

src/testcases/run_in_band/parameters.test.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
updateFeerefunderParamsProposal,
1919
updateInterchainqueriesParamsProposal,
2020
updateInterchaintxsParamsProposal,
21-
updateTokenfacoryParamsProposal,
21+
updateTokenfactoryParamsProposal,
2222
updateTransferParamsProposal,
2323
} from '@neutron-org/neutronjsplus/dist/proposal';
2424

@@ -127,10 +127,11 @@ describe('Neutron / Parameters', () => {
127127
chainManagerAddress,
128128
'Proposal #2',
129129
'Tokenfactory params proposal',
130-
updateTokenfacoryParamsProposal({
130+
updateTokenfactoryParamsProposal({
131131
fee_collector_address: await neutronChain.getNeutronDAOCore(),
132132
denom_creation_fee: [{ denom: 'untrn', amount: '1' }],
133133
denom_creation_gas_consume: 100000,
134+
whitelisted_hooks: [],
134135
}),
135136
'1000',
136137
);

0 commit comments

Comments
 (0)