Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assets CE from astar-frame #55

Merged
merged 3 commits into from
Mar 20, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
111 changes: 35 additions & 76 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion node/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "swanky-node"
version = "1.2.0"
version = "1.2.1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be 1.3

description = "Local Substrate node for wasm contract development & testing"
authors = ["Astar Network"]
homepage = "https://astar.network"
Expand Down
7 changes: 3 additions & 4 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "swanky-runtime"
version = "1.2.0"
version = "1.2.1"
description = "A fresh FRAME-based Substrate runtime, ready for hacking."
authors = ["Astar Network"]
homepage = "https://astar.network"
Expand Down Expand Up @@ -48,7 +48,7 @@ pallet-chain-extension-dapps-staking = { git = "https://github.com/AstarNetwork/
pallet-dapps-staking = { git = "https://github.com/AstarNetwork/astar-frame", branch = "polkadot-v0.9.37", 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.37" }
pallet-chain-extension-assets = { git = "https://github.com/AstarNetwork/astar-frame", branch = "polkadot-v0.9.37", default-features = false }

# 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.37" }
Expand Down Expand Up @@ -95,7 +95,7 @@ std = [
"sp-std/std",
"sp-transaction-pool/std",
"sp-version/std",
"pallet-assets-chain-extension/substrate-std",
"pallet-chain-extension-assets/std",
]
runtime-benchmarks = [
"frame-benchmarking/runtime-benchmarks",
Expand All @@ -109,7 +109,6 @@ runtime-benchmarks = [
"sp-runtime/runtime-benchmarks",
"pallet-contracts/runtime-benchmarks",
"pallet-assets/runtime-benchmarks",
"pallet-assets-chain-extension/runtime-benchmarks",
]
try-runtime = [
"log",
Expand Down
9 changes: 7 additions & 2 deletions runtime/src/chain_extensions.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
//!
use super::Runtime;
pub use pallet_chain_extension_assets::{weights::WeightInfo, AssetsExtension};
pub use pallet_chain_extension_dapps_staking::DappsStakingExtension;
/// Registered WASM contracts chain extensions.
use pallet_contracts::chain_extension::RegisteredChainExtension;

pub use pallet_chain_extension_dapps_staking::DappsStakingExtension;

// Following impls defines chain extension IDs.

impl RegisteredChainExtension<Runtime> for DappsStakingExtension<Runtime> {
const ID: u16 = 0x0000;
}

/// Based on chain-extension registry https://github.com/paritytech/chainextension-registry
impl<W: WeightInfo> RegisteredChainExtension<Runtime> for AssetsExtension<Runtime, W> {
const ID: u16 = 18678;
}
6 changes: 5 additions & 1 deletion runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,17 @@ use frame_system::{
EnsureSigned,
};
pub use pallet_balances::Call as BalancesCall;
use pallet_chain_extension_assets::weights::SubstrateWeight;
pub use pallet_chain_extension_assets::weights::WeightInfo as ChainExtensionWeightInfo;
pub use pallet_timestamp::Call as TimestampCall;
use pallet_transaction_payment::CurrencyAdapter;

#[cfg(any(feature = "std", test))]
pub use sp_runtime::BuildStorage;
pub use sp_runtime::{Perbill, Permill};

// Chain extensions
use pallet_chain_extension_assets::AssetsExtension;
use pallet_chain_extension_dapps_staking::DappsStakingExtension;

mod chain_extensions;
Expand Down Expand Up @@ -344,7 +348,7 @@ impl pallet_contracts::Config for Runtime {
type WeightPrice = pallet_transaction_payment::Pallet<Self>;
type WeightInfo = pallet_contracts::weights::SubstrateWeight<Self>;
type ChainExtension =
(DappsStakingExtension<Self>, pallet_assets_chain_extension::substrate::AssetsExtension);
(DappsStakingExtension<Self>, AssetsExtension<Self, SubstrateWeight<Self>>);
type DeletionQueueDepth = ConstU32<128>;
type DeletionWeightLimit = DeletionWeightLimit;
type Schedule = Schedule;
Expand Down