@@ -465,7 +465,7 @@ pub fn test_execute_execute_message_update_params_tokenfactory_authorized() {
465
465
admin_proposal : AdminProposal :: ProposalExecuteMessage ( ProposalExecuteMessage {
466
466
message : r#"{"@type":"/osmosis.tokenfactory.v1beta1.MsgUpdateParams",
467
467
"authority":"neutron1hxskfdxpp5hqgtjj6am6nkjefhfzj359x0ar3z",
468
- "params": {"denom_creation_fee": [{"denom": "untrn", "amount": "100"}], "denom_creation_gas_consume": "100", "fee_collector_address": "neutron1hxskfdxpp5hqgtjj6am6nkjefhfzj359x0ar3z", "whitelisted_hooks": [{"code_id": "1", "denom_creator": "neutron1yw4xvtc43me9scqfr2jr2gzvcxd3a9y4eq7gaukreugw2yd2f8ts8g30fq"}]}}"#
468
+ "params": {"denom_creation_fee": [{"denom": "untrn", "amount": "100"}], "denom_creation_gas_consume": "100", "fee_collector_address": "neutron1hxskfdxpp5hqgtjj6am6nkjefhfzj359x0ar3z", "whitelisted_hooks": [{"code_id": "1", "denom_creator": "neutron1yw4xvtc43me9scqfr2jr2gzvcxd3a9y4eq7gaukreugw2yd2f8ts8g30fq"}],"track_before_send_gas_limit":10000 }}"#
469
469
. to_string ( ) ,
470
470
} ) ,
471
471
} ) ;
@@ -495,6 +495,7 @@ pub fn test_execute_execute_message_update_params_tokenfactory_authorized() {
495
495
denom_creation_gas_consume: true ,
496
496
fee_collector_address: true ,
497
497
whitelisted_hooks: true ,
498
+ track_before_send_gas_limit: true ,
498
499
} ,
499
500
) ] ) ,
500
501
)
@@ -511,7 +512,7 @@ pub fn test_execute_execute_message_update_params_tokenfactory_unauthorized_deno
511
512
admin_proposal : AdminProposal :: ProposalExecuteMessage ( ProposalExecuteMessage {
512
513
message : r#"{"@type":"/osmosis.tokenfactory.v1beta1.MsgUpdateParams",
513
514
"authority":"neutron1hxskfdxpp5hqgtjj6am6nkjefhfzj359x0ar3z",
514
- "params": {"denom_creation_fee": [{"denom": "untrn", "amount": "100"}], "denom_creation_gas_consume": "100", "fee_collector_address": "neutron1hxskfdxpp5hqgtjj6am6nkjefhfzj359x0ar3z", "whitelisted_hooks": [{"code_id": "1", "denom_creator": "neutron1yw4xvtc43me9scqfr2jr2gzvcxd3a9y4eq7gaukreugw2yd2f8ts8g30fq"}]}}"#
515
+ "params": {"denom_creation_fee": [{"denom": "untrn", "amount": "100"}], "denom_creation_gas_consume": "100", "fee_collector_address": "neutron1hxskfdxpp5hqgtjj6am6nkjefhfzj359x0ar3z", "whitelisted_hooks": [{"code_id": "1", "denom_creator": "neutron1yw4xvtc43me9scqfr2jr2gzvcxd3a9y4eq7gaukreugw2yd2f8ts8g30fq"}],"track_before_send_gas_limit":10000 }}"#
515
516
. to_string ( ) ,
516
517
} ) ,
517
518
} ) ;
@@ -541,6 +542,7 @@ pub fn test_execute_execute_message_update_params_tokenfactory_unauthorized_deno
541
542
denom_creation_gas_consume: true ,
542
543
fee_collector_address: true ,
543
544
whitelisted_hooks: true ,
545
+ track_before_send_gas_limit: true ,
544
546
} ,
545
547
) ] ) ,
546
548
)
@@ -560,7 +562,7 @@ pub fn test_execute_execute_message_update_params_tokenfactory_unauthorized_deno
560
562
admin_proposal : AdminProposal :: ProposalExecuteMessage ( ProposalExecuteMessage {
561
563
message : r#"{"@type":"/osmosis.tokenfactory.v1beta1.MsgUpdateParams",
562
564
"authority":"neutron1hxskfdxpp5hqgtjj6am6nkjefhfzj359x0ar3z",
563
- "params": {"denom_creation_fee": [{"denom": "untrn", "amount": "100"}], "denom_creation_gas_consume": "100", "fee_collector_address": "neutron1hxskfdxpp5hqgtjj6am6nkjefhfzj359x0ar3z", "whitelisted_hooks": [{"code_id": "1", "denom_creator": "neutron1yw4xvtc43me9scqfr2jr2gzvcxd3a9y4eq7gaukreugw2yd2f8ts8g30fq"}]}}"#
565
+ "params": {"denom_creation_fee": [{"denom": "untrn", "amount": "100"}], "denom_creation_gas_consume": "100", "fee_collector_address": "neutron1hxskfdxpp5hqgtjj6am6nkjefhfzj359x0ar3z", "whitelisted_hooks": [{"code_id": "1", "denom_creator": "neutron1yw4xvtc43me9scqfr2jr2gzvcxd3a9y4eq7gaukreugw2yd2f8ts8g30fq"}],"track_before_send_gas_limit":10000 }}"#
564
566
. to_string ( ) ,
565
567
} ) ,
566
568
} ) ;
@@ -590,6 +592,7 @@ pub fn test_execute_execute_message_update_params_tokenfactory_unauthorized_deno
590
592
denom_creation_gas_consume: false ,
591
593
fee_collector_address: true ,
592
594
whitelisted_hooks: true ,
595
+ track_before_send_gas_limit: true ,
593
596
} ,
594
597
) ] ) ,
595
598
)
@@ -609,7 +612,7 @@ pub fn test_execute_execute_message_update_params_tokenfactory_unauthorized_fee_
609
612
admin_proposal : AdminProposal :: ProposalExecuteMessage ( ProposalExecuteMessage {
610
613
message : r#"{"@type":"/osmosis.tokenfactory.v1beta1.MsgUpdateParams",
611
614
"authority":"neutron1hxskfdxpp5hqgtjj6am6nkjefhfzj359x0ar3z",
612
- "params": {"denom_creation_fee": [{"denom": "untrn", "amount": "100"}], "denom_creation_gas_consume": "100", "fee_collector_address": "neutron1hxskfdxpp5hqgtjj6am6nkjefhfzj359x0ar3z", "whitelisted_hooks": [{"code_id": "1", "denom_creator": "neutron1yw4xvtc43me9scqfr2jr2gzvcxd3a9y4eq7gaukreugw2yd2f8ts8g30fq"}]}}"#
615
+ "params": {"denom_creation_fee": [{"denom": "untrn", "amount": "100"}], "denom_creation_gas_consume": "100", "fee_collector_address": "neutron1hxskfdxpp5hqgtjj6am6nkjefhfzj359x0ar3z", "whitelisted_hooks": [{"code_id": "1", "denom_creator": "neutron1yw4xvtc43me9scqfr2jr2gzvcxd3a9y4eq7gaukreugw2yd2f8ts8g30fq"}],"track_before_send_gas_limit":10000 }}"#
613
616
. to_string ( ) ,
614
617
} ) ,
615
618
} ) ;
@@ -639,6 +642,7 @@ pub fn test_execute_execute_message_update_params_tokenfactory_unauthorized_fee_
639
642
denom_creation_gas_consume: true ,
640
643
fee_collector_address: false ,
641
644
whitelisted_hooks: true ,
645
+ track_before_send_gas_limit: true ,
642
646
} ,
643
647
) ] ) ,
644
648
)
@@ -657,7 +661,7 @@ pub fn test_execute_execute_message_update_params_tokenfactory_unauthorized_whit
657
661
admin_proposal : AdminProposal :: ProposalExecuteMessage ( ProposalExecuteMessage {
658
662
message : r#"{"@type":"/osmosis.tokenfactory.v1beta1.MsgUpdateParams",
659
663
"authority":"neutron1hxskfdxpp5hqgtjj6am6nkjefhfzj359x0ar3z",
660
- "params": {"denom_creation_fee": [{"denom": "untrn", "amount": "100"}], "denom_creation_gas_consume": "100", "fee_collector_address": "neutron1hxskfdxpp5hqgtjj6am6nkjefhfzj359x0ar3z", "whitelisted_hooks": [{"code_id": "1", "denom_creator": "neutron1yw4xvtc43me9scqfr2jr2gzvcxd3a9y4eq7gaukreugw2yd2f8ts8g30fq"}]}}"#
664
+ "params": {"denom_creation_fee": [{"denom": "untrn", "amount": "100"}], "denom_creation_gas_consume": "100", "fee_collector_address": "neutron1hxskfdxpp5hqgtjj6am6nkjefhfzj359x0ar3z", "whitelisted_hooks": [{"code_id": "1", "denom_creator": "neutron1yw4xvtc43me9scqfr2jr2gzvcxd3a9y4eq7gaukreugw2yd2f8ts8g30fq"}],"track_before_send_gas_limit":10000 }}"#
661
665
. to_string ( ) ,
662
666
} ) ,
663
667
} ) ;
@@ -687,6 +691,57 @@ pub fn test_execute_execute_message_update_params_tokenfactory_unauthorized_whit
687
691
denom_creation_gas_consume: true ,
688
692
fee_collector_address: true ,
689
693
whitelisted_hooks: false ,
694
+ track_before_send_gas_limit: true ,
695
+ } ,
696
+ ) ] ) ,
697
+ )
698
+ . unwrap ( ) ;
699
+
700
+ let info = message_info ( & Addr :: unchecked ( "addr1" ) , & [ ] ) ;
701
+ let err = execute_execute_messages ( deps. as_mut ( ) , info. clone ( ) , vec ! [ msg] ) . unwrap_err ( ) ;
702
+ assert_eq ! ( err, Unauthorized { } ) ;
703
+ }
704
+
705
+ /// Checks that you can't change the track_before_send_gas_limit if you don't have the permission to do so
706
+ /// (new style parameter changes).
707
+ #[ test]
708
+ pub fn test_execute_execute_message_update_params_tokenfactory_unauthorized_track_before_send_gas_limit (
709
+ ) {
710
+ let msg = CosmosMsg :: Custom ( NeutronMsg :: SubmitAdminProposal {
711
+ admin_proposal : AdminProposal :: ProposalExecuteMessage ( ProposalExecuteMessage {
712
+ message : r#"{"@type":"/osmosis.tokenfactory.v1beta1.MsgUpdateParams",
713
+ "authority":"neutron1hxskfdxpp5hqgtjj6am6nkjefhfzj359x0ar3z",
714
+ "params": {"denom_creation_fee": [{"denom": "untrn", "amount": "100"}], "denom_creation_gas_consume": "100", "fee_collector_address": "neutron1hxskfdxpp5hqgtjj6am6nkjefhfzj359x0ar3z", "whitelisted_hooks": [{"code_id": "1", "denom_creator": "neutron1yw4xvtc43me9scqfr2jr2gzvcxd3a9y4eq7gaukreugw2yd2f8ts8g30fq"}],"track_before_send_gas_limit":10000}}"#
715
+ . to_string ( ) ,
716
+ } ) ,
717
+ } ) ;
718
+
719
+ let mut deps = mock_dependencies ( ) ;
720
+ let env = mock_env ( ) ;
721
+ let info = message_info ( & Addr :: unchecked ( "neutron_dao_address" ) , & [ ] ) ;
722
+
723
+ instantiate (
724
+ deps. as_mut ( ) ,
725
+ env. clone ( ) ,
726
+ info. clone ( ) ,
727
+ InstantiateMsg {
728
+ initial_strategy_address : Addr :: unchecked ( "neutron_dao_address" . to_string ( ) ) ,
729
+ } ,
730
+ )
731
+ . unwrap ( ) ;
732
+
733
+ let info = message_info ( & Addr :: unchecked ( "neutron_dao_address" ) , & [ ] ) ;
734
+ execute_add_strategy (
735
+ deps. as_mut ( ) ,
736
+ info. clone ( ) ,
737
+ Addr :: unchecked ( "addr1" . to_string ( ) ) ,
738
+ StrategyMsg :: AllowOnly ( vec ! [ UpdateTokenfactoryParamsPermission (
739
+ TokenfactoryUpdateParamsPermission {
740
+ denom_creation_fee: true ,
741
+ denom_creation_gas_consume: true ,
742
+ fee_collector_address: true ,
743
+ whitelisted_hooks: true ,
744
+ track_before_send_gas_limit: false ,
690
745
} ,
691
746
) ] ) ,
692
747
)
0 commit comments