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

Asset module migration #260

Merged
merged 41 commits into from
Feb 8, 2023
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
d6ec5db
Anchor polkadot-v0.9.36
Jan 17, 2023
6079a59
Companion for paritytech/cumulus#1860
Jan 17, 2023
4e1012c
Companion for paritytech/cumulus#1876
Jan 17, 2023
33dffeb
Companion for paritytech/cumulus#1904
Jan 17, 2023
2260b86
Companion for paritytech/substrate#12310
Jan 17, 2023
69b8b60
Companion for paritytech/substrate#12740
Jan 17, 2023
578ecf9
Bump array-bytes to 6.0.0
Jan 17, 2023
89d724f
Companion for paritytech/substrate#12868
Jan 17, 2023
19e0213
Companion for paritytech/cumulus#1930
Jan 17, 2023
71a09ea
Companion for paritytech/cumulus#1905
Jan 17, 2023
8a7b991
Companion for paritytech/cumulus#1880
Jan 17, 2023
f830826
Companion for paritytech/cumulus#1997
Jan 17, 2023
c120ab2
Companion for paritytech/cumulus#1559
Jan 17, 2023
45d5dd5
Prepare messages-substrate
Jan 28, 2023
e0e43c7
Companion for paritytech/substrate#12684
Jan 28, 2023
2bc644a
Companion for paritytech/substrate#12740
Jan 28, 2023
7458b49
Fix compile paritytech/substrate#12740
Jan 28, 2023
7bd3983
Compile done
Jan 28, 2023
ee6b187
Format
Jan 28, 2023
0fc11d3
Add call index
Jan 29, 2023
6ae68f3
Merge branch 'main' into prepare-polkadot-v0.9.36
Jan 29, 2023
309683a
Compile done
Feb 2, 2023
7107bc0
Merge branch 'main' into prepare-polkadot-v0.9.36
Feb 2, 2023
7b57d0f
Fix CI
Feb 2, 2023
e94375b
Bump moonbeam
Feb 2, 2023
b877161
Merge branch 'main' into prepare-polkadot-v0.9.36
Feb 2, 2023
e24be36
Fix CI
Feb 2, 2023
2cdd2a5
Try fix tests
Feb 3, 2023
65e66ce
Merge branch 'main' into prepare-polkadot-v0.9.36
Feb 3, 2023
d3b7ece
Use into instead of `Compact`
Feb 3, 2023
89593c4
Merge branch 'main' into prepare-polkadot-v0.9.36
Feb 3, 2023
7a5710e
Patch substrate & Fix compile
Feb 3, 2023
e76813d
Merge branch 'prepare-polkadot-v0.9.36' of https://github.com/darwini…
Feb 3, 2023
abd93a0
Fix try-runtime
Feb 3, 2023
1c94d4b
Remove parity-util-mem
Feb 3, 2023
77ecbd4
Companion for https://github.com/paritytech/substrate/pull/12310
boundless-forest Feb 6, 2023
6f85166
Update state processor
boundless-forest Feb 6, 2023
96c09fa
Add type link
boundless-forest Feb 6, 2023
3503118
Merge branch 'main' into bear-migration
boundless-forest Feb 8, 2023
45e1b4d
Fix review issues
boundless-forest Feb 8, 2023
e70ee46
Format
boundless-forest Feb 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions runtime/pangolin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
pallet_assets::migration::v1::MigrateToV1<Runtime>,
>;

/// Darwinia proposal base fee.
Expand Down
2 changes: 1 addition & 1 deletion tool/state-processor/src/system/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ where
sufficients: Default::default(),
accounts: Default::default(),
approvals: Default::default(),
is_frozen: false,
status: Default::default(),
};

log::info!("increase `EVM::AccountCodes`'s `sufficients` and set `Assets::Account`, `System::Account`, `AccountMigration::KtonAccounts` and `AccountMigration::Accounts`");
Expand Down
7 changes: 6 additions & 1 deletion tool/state-processor/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,10 +359,15 @@ fn asset_creation() {
&blake2_128_concat_to_string(KTON_ID.encode()),
&mut details,
);
assert!(details.accounts > 0);
assert_eq!(details.owner, ROOT);
assert!(details.supply != 0);
assert_eq!(details.deposit, 0);
assert_eq!(details.min_balance, 1);
assert_eq!(details.is_sufficient, true);
assert_eq!(details.sufficients, details.accounts);
assert!(details.accounts > 0);
assert_eq!(details.approvals, 0);
assert_eq!(details.status, AssetStatus::Live);
});
}

Expand Down
16 changes: 15 additions & 1 deletion tool/state-processor/src/type_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,21 @@ pub struct AssetDetails {
pub accounts: u32,
pub sufficients: u32,
pub approvals: u32,
pub is_frozen: bool,
pub status: AssetStatus,
}

// https://github.com/paritytech/substrate/blob/polkadot-v0.9.36/frame/assets/src/types.rs#L35
#[derive(Debug, Encode, Decode, PartialEq)]
pub enum AssetStatus {
Live,
Frozen,
Destroying,
}

boundless-forest marked this conversation as resolved.
Show resolved Hide resolved
impl Default for AssetStatus {
fn default() -> Self {
AssetStatus::Live
}
}

// https://github.dev/paritytech/substrate/blob/polkadot-v0.9.30/frame/assets/src/types.rs#L115
Expand Down