From 7eacabe8c183a2bfcd0f40092bc2348fc65ac302 Mon Sep 17 00:00:00 2001 From: PierreOssun Date: Fri, 18 Nov 2022 14:41:53 +0100 Subject: [PATCH 1/2] added pallet-asset ce --- Cargo.lock | 51 ++++++++++++++++++++++++++++++++++++++++++++++ runtime/Cargo.toml | 6 ++++++ runtime/src/lib.rs | 2 +- 3 files changed, 58 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index e140380..5d07b10 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3959,6 +3959,44 @@ dependencies = [ "libc", ] +[[package]] +name = "obce" +version = "0.1.0" +source = "git+https://github.com/AstarNetwork/obce?branch=polkadot-v0.9.30#ac3e2f5354418fc45f7bd26739fc9ee8c5d72d8a" +dependencies = [ + "frame-support", + "frame-system", + "obce-macro", + "pallet-contracts", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "obce-codegen" +version = "0.1.0" +source = "git+https://github.com/AstarNetwork/obce?branch=polkadot-v0.9.30#ac3e2f5354418fc45f7bd26739fc9ee8c5d72d8a" +dependencies = [ + "blake2", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "obce-macro" +version = "0.1.0" +source = "git+https://github.com/AstarNetwork/obce?branch=polkadot-v0.9.30#ac3e2f5354418fc45f7bd26739fc9ee8c5d72d8a" +dependencies = [ + "obce-codegen", + "proc-macro2", + "syn", + "synstructure", +] + [[package]] name = "object" version = "0.29.0" @@ -4024,6 +4062,17 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-assets-chain-extension" +version = "0.1.1" +source = "git+https://github.com/AstarNetwork/pallet-assets-chain-extension?branch=polkadot-v0.9.30#0d1d3adbf8806788f8d98e58c27fe91fe3998db1" +dependencies = [ + "obce", + "pallet-assets", + "parity-scale-codec", + "scale-info", +] + [[package]] name = "pallet-balances" version = "4.0.0-dev" @@ -4096,6 +4145,7 @@ dependencies = [ "pallet-contracts-proc-macro", "parity-scale-codec", "rand 0.8.5", + "rand_pcg 0.3.1", "scale-info", "serde", "smallvec", @@ -7715,6 +7765,7 @@ dependencies = [ "hex-literal", "log", "pallet-assets", + "pallet-assets-chain-extension", "pallet-balances", "pallet-chain-extension-dapps-staking", "pallet-chain-extension-rmrk", diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 0c53493..7e9aeaf 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -54,6 +54,8 @@ pallet-rmrk-equip = { git = "https://github.com/AstarNetwork/rmrk-substrate", br pallet-rmrk-market = { git = "https://github.com/AstarNetwork/rmrk-substrate", branch = "polkadot-v0.9.30", default-features = false } rmrk-traits = { git = "https://github.com/AstarNetwork/rmrk-substrate", branch = "polkadot-v0.9.30", default-features = false } +pallet-assets-chain-extension = { git = "https://github.com/AstarNetwork/pallet-assets-chain-extension", default-features = false, features = ["substrate"], branch = "polkadot-v0.9.30" } + # Used for the node template's RPCs frame-system-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } pallet-transaction-payment-rpc-runtime-api = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.30" } @@ -102,6 +104,7 @@ std = [ "sp-std/std", "sp-transaction-pool/std", "sp-version/std", + "pallet-assets-chain-extension/substrate-std", ] contracts-unstable-interface = [ "pallet-contracts/unstable-interface", @@ -116,6 +119,9 @@ runtime-benchmarks = [ "pallet-dapps-staking/runtime-benchmarks", "pallet-timestamp/runtime-benchmarks", "sp-runtime/runtime-benchmarks", + "pallet-contracts/runtime-benchmarks", + "pallet-assets/runtime-benchmarks", + "pallet-assets-chain-extension/runtime-benchmarks", ] try-runtime = [ "log", diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index faaf2da..8e26a61 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -314,7 +314,7 @@ impl pallet_contracts::Config for Runtime { type DepositPerByte = DepositPerByte; type WeightPrice = pallet_transaction_payment::Pallet; type WeightInfo = pallet_contracts::weights::SubstrateWeight; - type ChainExtension = (DappsStakingExtension, RmrkExtension); + type ChainExtension = (DappsStakingExtension, RmrkExtension, pallet_assets_chain_extension::substrate::AssetsExtension); type DeletionQueueDepth = ConstU32<128>; type DeletionWeightLimit = DeletionWeightLimit; type Schedule = Schedule; From 6f0642b9ff8fe777e0bd7621830011132f895c80 Mon Sep 17 00:00:00 2001 From: PierreOssun Date: Fri, 18 Nov 2022 14:43:21 +0100 Subject: [PATCH 2/2] cargo fmt --- runtime/Cargo.toml | 1 + runtime/src/lib.rs | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 7e9aeaf..b5eab9d 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -54,6 +54,7 @@ pallet-rmrk-equip = { git = "https://github.com/AstarNetwork/rmrk-substrate", br pallet-rmrk-market = { git = "https://github.com/AstarNetwork/rmrk-substrate", branch = "polkadot-v0.9.30", default-features = false } rmrk-traits = { git = "https://github.com/AstarNetwork/rmrk-substrate", branch = "polkadot-v0.9.30", default-features = false } +# pallet-asset chain-extension pallet-assets-chain-extension = { git = "https://github.com/AstarNetwork/pallet-assets-chain-extension", default-features = false, features = ["substrate"], branch = "polkadot-v0.9.30" } # Used for the node template's RPCs diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 8e26a61..3109395 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -314,7 +314,11 @@ impl pallet_contracts::Config for Runtime { type DepositPerByte = DepositPerByte; type WeightPrice = pallet_transaction_payment::Pallet; type WeightInfo = pallet_contracts::weights::SubstrateWeight; - type ChainExtension = (DappsStakingExtension, RmrkExtension, pallet_assets_chain_extension::substrate::AssetsExtension); + type ChainExtension = ( + DappsStakingExtension, + RmrkExtension, + pallet_assets_chain_extension::substrate::AssetsExtension, + ); type DeletionQueueDepth = ConstU32<128>; type DeletionWeightLimit = DeletionWeightLimit; type Schedule = Schedule;