11#![ cfg( feature = "runtime-benchmarks" ) ]
22
3- use pallet_permission0_api:: {
4- CuratorPermissions , Permission0CuratorApi , PermissionDuration , RevocationTerms ,
5- } ;
3+ use pallet_permission0_api:: { CuratorPermissions , Permission0CuratorApi } ;
64use pallet_torus0_api:: Torus0Api ;
75use polkadot_sdk:: {
86 frame_benchmarking:: { account, v2:: * } ,
@@ -30,15 +28,7 @@ fn curator<T: Config>() -> T::AccountId {
3028 T :: AccountId ,
3129 OriginFor < T > ,
3230 BlockNumberFor < T > ,
33- > >:: delegate_curator_permission (
34- RawOrigin :: Root . into ( ) ,
35- curator_id. clone ( ) ,
36- CuratorPermissions :: all ( ) ,
37- None ,
38- PermissionDuration :: Indefinite ,
39- RevocationTerms :: Irrevocable ,
40- )
41- . unwrap ( ) ;
31+ > >:: force_curator ( & curator_id, CuratorPermissions :: all ( ) ) ;
4232 curator_id
4333}
4434
@@ -48,15 +38,15 @@ mod benchmarks {
4838
4939 #[ benchmark]
5040 fn add_allocator ( ) {
51- let module_key: T :: AccountId = account ( "ModuleKey " , 0 , 2 ) ;
41+ let module_key: T :: AccountId = account ( "agent " , 0 , 2 ) ;
5242
5343 #[ extrinsic_call]
5444 add_allocator ( RawOrigin :: Root , module_key)
5545 }
5646
5747 #[ benchmark]
5848 fn remove_allocator ( ) {
59- let module_key: T :: AccountId = account ( "ModuleKey " , 0 , 2 ) ;
49+ let module_key: T :: AccountId = account ( "agent " , 0 , 2 ) ;
6050 roles:: add_allocator :: < T > ( module_key. clone ( ) ) . expect ( "failed to add allocator" ) ;
6151
6252 #[ extrinsic_call]
@@ -65,7 +55,7 @@ mod benchmarks {
6555
6656 #[ benchmark]
6757 fn add_to_whitelist ( ) {
68- let module_key: T :: AccountId = account ( "ModuleKey " , 0 , 2 ) ;
58+ let module_key: T :: AccountId = account ( "agent " , 0 , 2 ) ;
6959 roles:: add_allocator :: < T > ( module_key. clone ( ) ) . expect ( "failed to add allocator" ) ;
7060
7161 #[ extrinsic_call]
@@ -74,7 +64,7 @@ mod benchmarks {
7464
7565 #[ benchmark]
7666 fn remove_from_whitelist ( ) {
77- let module_key: T :: AccountId = account ( "ModuleKey " , 0 , 2 ) ;
67+ let module_key: T :: AccountId = account ( "agent " , 0 , 2 ) ;
7868 whitelist:: add_to_whitelist :: < T > ( module_key. clone ( ) ) . expect ( "failed to add to whitelist" ) ;
7969
8070 #[ extrinsic_call]
@@ -83,7 +73,7 @@ mod benchmarks {
8373
8474 #[ benchmark]
8575 fn submit_application ( ) {
86- let module_key: T :: AccountId = account ( "ModuleKey " , 0 , 2 ) ;
76+ let module_key: T :: AccountId = account ( "agent " , 0 , 2 ) ;
8777
8878 let config = crate :: GlobalGovernanceConfig :: < T > :: get ( ) ;
8979 let cost = config. agent_application_cost ;
@@ -103,7 +93,7 @@ mod benchmarks {
10393
10494 #[ benchmark]
10595 fn accept_application ( ) {
106- let module_key: T :: AccountId = account ( "ModuleKey " , 0 , 2 ) ;
96+ let module_key: T :: AccountId = account ( "agent " , 0 , 2 ) ;
10797 create_application :: < T > ( & module_key) ;
10898
10999 #[ extrinsic_call]
@@ -112,7 +102,7 @@ mod benchmarks {
112102
113103 #[ benchmark]
114104 fn deny_application ( ) {
115- let module_key: T :: AccountId = account ( "ModuleKey " , 0 , 2 ) ;
105+ let module_key: T :: AccountId = account ( "agent " , 0 , 2 ) ;
116106 create_application :: < T > ( & module_key) ;
117107
118108 #[ extrinsic_call]
@@ -121,11 +111,11 @@ mod benchmarks {
121111
122112 #[ benchmark]
123113 fn penalize_agent ( ) {
124- let module_key: T :: AccountId = account ( "ModuleKey " , 0 , 2 ) ;
114+ let module_key: T :: AccountId = account ( "agent " , 0 , 2 ) ;
125115
126116 <pallet_torus0:: Pallet < T > as Torus0Api < T :: AccountId , BalanceOf < T > > >:: force_register_agent (
127117 & module_key,
128- vec ! [ ] ,
118+ b"agent" . to_vec ( ) ,
129119 vec ! [ ] ,
130120 vec ! [ ] ,
131121 )
@@ -174,7 +164,7 @@ mod benchmarks {
174164
175165 #[ benchmark]
176166 fn add_dao_treasury_transfer_proposal ( ) {
177- let module_key: T :: AccountId = account ( "ModuleKey " , 0 , 2 ) ;
167+ let module_key: T :: AccountId = account ( "agent " , 0 , 2 ) ;
178168 let data = vec ! [ 0 ] ;
179169
180170 let config = crate :: GlobalGovernanceConfig :: < T > :: get ( ) ;
@@ -192,7 +182,7 @@ mod benchmarks {
192182
193183 #[ benchmark]
194184 fn vote_proposal ( ) {
195- let module_key: T :: AccountId = account ( "ModuleKey " , 0 , 2 ) ;
185+ let module_key: T :: AccountId = account ( "agent " , 0 , 2 ) ;
196186 let data = vec ! [ 0 ] ;
197187
198188 let config = crate :: GlobalGovernanceConfig :: < T > :: get ( ) ;
@@ -212,7 +202,7 @@ mod benchmarks {
212202
213203 #[ benchmark]
214204 fn remove_vote_proposal ( ) {
215- let module_key: T :: AccountId = account ( "ModuleKey " , 0 , 2 ) ;
205+ let module_key: T :: AccountId = account ( "agent " , 0 , 2 ) ;
216206 let data = vec ! [ 0 ] ;
217207
218208 let config = crate :: GlobalGovernanceConfig :: < T > :: get ( ) ;
@@ -234,23 +224,23 @@ mod benchmarks {
234224
235225 #[ benchmark]
236226 fn enable_vote_delegation ( ) {
237- let module_key: T :: AccountId = account ( "ModuleKey " , 0 , 2 ) ;
227+ let module_key: T :: AccountId = account ( "agent " , 0 , 2 ) ;
238228
239229 #[ extrinsic_call]
240230 enable_vote_delegation ( RawOrigin :: Signed ( module_key. clone ( ) ) )
241231 }
242232
243233 #[ benchmark]
244234 fn disable_vote_delegation ( ) {
245- let module_key: T :: AccountId = account ( "ModuleKey " , 0 , 2 ) ;
235+ let module_key: T :: AccountId = account ( "agent " , 0 , 2 ) ;
246236
247237 #[ extrinsic_call]
248238 disable_vote_delegation ( RawOrigin :: Signed ( module_key. clone ( ) ) )
249239 }
250240
251241 #[ benchmark]
252242 fn add_emission_proposal ( ) {
253- let module_key: T :: AccountId = account ( "ModuleKey " , 0 , 2 ) ;
243+ let module_key: T :: AccountId = account ( "agent " , 0 , 2 ) ;
254244 let data = vec ! [ 0 ] ;
255245
256246 let config = crate :: GlobalGovernanceConfig :: < T > :: get ( ) ;
0 commit comments