From 0bf13a6fdf958d90603ab79fcd6e7aee5b780fbf Mon Sep 17 00:00:00 2001 From: Aliaksandr Tsurko Date: Tue, 11 Mar 2025 15:11:59 +0100 Subject: [PATCH 1/2] Add view specifier for stake getters in saking precompile --- precompiles/src/staking.rs | 4 ++++ runtime/src/lib.rs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/precompiles/src/staking.rs b/precompiles/src/staking.rs index 9022f45a36..97b6b6fffa 100644 --- a/precompiles/src/staking.rs +++ b/precompiles/src/staking.rs @@ -120,6 +120,7 @@ where } #[precompile::public("getTotalColdkeyStake(bytes32)")] + #[precompile::view] fn get_total_coldkey_stake( _handle: &mut impl PrecompileHandle, coldkey: H256, @@ -131,6 +132,7 @@ where } #[precompile::public("getTotalHotkeyStake(bytes32)")] + #[precompile::view] fn get_total_hotkey_stake( _handle: &mut impl PrecompileHandle, hotkey: H256, @@ -275,6 +277,7 @@ where } #[precompile::public("getTotalColdkeyStake(bytes32)")] + #[precompile::view] fn get_total_coldkey_stake( _handle: &mut impl PrecompileHandle, coldkey: H256, @@ -292,6 +295,7 @@ where } #[precompile::public("getTotalHotkeyStake(bytes32)")] + #[precompile::view] fn get_total_hotkey_stake( _handle: &mut impl PrecompileHandle, hotkey: H256, diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 909207e142..b7fbf261ed 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -205,7 +205,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // `spec_version`, and `authoring_version` are the same between Wasm and native. // This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use // the compatible custom types. - spec_version: 246, + spec_version: 247, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1, From 194da702437d476e6ce814738681084f4b96d609 Mon Sep 17 00:00:00 2001 From: Aliaksandr Tsurko Date: Tue, 11 Mar 2025 15:19:03 +0100 Subject: [PATCH 2/2] Reformat --- precompiles/src/staking.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/precompiles/src/staking.rs b/precompiles/src/staking.rs index 97b6b6fffa..192e55f57c 100644 --- a/precompiles/src/staking.rs +++ b/precompiles/src/staking.rs @@ -120,7 +120,7 @@ where } #[precompile::public("getTotalColdkeyStake(bytes32)")] - #[precompile::view] + #[precompile::view] fn get_total_coldkey_stake( _handle: &mut impl PrecompileHandle, coldkey: H256, @@ -132,7 +132,7 @@ where } #[precompile::public("getTotalHotkeyStake(bytes32)")] - #[precompile::view] + #[precompile::view] fn get_total_hotkey_stake( _handle: &mut impl PrecompileHandle, hotkey: H256, @@ -277,7 +277,7 @@ where } #[precompile::public("getTotalColdkeyStake(bytes32)")] - #[precompile::view] + #[precompile::view] fn get_total_coldkey_stake( _handle: &mut impl PrecompileHandle, coldkey: H256, @@ -295,7 +295,7 @@ where } #[precompile::public("getTotalHotkeyStake(bytes32)")] - #[precompile::view] + #[precompile::view] fn get_total_hotkey_stake( _handle: &mut impl PrecompileHandle, hotkey: H256,