diff --git a/Cargo.lock b/Cargo.lock index f9881967c..d5db4f5f3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -839,9 +839,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.9.1" +version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" +checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3" [[package]] name = "byte-slice-cast" @@ -1118,7 +1118,7 @@ dependencies = [ [[package]] name = "crab-runtime" -version = "0.12.2-2" +version = "0.12.2-3" dependencies = [ "array-bytes", "bp-crab", @@ -1469,7 +1469,7 @@ dependencies = [ [[package]] name = "darwinia" -version = "0.12.2-2" +version = "0.12.2-3" dependencies = [ "darwinia-cli", "darwinia-node-service", @@ -1479,7 +1479,7 @@ dependencies = [ [[package]] name = "darwinia-balances" version = "2.8.11" -source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#997ca9a073ca7ac148181d57b338ffa341e57336" +source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#3c028bded783b3e111dabb19efe021055d99a877" dependencies = [ "darwinia-balances-rpc-runtime-api", "darwinia-support", @@ -1494,7 +1494,7 @@ dependencies = [ [[package]] name = "darwinia-balances-rpc" version = "2.8.11" -source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#997ca9a073ca7ac148181d57b338ffa341e57336" +source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#3c028bded783b3e111dabb19efe021055d99a877" dependencies = [ "darwinia-balances-rpc-runtime-api", "jsonrpc-core", @@ -1509,7 +1509,7 @@ dependencies = [ [[package]] name = "darwinia-balances-rpc-runtime-api" version = "2.8.11" -source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#997ca9a073ca7ac148181d57b338ffa341e57336" +source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#3c028bded783b3e111dabb19efe021055d99a877" dependencies = [ "darwinia-support", "parity-scale-codec 2.3.1", @@ -1521,7 +1521,7 @@ dependencies = [ [[package]] name = "darwinia-bridge-ethereum" version = "2.8.11" -source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#997ca9a073ca7ac148181d57b338ffa341e57336" +source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#3c028bded783b3e111dabb19efe021055d99a877" dependencies = [ "array-bytes", "blake2-rfc", @@ -1564,7 +1564,7 @@ dependencies = [ [[package]] name = "darwinia-common-runtime" -version = "0.12.2-2" +version = "0.12.2-3" dependencies = [ "bp-messages", "bridge-runtime-common", @@ -1591,7 +1591,7 @@ dependencies = [ [[package]] name = "darwinia-ethereum" version = "2.8.11" -source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#997ca9a073ca7ac148181d57b338ffa341e57336" +source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#3c028bded783b3e111dabb19efe021055d99a877" dependencies = [ "darwinia-evm", "darwinia-support", @@ -1622,7 +1622,7 @@ dependencies = [ [[package]] name = "darwinia-evm" version = "2.8.11" -source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#997ca9a073ca7ac148181d57b338ffa341e57336" +source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#3c028bded783b3e111dabb19efe021055d99a877" dependencies = [ "array-bytes", "darwinia-balances", @@ -1652,7 +1652,7 @@ dependencies = [ [[package]] name = "darwinia-evm-precompile-bridge-s2s" version = "2.8.11" -source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#997ca9a073ca7ac148181d57b338ffa341e57336" +source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#3c028bded783b3e111dabb19efe021055d99a877" dependencies = [ "bp-message-dispatch", "bp-runtime", @@ -1675,7 +1675,7 @@ dependencies = [ [[package]] name = "darwinia-evm-precompile-dispatch" version = "2.8.11" -source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#997ca9a073ca7ac148181d57b338ffa341e57336" +source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#3c028bded783b3e111dabb19efe021055d99a877" dependencies = [ "darwinia-evm", "darwinia-evm-precompile-utils", @@ -1690,7 +1690,7 @@ dependencies = [ [[package]] name = "darwinia-evm-precompile-transfer" version = "2.8.11" -source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#997ca9a073ca7ac148181d57b338ffa341e57336" +source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#3c028bded783b3e111dabb19efe021055d99a877" dependencies = [ "array-bytes", "darwinia-ethereum", @@ -1713,7 +1713,7 @@ dependencies = [ [[package]] name = "darwinia-evm-precompile-utils" version = "2.8.11" -source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#997ca9a073ca7ac148181d57b338ffa341e57336" +source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#3c028bded783b3e111dabb19efe021055d99a877" dependencies = [ "darwinia-evm", "darwinia-evm-precompile-utils-macro", @@ -1730,7 +1730,7 @@ dependencies = [ [[package]] name = "darwinia-evm-precompile-utils-macro" version = "2.8.11" -source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#997ca9a073ca7ac148181d57b338ffa341e57336" +source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#3c028bded783b3e111dabb19efe021055d99a877" dependencies = [ "proc-macro2", "quote", @@ -1741,7 +1741,7 @@ dependencies = [ [[package]] name = "darwinia-header-mmr" version = "2.8.11" -source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#997ca9a073ca7ac148181d57b338ffa341e57336" +source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#3c028bded783b3e111dabb19efe021055d99a877" dependencies = [ "ckb-merkle-mountain-range", "darwinia-header-mmr-rpc-runtime-api", @@ -1761,7 +1761,7 @@ dependencies = [ [[package]] name = "darwinia-header-mmr-rpc-runtime-api" version = "2.8.11" -source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#997ca9a073ca7ac148181d57b338ffa341e57336" +source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#3c028bded783b3e111dabb19efe021055d99a877" dependencies = [ "darwinia-support", "parity-scale-codec 2.3.1", @@ -1773,7 +1773,7 @@ dependencies = [ [[package]] name = "darwinia-node-service" -version = "0.12.2-2" +version = "0.12.2-3" dependencies = [ "array-bytes", "crab-runtime", @@ -1839,7 +1839,7 @@ dependencies = [ [[package]] name = "darwinia-primitives" -version = "0.12.2-2" +version = "0.12.2-3" dependencies = [ "parity-scale-codec 2.3.1", "sp-core", @@ -1849,7 +1849,7 @@ dependencies = [ [[package]] name = "darwinia-relay-authorities" version = "2.8.11" -source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#997ca9a073ca7ac148181d57b338ffa341e57336" +source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#3c028bded783b3e111dabb19efe021055d99a877" dependencies = [ "darwinia-relay-primitives", "darwinia-support", @@ -1864,7 +1864,7 @@ dependencies = [ [[package]] name = "darwinia-relay-primitives" version = "2.8.11" -source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#997ca9a073ca7ac148181d57b338ffa341e57336" +source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#3c028bded783b3e111dabb19efe021055d99a877" dependencies = [ "frame-support", "parity-scale-codec 2.3.1", @@ -1876,7 +1876,7 @@ dependencies = [ [[package]] name = "darwinia-relayer-game" version = "2.8.11" -source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#997ca9a073ca7ac148181d57b338ffa341e57336" +source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#3c028bded783b3e111dabb19efe021055d99a877" dependencies = [ "darwinia-relay-primitives", "frame-support", @@ -1890,7 +1890,7 @@ dependencies = [ [[package]] name = "darwinia-rpc" -version = "0.12.2-2" +version = "0.12.2-3" dependencies = [ "crab-runtime", "darwinia-balances-rpc", @@ -1933,7 +1933,7 @@ dependencies = [ [[package]] name = "darwinia-runtime" -version = "0.12.2-2" +version = "0.12.2-3" dependencies = [ "bp-crab", "bp-darwinia", @@ -2025,7 +2025,7 @@ dependencies = [ [[package]] name = "darwinia-staking" version = "2.8.11" -source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#997ca9a073ca7ac148181d57b338ffa341e57336" +source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#3c028bded783b3e111dabb19efe021055d99a877" dependencies = [ "darwinia-staking-rpc-runtime-api", "darwinia-support", @@ -2050,7 +2050,7 @@ dependencies = [ [[package]] name = "darwinia-staking-rpc" version = "2.8.11" -source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#997ca9a073ca7ac148181d57b338ffa341e57336" +source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#3c028bded783b3e111dabb19efe021055d99a877" dependencies = [ "darwinia-staking-rpc-runtime-api", "jsonrpc-core", @@ -2065,7 +2065,7 @@ dependencies = [ [[package]] name = "darwinia-staking-rpc-runtime-api" version = "2.8.11" -source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#997ca9a073ca7ac148181d57b338ffa341e57336" +source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#3c028bded783b3e111dabb19efe021055d99a877" dependencies = [ "darwinia-support", "parity-scale-codec 2.3.1", @@ -2077,7 +2077,7 @@ dependencies = [ [[package]] name = "darwinia-support" version = "2.8.11" -source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#997ca9a073ca7ac148181d57b338ffa341e57336" +source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#3c028bded783b3e111dabb19efe021055d99a877" dependencies = [ "bp-messages", "bp-runtime", @@ -2213,7 +2213,7 @@ checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" [[package]] name = "dp-asset" version = "2.8.11" -source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#997ca9a073ca7ac148181d57b338ffa341e57336" +source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#3c028bded783b3e111dabb19efe021055d99a877" dependencies = [ "ethereum-types", "parity-scale-codec 2.3.1", @@ -2224,7 +2224,7 @@ dependencies = [ [[package]] name = "dp-contract" version = "2.8.11" -source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#997ca9a073ca7ac148181d57b338ffa341e57336" +source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#3c028bded783b3e111dabb19efe021055d99a877" dependencies = [ "bp-messages", "dp-asset", @@ -2237,7 +2237,7 @@ dependencies = [ [[package]] name = "dp-evm-trace-ext" version = "2.8.11" -source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#997ca9a073ca7ac148181d57b338ffa341e57336" +source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#3c028bded783b3e111dabb19efe021055d99a877" dependencies = [ "ethereum-types", "evm-tracing-events", @@ -2250,7 +2250,7 @@ dependencies = [ [[package]] name = "dp-evm-tracer" version = "2.8.11" -source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#997ca9a073ca7ac148181d57b338ffa341e57336" +source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#3c028bded783b3e111dabb19efe021055d99a877" dependencies = [ "dp-evm-trace-ext", "ethereum-types", @@ -2268,7 +2268,7 @@ dependencies = [ [[package]] name = "dp-s2s" version = "2.8.11" -source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#997ca9a073ca7ac148181d57b338ffa341e57336" +source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#3c028bded783b3e111dabb19efe021055d99a877" dependencies = [ "array-bytes", "bp-message-dispatch", @@ -2480,7 +2480,7 @@ dependencies = [ [[package]] name = "ethereum-primitives" version = "2.8.11" -source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#997ca9a073ca7ac148181d57b338ffa341e57336" +source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#3c028bded783b3e111dabb19efe021055d99a877" dependencies = [ "array-bytes", "ethash", @@ -3104,7 +3104,7 @@ dependencies = [ [[package]] name = "from-substrate-issuing" version = "2.8.11" -source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#997ca9a073ca7ac148181d57b338ffa341e57336" +source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#3c028bded783b3e111dabb19efe021055d99a877" dependencies = [ "array-bytes", "bp-message-dispatch", @@ -4871,7 +4871,7 @@ checksum = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" [[package]] name = "merkle-patricia-trie" version = "2.8.11" -source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#997ca9a073ca7ac148181d57b338ffa341e57336" +source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#3c028bded783b3e111dabb19efe021055d99a877" dependencies = [ "hashbrown", "keccak-hash", @@ -9486,7 +9486,7 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "to-ethereum-backing" version = "2.8.11" -source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#997ca9a073ca7ac148181d57b338ffa341e57336" +source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#3c028bded783b3e111dabb19efe021055d99a877" dependencies = [ "array-bytes", "darwinia-relay-primitives", @@ -9507,7 +9507,7 @@ dependencies = [ [[package]] name = "to-substrate-backing" version = "2.8.11" -source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#997ca9a073ca7ac148181d57b338ffa341e57336" +source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#3c028bded783b3e111dabb19efe021055d99a877" dependencies = [ "array-bytes", "bp-message-dispatch", @@ -9533,7 +9533,7 @@ dependencies = [ [[package]] name = "to-tron-backing" version = "2.8.11" -source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#997ca9a073ca7ac148181d57b338ffa341e57336" +source = "git+https://github.com/darwinia-network/darwinia-common?branch=darwinia-v0.12.2#3c028bded783b3e111dabb19efe021055d99a877" dependencies = [ "frame-support", "frame-system", diff --git a/Cargo.toml b/Cargo.toml index 3ae4977e1..5b0184a47 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ homepage = "https://darwinia.network" license = "GPL-3.0" name = "darwinia" repository = "https://github.com/darwinia-network/darwinia" -version = "0.12.2-2" +version = "0.12.2-3" [[bin]] name = "darwinia" diff --git a/node/service/Cargo.toml b/node/service/Cargo.toml index 6bd0d8357..1b67e9a2b 100644 --- a/node/service/Cargo.toml +++ b/node/service/Cargo.toml @@ -6,7 +6,7 @@ homepage = "https://darwinia.network" license = "GPL-3.0" name = "darwinia-node-service" repository = "https://github.com/darwinia-network/darwinia" -version = "0.12.2-2" +version = "0.12.2-3" [dependencies] # crates.io diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index c40e12ba3..e0a4dc343 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -6,7 +6,7 @@ homepage = "https://darwinia.network" license = "GPL-3.0" name = "darwinia-primitives" repository = "https://github.com/darwinia-network/darwinia" -version = "0.12.2-2" +version = "0.12.2-3" [dependencies] # crates.io diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index dab1a1a4c..1f6596d82 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -6,7 +6,7 @@ homepage = "https://darwinia.network" license = "GPL-3.0" name = "darwinia-rpc" repository = "https://github.com/darwinia-network/darwinia" -version = "0.12.2-2" +version = "0.12.2-3" [dependencies] # crates.io diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index e9b27ea50..233243b27 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -6,7 +6,7 @@ homepage = "https://darwinia.network" license = "GPL-3.0" name = "darwinia-common-runtime" repository = "https://github.com/darwinia-network/darwinia" -version = "0.12.2-2" +version = "0.12.2-3" [dependencies] # crates.io diff --git a/runtime/crab/Cargo.toml b/runtime/crab/Cargo.toml index 482741f3d..026d02516 100644 --- a/runtime/crab/Cargo.toml +++ b/runtime/crab/Cargo.toml @@ -7,7 +7,7 @@ homepage = "https://darwinia.network" license = "GPL-3.0" name = "crab-runtime" repository = "https://github.com/darwinia-network/darwinia" -version = "0.12.2-2" +version = "0.12.2-3" [dependencies] # crates.io diff --git a/runtime/crab/src/lib.rs b/runtime/crab/src/lib.rs index e035062e0..1a4c17a98 100644 --- a/runtime/crab/src/lib.rs +++ b/runtime/crab/src/lib.rs @@ -134,7 +134,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: sp_runtime::create_runtime_str!("Crab"), impl_name: sp_runtime::create_runtime_str!("Darwinia Crab"), authoring_version: 0, - spec_version: 12_2_2, + spec_version: 12_2_3, impl_version: 0, #[cfg(not(feature = "disable-runtime-api"))] apis: RUNTIME_API_VERSIONS, diff --git a/runtime/crab/src/migrations.rs b/runtime/crab/src/migrations.rs index f9b5397cf..cdb360f22 100644 --- a/runtime/crab/src/migrations.rs +++ b/runtime/crab/src/migrations.rs @@ -1,11 +1,6 @@ // --- paritytech --- #[allow(unused)] use frame_support::{migration, traits::OnRuntimeUpgrade, weights::Weight}; -use frame_support::{ - traits::{Currency, LockableCurrency}, - PalletId, -}; -use sp_runtime::traits::AccountIdConversion; // --- darwinia-network --- #[allow(unused)] use crate::*; @@ -14,19 +9,11 @@ pub struct CustomOnRuntimeUpgrade; impl OnRuntimeUpgrade for CustomOnRuntimeUpgrade { #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result<(), &'static str> { - let claims_pallet_account = PalletId(*b"da/claim").into_account(); - - assert!(Ring::free_balance(&claims_pallet_account) != 0); - Ok(()) } #[cfg(feature = "try-runtime")] fn post_upgrade() -> Result<(), &'static str> { - let claims_pallet_account = PalletId(*b"da/claim").into_account(); - - assert!(Ring::free_balance(&claims_pallet_account) == 0); - Ok(()) } @@ -36,24 +23,56 @@ impl OnRuntimeUpgrade for CustomOnRuntimeUpgrade { } fn migrate() -> Weight { - darwinia_balances::migration::migrate::(); - darwinia_balances::migration::migrate::(); + // --- darwinia-network --- + use darwinia_staking::{StakingLedger, STAKING_ID}; + + let now = System::block_number(); + + migration::storage_iter::>( + b"Staking", b"Ledger", + ) + .for_each( + |( + _k, + StakingLedger { + stash, active, active_kton, ring_staking_lock, kton_staking_lock, .. + }, + )| { + let all_ring_lock = ring_staking_lock.total_unbond(); + let valid_ring_lock = ring_staking_lock.total_unbond_at(now); + + if all_ring_lock != valid_ring_lock { + >::mutate(&stash, |locks| { + // `WeakBoundedVec` only implement `IndexMut`, otherwise we can use `iter_mut` + // here. + for i in 0..locks.len() { + let lock = &mut locks[i]; - migration::remove_storage_prefix(b"DarwiniaClaims", b"ClaimsFromEth", &[]); - migration::remove_storage_prefix(b"DarwiniaClaims", b"ClaimsFromTron", &[]); + if lock.id == STAKING_ID { + lock.amount = active + valid_ring_lock; + } + } + }); + } - let claims_pallet_id = PalletId(*b"da/claim"); - let claims_pallet_account = claims_pallet_id.into_account(); - let treasury_account = PalletId(*b"da/trsry").into_account(); + let all_kton_lock = kton_staking_lock.total_unbond(); + let valid_kton_lock = kton_staking_lock.total_unbond_at(now); - // We mint this ED before. Clean it. - Ring::remove_lock(claims_pallet_id.0, &claims_pallet_account); - let _ = Ring::slash(&claims_pallet_account, 1 * COIN); - // Transfer all balances to treasury account. - let _ = Ring::transfer_all(Origin::signed(claims_pallet_account), treasury_account, false); + if all_kton_lock != valid_kton_lock { + >::mutate(&stash, |locks| { + // `WeakBoundedVec` only implement `IndexMut`, otherwise we can use `iter_mut` + // here. + for i in 0..locks.len() { + let lock = &mut locks[i]; - migration::remove_storage_prefix(b"Sudo", b"Key", &[]); - migration::move_pallet(b"FeeMarket", b"DarwiniaFeeMarket"); + if lock.id == STAKING_ID { + lock.amount = active_kton + valid_kton_lock; + } + } + }); + } + }, + ); // 0 RuntimeBlockWeights::get().max_block diff --git a/runtime/darwinia/Cargo.toml b/runtime/darwinia/Cargo.toml index affb0d4aa..82d159864 100644 --- a/runtime/darwinia/Cargo.toml +++ b/runtime/darwinia/Cargo.toml @@ -7,7 +7,7 @@ homepage = "https://darwinia.network" license = "GPL-3.0" name = "darwinia-runtime" repository = "https://github.com/darwinia-network/darwinia" -version = "0.12.2-2" +version = "0.12.2-3" [dependencies] # crates.io diff --git a/runtime/darwinia/src/lib.rs b/runtime/darwinia/src/lib.rs index eb54d986e..a3025c104 100644 --- a/runtime/darwinia/src/lib.rs +++ b/runtime/darwinia/src/lib.rs @@ -173,7 +173,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: sp_runtime::create_runtime_str!("Darwinia"), impl_name: sp_runtime::create_runtime_str!("Darwinia"), authoring_version: 0, - spec_version: 12_2_2, + spec_version: 12_2_3, impl_version: 0, #[cfg(not(feature = "disable-runtime-api"))] apis: RUNTIME_API_VERSIONS,