@@ -15,7 +15,10 @@ import {
15
15
import { Wallet } from '@neutron-org/neutronjsplus/dist/types' ;
16
16
import cosmosclient from '@cosmos-client/core' ;
17
17
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' ;
19
22
20
23
import config from '../../config.json' ;
21
24
@@ -128,7 +131,7 @@ describe('Neutron / Chain Manager', () => {
128
131
} ) ;
129
132
} ) ;
130
133
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)' , ( ) => {
132
135
let proposalId : number ;
133
136
test ( 'create proposal' , async ( ) => {
134
137
const chainManagerAddress = ( await neutronChain . getChainAdmins ( ) ) [ 0 ] ;
@@ -152,11 +155,17 @@ describe('Neutron / Chain Manager', () => {
152
155
} ,
153
156
} ,
154
157
{
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 ,
160
169
} ,
161
170
} ,
162
171
] ,
@@ -219,4 +228,64 @@ describe('Neutron / Chain Manager', () => {
219
228
expect ( cronParams . params . limit ) . toEqual ( '42' ) ;
220
229
} ) ;
221
230
} ) ;
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
+ } ) ;
222
291
} ) ;
0 commit comments