Skip to content

Commit

Permalink
Bump to 1.0.0 (#935)
Browse files Browse the repository at this point in the history
* change dependency to v1.0.0

* chaneg to use runtimeEvent, runtimeCall and remove useless pallet

* minor change

* rename Origin to RuntimeOrigin

* working

* single parachain import instance

* before xcm v3 commit

* working

* update dependency

* weight changed

* update xcm and asset manager migration

* wip

* xcm not working right now

* need to check

* compile successfully

* update state/wasm/spec

* add temp sudo

* add Rococo network conversion

* bump version and add state, wase and spec

* remove sudo

* remove warning info
  • Loading branch information
mmyyrroonn authored Jan 5, 2024
1 parent a39dd1f commit b59b90f
Show file tree
Hide file tree
Showing 98 changed files with 3,990 additions and 25,771 deletions.
2 changes: 1 addition & 1 deletion crust-collator-state-2008
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0x0000000000000000000000000000000000000000000000000000000000000000000a02d839e87675d5b98a224ffa3df5e7629903a64325ea0448e241dc318c8c2c03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c11131400
0x00000000000000000000000000000000000000000000000000000000000000000064a6841f4eaa8a1fc77fc43dcd2721aedbbb24fb4cf9d59c183c9b02fe84a28703170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c11131400
2 changes: 1 addition & 1 deletion crust-collator-state-2012
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0x0000000000000000000000000000000000000000000000000000000000000000009edc452eda455f3c703c388db82af9d62478ccf59a8adf451255f7e5e8699c0b03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c11131400
0x000000000000000000000000000000000000000000000000000000000000000000a859850cdbb8db78e33da9931e6e53a30a240db81d27a8142607009dc956210703170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c11131400
2 changes: 1 addition & 1 deletion crust-collator-state-staging
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0x000000000000000000000000000000000000000000000000000000000000000000c415d73bab7d5728301b1d25008e9f2c11729539a9fef11099ff2fd23464815a03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c11131400
0x0000000000000000000000000000000000000000000000000000000000000000005005999bc7f6a4fbc2c30b616c55e63dd90c8a60b211243404ac5a67f3e97ee103170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c11131400
2 changes: 1 addition & 1 deletion crust-collator-wasm-2008

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion crust-collator-wasm-2012

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion crust-collator-wasm-staging

Large diffs are not rendered by default.

108 changes: 54 additions & 54 deletions crust-collator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,57 +12,61 @@ path = "src/main.rs"
[dependencies]
derive_more = "0.15.0"
exit-future = "0.1.4"
futures = "0.3.21"
log = "0.4.17"
futures = "0.3.28"
log = "0.4.19"
parking_lot = "0.12.0"
trie-root = "0.15.2"
codec = { package = "parity-scale-codec", version = "3.0.0" }
structopt = "0.3.3"
serde = { version = "1.0.144", features = ["derive"] }
hex-literal = "0.3.4"
clap = { version = "3.2.15", features = ["derive"] }
serde = { version = "1.0.171", features = ["derive"] }
hex-literal = "0.4.1"
clap = { version = "4.3.12", features = ["derive"] }

# Parachain dependencies
parachain-runtime = { package = "crust-parachain-runtime", path = "runtime" }
crust-parachain-primitives = { path = "primitives" }

# Substrate dependencies
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.29" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
sc-network-common = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
sp-trie = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
sc-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
sc-network-sync = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
sp-trie = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
sc-sysinfo = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
sc-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }


# RPC related dependencies
jsonrpsee = { version = "0.15.0", default-features = false, features = [ "macros", "server" ] }
sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
frame-rpc-system = { package = "substrate-frame-rpc-system", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
jsonrpsee = { version = "0.16.3", default-features = false, features = [ "macros", "server" ] }
sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
frame-rpc-system = { package = "substrate-frame-rpc-system", git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }

# Cumulus dependencies
cumulus-client-cli = { path = "../cumulus/client/cli" }
Expand All @@ -71,21 +75,17 @@ cumulus-client-consensus-relay-chain = { path = "../cumulus/client/consensus/rel
cumulus-client-consensus-common = { path = "../cumulus/client/consensus/common" }
cumulus-client-collator = { path = "../cumulus/client/collator" }
cumulus-client-service = { path = "../cumulus/client/service" }
cumulus-client-network = { path = "../cumulus/client/network" }
cumulus-primitives-core = { path = "../cumulus/primitives/core" }
cumulus-primitives-parachain-inherent = { path = "../cumulus/primitives/parachain-inherent" }
cumulus-relay-chain-interface = { path = "../cumulus/client/relay-chain-interface" }
cumulus-relay-chain-inprocess-interface = { path = "../cumulus/client/relay-chain-inprocess-interface" }
cumulus-relay-chain-rpc-interface = { path = "../cumulus/client/relay-chain-rpc-interface" }

# Polkadot dependencies
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29" }
polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29" }
polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29" }
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29" }
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v1.0.0" }
polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v1.0.0" }
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v1.0.0" }

[build-dependencies]
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }

[dev-dependencies]
assert_cmd = "0.12"
Expand All @@ -94,12 +94,12 @@ rand = "0.7.3"
tokio = { version = "1.10", features = ["macros"] }

# Polkadot dependencies
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29" }
polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29" }
polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29" }
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29" }
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v1.0.0" }
polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "release-v1.0.0" }
polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v1.0.0" }
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v1.0.0" }

