Skip to content

Commit 8f50dc3

Browse files
committed
chore: updates post-deployment
1 parent 0acc792 commit 8f50dc3

File tree

19 files changed

+677
-954
lines changed

19 files changed

+677
-954
lines changed

.helix/languages.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[language-server.rust-analyzer.config]
2+
cargo.extraEnv = { SKIP_WASM_BUILD = "true" }
3+
cargo.features = ["runtime-benchmarks"]
4+

client/examples/calling_extrinsic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub async fn main() {
1414
if let Err(err) = client
1515
.torus0()
1616
.calls()
17-
.register_agent_wait(agent_key, name, url, metadata, signer)
17+
.register_agent_wait(name, url, metadata, signer)
1818
.await
1919
{
2020
print!("could not register agent: {err}");

pallets/emission0/src/benchmarking.rs

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,23 @@ mod benchmarks {
1616

1717
#[benchmark]
1818
fn set_weights() {
19-
let module_key: T::AccountId = account("ModuleKey", 0, 2);
20-
let module_key2: T::AccountId = account("ModuleKey2", 0, 3);
19+
let module_key: T::AccountId = account("agent", 0, 2);
20+
let module_key2: T::AccountId = account("agent2", 0, 3);
2121

2222
<T::Governance>::set_allocator(&module_key2);
2323

24-
<T::Torus>::force_register_agent(&module_key, vec![], vec![], vec![])
24+
<T::Torus>::force_register_agent(&module_key, b"agent".to_vec(), vec![], vec![])
2525
.expect("failed to register agent");
26-
<T::Torus>::force_register_agent(&module_key2, vec![], vec![], vec![])
26+
<T::Torus>::force_register_agent(&module_key2, b"agent2".to_vec(), vec![], vec![])
2727
.expect("failed to register agent");
2828

2929
<T::Governance>::force_set_whitelisted(&module_key);
3030
<T::Governance>::force_set_whitelisted(&module_key2);
3131

3232
<T::Governance>::set_allocator(&module_key2);
33-
let _ = <T::Currency>::deposit_creating(&module_key2, <T::Torus>::min_validator_stake());
33+
let _ =
34+
<T::Currency>::deposit_creating(&module_key2, <T::Torus>::min_validator_stake() * 2);
35+
3436
<T::Torus>::force_set_stake(
3537
&module_key2,
3638
&module_key2,
@@ -46,12 +48,12 @@ mod benchmarks {
4648

4749
#[benchmark]
4850
fn delegate_weight_control() {
49-
let module_key: T::AccountId = account("ModuleKey", 0, 2);
50-
let module_key2: T::AccountId = account("ModuleKey2", 0, 3);
51+
let module_key: T::AccountId = account("agent", 0, 2);
52+
let module_key2: T::AccountId = account("agent2", 0, 3);
5153

52-
<T::Torus>::force_register_agent(&module_key, vec![], vec![], vec![])
54+
<T::Torus>::force_register_agent(&module_key, b"agent".to_vec(), vec![], vec![])
5355
.expect("failed to register agent");
54-
<T::Torus>::force_register_agent(&module_key2, vec![], vec![], vec![])
56+
<T::Torus>::force_register_agent(&module_key2, b"agent2".to_vec(), vec![], vec![])
5557
.expect("failed to register agent");
5658

5759
<T::Governance>::force_set_whitelisted(&module_key);
@@ -65,12 +67,12 @@ mod benchmarks {
6567

6668
#[benchmark]
6769
fn regain_weight_control() {
68-
let module_key: T::AccountId = account("ModuleKey", 0, 2);
69-
let module_key2: T::AccountId = account("ModuleKey2", 0, 3);
70+
let module_key: T::AccountId = account("agent", 0, 2);
71+
let module_key2: T::AccountId = account("agent2", 0, 3);
7072

71-
<T::Torus>::force_register_agent(&module_key, vec![], vec![], vec![])
73+
<T::Torus>::force_register_agent(&module_key, b"agent".to_vec(), vec![], vec![])
7274
.expect("failed to register agent");
73-
<T::Torus>::force_register_agent(&module_key2, vec![], vec![], vec![])
75+
<T::Torus>::force_register_agent(&module_key2, b"agent2".to_vec(), vec![], vec![])
7476
.expect("failed to register agent");
7577

7678
<T::Governance>::force_set_whitelisted(&module_key);

pallets/emission0/src/weights.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
//! Autogenerated weights for `pallet_emission0`
33
//!
44
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 43.0.0
5-
//! DATE: 2025-06-18, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
5+
//! DATE: 2025-08-11, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
66
//! WORST CASE MAP SIZE: `1000000`
7-
//! HOSTNAME: `MacBook-Pro-de-Joao.local`, CPU: `<UNKNOWN>`
7+
//! HOSTNAME: `Luizs-MacBook-Pro.local`, CPU: `<UNKNOWN>`
88
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024`
99
1010
// Executed Command:
@@ -62,10 +62,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
6262
/// Proof: `Emission0::ConsensusMembers` (`max_values`: None, `max_size`: Some(4294967295), added: 2474, mode: `MaxEncodedLen`)
6363
fn set_weights() -> Weight {
6464
// Proof Size summary in bytes:
65-
// Measured: `610`
65+
// Measured: `677`
6666
// Estimated: `7654`
67-
// Minimum execution time: 32_000_000 picoseconds.
68-
Weight::from_parts(33_000_000, 7654)
67+
// Minimum execution time: 27_000_000 picoseconds.
68+
Weight::from_parts(27_000_000, 7654)
6969
.saturating_add(T::DbWeight::get().reads(10_u64))
7070
.saturating_add(T::DbWeight::get().writes(1_u64))
7171
}
@@ -79,10 +79,10 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
7979
/// Proof: `Emission0::WeightControlDelegation` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`)
8080
fn delegate_weight_control() -> Weight {
8181
// Proof Size summary in bytes:
82-
// Measured: `325`
82+
// Measured: `392`
8383
// Estimated: `7654`
84-
// Minimum execution time: 21_000_000 picoseconds.
85-
Weight::from_parts(22_000_000, 7654)
84+
// Minimum execution time: 17_000_000 picoseconds.
85+
Weight::from_parts(18_000_000, 7654)
8686
.saturating_add(T::DbWeight::get().reads(5_u64))
8787
.saturating_add(T::DbWeight::get().writes(1_u64))
8888
}
@@ -94,8 +94,8 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
9494
// Proof Size summary in bytes:
9595
// Measured: `333`
9696
// Estimated: `3529`
97-
// Minimum execution time: 11_000_000 picoseconds.
98-
Weight::from_parts(12_000_000, 3529)
97+
// Minimum execution time: 9_000_000 picoseconds.
98+
Weight::from_parts(10_000_000, 3529)
9999
.saturating_add(T::DbWeight::get().reads(2_u64))
100100
.saturating_add(T::DbWeight::get().writes(1_u64))
101101
}
@@ -119,10 +119,10 @@ impl WeightInfo for () {
119119
/// Proof: `Emission0::ConsensusMembers` (`max_values`: None, `max_size`: Some(4294967295), added: 2474, mode: `MaxEncodedLen`)
120120
fn set_weights() -> Weight {
121121
// Proof Size summary in bytes:
122-
// Measured: `610`
122+
// Measured: `677`
123123
// Estimated: `7654`
124-
// Minimum execution time: 32_000_000 picoseconds.
125-
Weight::from_parts(33_000_000, 7654)
124+
// Minimum execution time: 27_000_000 picoseconds.
125+
Weight::from_parts(27_000_000, 7654)
126126
.saturating_add(RocksDbWeight::get().reads(10_u64))
127127
.saturating_add(RocksDbWeight::get().writes(1_u64))
128128
}
@@ -136,10 +136,10 @@ impl WeightInfo for () {
136136
/// Proof: `Emission0::WeightControlDelegation` (`max_values`: None, `max_size`: Some(64), added: 2539, mode: `MaxEncodedLen`)
137137
fn delegate_weight_control() -> Weight {
138138
// Proof Size summary in bytes:
139-
// Measured: `325`
139+
// Measured: `392`
140140
// Estimated: `7654`
141-
// Minimum execution time: 21_000_000 picoseconds.
142-
Weight::from_parts(22_000_000, 7654)
141+
// Minimum execution time: 17_000_000 picoseconds.
142+
Weight::from_parts(18_000_000, 7654)
143143
.saturating_add(RocksDbWeight::get().reads(5_u64))
144144
.saturating_add(RocksDbWeight::get().writes(1_u64))
145145
}
@@ -151,8 +151,8 @@ impl WeightInfo for () {
151151
// Proof Size summary in bytes:
152152
// Measured: `333`
153153
// Estimated: `3529`
154-
// Minimum execution time: 11_000_000 picoseconds.
155-
Weight::from_parts(12_000_000, 3529)
154+
// Minimum execution time: 9_000_000 picoseconds.
155+
Weight::from_parts(10_000_000, 3529)
156156
.saturating_add(RocksDbWeight::get().reads(2_u64))
157157
.saturating_add(RocksDbWeight::get().writes(1_u64))
158158
}

pallets/governance/src/benchmarking.rs

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#![cfg(feature = "runtime-benchmarks")]
22

3-
use pallet_permission0_api::{
4-
CuratorPermissions, Permission0CuratorApi, PermissionDuration, RevocationTerms,
5-
};
3+
use pallet_permission0_api::{CuratorPermissions, Permission0CuratorApi};
64
use pallet_torus0_api::Torus0Api;
75
use 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

Comments
 (0)