Skip to content
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.

Commit

Permalink
Migrate balances to Attribute Macro (#593)
Browse files Browse the repository at this point in the history
* remove `Subtrait`

* migrate balances to attribute macro

* update re-export items

* fix compile

* try-runtime

* fix compile

* `Ring` to `Balances`

* add migration

* update `spec_version`
  • Loading branch information
AurevoirXavier authored Apr 21, 2021
1 parent 349805f commit 4041896
Show file tree
Hide file tree
Showing 36 changed files with 1,314 additions and 1,231 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions bin/node/runtime/pangolin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ with-tracing = ["frame-executive/with-tracing"]
try-runtime = [
"frame-executive/try-runtime",
"frame-try-runtime",
"darwinia-balances/try-runtime",
"darwinia-crab-issuing/try-runtime",
"darwinia-staking/try-runtime",
]
10 changes: 6 additions & 4 deletions bin/node/runtime/pangolin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
impl_name: create_runtime_str!("Pangolin"),
authoring_version: 1,
// crate version ~2.2.0 := >=2.2.0, <2.3.0
spec_version: 220,
spec_version: 221,
impl_version: 1,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down Expand Up @@ -798,11 +798,13 @@ pub struct CustomOnRuntimeUpgrade;
impl OnRuntimeUpgrade for CustomOnRuntimeUpgrade {
#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<(), &'static str> {
darwinia_crab_issuing::migration::try_runtime::pre_migrate::<Runtime>()?;
darwinia_staking::migrations::v6::pre_migrate::<Runtime>()
darwinia_balances::migration::try_runtime::pre_migrate()
}

fn on_runtime_upgrade() -> Weight {
0
darwinia_balances::migration::migrate(b"Instance0DarwiniaBalances", b"Balances");
darwinia_balances::migration::migrate(b"Instance1DarwiniaBalances", b"Kton");

RuntimeBlockWeights::get().max_block
}
}
6 changes: 6 additions & 0 deletions frame/balances/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ version = "2.2.0"
# crates
codec = { package = "parity-scale-codec", version = "2.0.1", default-features = false }
log = { version = "0.4.14" }
paste = { version = "1.0.5", optional = true }
serde = { version = "1.0.125", optional = true }
# darwinia
darwinia-balances-rpc-runtime-api = { default-features = false, path = "./rpc/runtime-api" }
Expand Down Expand Up @@ -52,3 +53,8 @@ substrate-std = [
"sp-runtime/std",
"sp-std/std",
]

try-runtime = [
"paste",
"frame-support/try-runtime",
]
Loading

0 comments on commit 4041896

Please sign in to comment.