# Substrate dependencies
pallet-sudo = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
substrate-test-client = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
substrate-test-runtime-client = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
pallet-sudo = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
substrate-test-client = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
substrate-test-runtime-client = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
24 changes: 12 additions & 12 deletions crust-collator/pallets/asset-manager/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,30 @@ version = "0.1.0"
# Thanks for the moonbeam's team. Due to the dependencies issues, just copy the code into our project and keep all the information

[dependencies]
log = { version = "0.4.17", default-features = false }
serde = { version = "1.0.144", optional = true }
log = { version = "0.4.19", default-features = false }
serde = { version = "1.0.171", optional = true }

# Moonbeam
primitives = { package = "crust-parachain-primitives", path = "../../primitives", default-features = false }

# Substrate
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false }
parity-scale-codec = { version = "3.0.0", default-features = false, features = [ "derive" ] }
scale-info = { version = "2.2.0", default-features = false, features = [ "derive" ] }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", default-features = false }
scale-info = { version = "2.9.0", default-features = false, features = [ "derive" ] }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", default-features = false }

# Polkadot
xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29", default-features = false }
xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v1.0.0", default-features = false }

# Benchmarks
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29", optional = true, default-features = false }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0", optional = true, default-features = false }

[dev-dependencies]
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.29" }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }

[features]
default = [ "std" ]
Expand Down
12 changes: 9 additions & 3 deletions crust-collator/pallets/asset-manager/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ pub mod mock;
#[cfg(test)]
pub mod tests;
pub mod weights;
pub mod migration;

#[pallet]
pub mod pallet {
Expand Down Expand Up @@ -98,7 +99,7 @@ pub mod pallet {

#[pallet::config]
pub trait Config: frame_system::Config {
type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>;
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;

/// The Asset Id. This will be used to register the asset in Assets
type AssetId: Member + Parameter + Default + Copy + HasCompact + MaxEncodedLen;
Expand All @@ -115,8 +116,8 @@ pub mod pallet {
/// The trait we use to register Assets
type AssetRegistrar: AssetRegistrar<Self>;

/// Origin that is allowed to create and modify asset information
type AssetModifierOrigin: EnsureOrigin<Self::Origin>;
/// RuntimeOrigin that is allowed to create and modify asset information
type AssetModifierOrigin: EnsureOrigin<Self::RuntimeOrigin>;

type WeightInfo: WeightInfo;
}
Expand Down Expand Up @@ -189,6 +190,7 @@ pub mod pallet {
#[pallet::call]
impl<T: Config> Pallet<T> {
/// Register new asset with the asset manager
#[pallet::call_index(0)]
#[pallet::weight(T::WeightInfo::register_foreign_asset())]
pub fn register_asset(
origin: OriginFor<T>,
Expand Down Expand Up @@ -219,6 +221,7 @@ pub mod pallet {
}

/// Change the amount of units we are charging per execution second for a given AssetType
#[pallet::call_index(1)]
#[pallet::weight(T::WeightInfo::set_asset_units_per_second(*num_assets_weight_hint))]
pub fn set_asset_units_per_second(
origin: OriginFor<T>,
Expand Down Expand Up @@ -259,6 +262,7 @@ pub mod pallet {
/// Change the xcm type mapping for a given assetId
/// We also change this if the previous units per second where pointing at the old
/// assetType
#[pallet::call_index(2)]
#[pallet::weight(T::WeightInfo::change_existing_asset_type(*num_assets_weight_hint))]
pub fn change_existing_asset_type(
origin: OriginFor<T>,
Expand Down Expand Up @@ -313,6 +317,7 @@ pub mod pallet {
Ok(())
}

#[pallet::call_index(3)]
#[pallet::weight(T::WeightInfo::remove_supported_asset(*num_assets_weight_hint))]
pub fn remove_supported_asset(
origin: OriginFor<T>,
Expand Down Expand Up @@ -344,6 +349,7 @@ pub mod pallet {
Ok(())
}

#[pallet::call_index(4)]
/// Remove a given assetId -> assetType association
#[pallet::weight(T::WeightInfo::remove_existing_asset_type(*num_assets_weight_hint))]
pub fn remove_existing_asset_type(
Expand Down
Loading

0 comments on commit b59b90f

Please sign in to comment.