From 7978844d74fe0a8f2268c64403e650a27b8e9563 Mon Sep 17 00:00:00 2001 From: Trubnikov Sergey Date: Wed, 19 Apr 2023 06:12:33 +0000 Subject: [PATCH] feat: add pallet-balances-adapter --- --- a/Cargo.lock +++ b/Cargo.lock @@ -6252,6 +6252,10 @@ ] [[package]] +name = "pallet-balances-adapter" +version = "0.1.0" + +[[package]] name = "pallet-base-fee" version = "1.0.0" source = "git+https://github.com/uniquenetwork/unique-frontier?branch=unique-polkadot-v0.9.42#75ad5b9a49e1942553c4068228f1546ffb1f7246" @@ -7411,6 +7415,7 @@ "frame-benchmarking", "frame-support", "frame-system", + "pallet-balances-adapter", "pallet-common", "pallet-evm", "pallet-evm-coder-substrate", --- a/Cargo.toml +++ b/Cargo.toml @@ -19,9 +19,9 @@ panic = "unwind" [profile.production] +codegen-units = 1 inherits = "release" lto = true -codegen-units = 1 opt-level = 3 [workspace.dependencies] @@ -29,6 +29,7 @@ app-promotion-rpc = { path = "primitives/app_promotion_rpc", default-features = false } evm-coder = { git = "https://github.com/uniquenetwork/evm-coder", tag = "v0.3.1", default-features = false } pallet-app-promotion = { path = "pallets/app-promotion", default-features = false } +pallet-balances-adapter = { default-features = false, path = "pallets/balances-adapter" } pallet-charge-transaction = { package = "pallet-template-transaction-payment", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.42" } pallet-collator-selection = { default-features = false, path = "pallets/collator-selection" } pallet-common = { default-features = false, path = "pallets/common" } @@ -85,15 +86,15 @@ cumulus-client-consensus-common = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } cumulus-client-network = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } cumulus-client-service = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -cumulus-pallet-aura-ext = { default-features = false , git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -cumulus-pallet-dmp-queue = { default-features = false , git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -cumulus-pallet-parachain-system = { default-features = false , git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -cumulus-pallet-xcm = { default-features = false , git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -cumulus-pallet-xcmp-queue = { default-features = false , git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -cumulus-primitives-core = { default-features = false , git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } +cumulus-pallet-aura-ext = { default-features = false, git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } +cumulus-pallet-dmp-queue = { default-features = false, git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } +cumulus-pallet-parachain-system = { default-features = false, git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } +cumulus-pallet-xcm = { default-features = false, git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } +cumulus-pallet-xcmp-queue = { default-features = false, git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } +cumulus-primitives-core = { default-features = false, git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -cumulus-primitives-timestamp = { default-features = false , git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } -cumulus-primitives-utility = { default-features = false , git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } +cumulus-primitives-timestamp = { default-features = false, git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } +cumulus-primitives-utility = { default-features = false, git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } cumulus-relay-chain-inprocess-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } cumulus-relay-chain-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } cumulus-relay-chain-minimal-node = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.42" } @@ -123,9 +124,9 @@ sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } +sc-consensus-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } sc-consensus-manual-seal = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } -sc-consensus-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } sc-network-sync = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } @@ -177,11 +178,11 @@ try-runtime-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.42" } # ORML -orml-tokens = { default-features = false , git = "https://github.com/uniquenetwork/open-runtime-module-library", branch = "polkadot-v0.9.42" } -orml-traits = { default-features = false , git = "https://github.com/uniquenetwork/open-runtime-module-library", branch = "polkadot-v0.9.42" } -orml-vesting = { default-features = false , git = "https://github.com/uniquenetwork/open-runtime-module-library", branch = "polkadot-v0.9.42" } -orml-xtokens = { default-features = false , git = "https://github.com/uniquenetwork/open-runtime-module-library", branch = "polkadot-v0.9.42" } -orml-xcm-support = { default-features = false , git = "https://github.com/uniquenetwork/open-runtime-module-library", branch = "polkadot-v0.9.42" } +orml-tokens = { default-features = false, git = "https://github.com/uniquenetwork/open-runtime-module-library", branch = "polkadot-v0.9.42" } +orml-traits = { default-features = false, git = "https://github.com/uniquenetwork/open-runtime-module-library", branch = "polkadot-v0.9.42" } +orml-vesting = { default-features = false, git = "https://github.com/uniquenetwork/open-runtime-module-library", branch = "polkadot-v0.9.42" } +orml-xcm-support = { default-features = false, git = "https://github.com/uniquenetwork/open-runtime-module-library", branch = "polkadot-v0.9.42" } +orml-xtokens = { default-features = false, git = "https://github.com/uniquenetwork/open-runtime-module-library", branch = "polkadot-v0.9.42" } # Other derivative = { version = "2.2.0", features = ["use_core"] } @@ -194,4 +195,3 @@ num_enum = { version = "0.5.3", default-features = false } serde = { default-features = false, features = ['derive'], version = "1.0.136" } smallvec = "1.6.1" - --- /dev/null +++ b/pallets/balances-adapter/Cargo.toml @@ -0,0 +1,13 @@ +[package] +edition = "2021" +license = "GPLv3" +name = "pallet-balances-adapter" +version = "0.1.0" + +[dependencies] + +[features] +default = ["std"] +std = [] +# stubgen = ["evm-coder/stubgen", "pallet-common/stubgen"] +# try-runtime = ["frame-support/try-runtime"] --- /dev/null +++ b/pallets/balances-adapter/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} --- a/pallets/unique/Cargo.toml +++ b/pallets/unique/Cargo.toml @@ -24,6 +24,7 @@ 'frame-benchmarking/std', 'frame-support/std', 'frame-system/std', + 'pallet-balances-adapter/std', 'pallet-common/std', 'pallet-evm-coder-substrate/std', 'pallet-evm/std', @@ -46,6 +47,7 @@ frame-benchmarking = { workspace = true, optional = true } frame-support = { workspace = true } frame-system = { workspace = true } +pallet-balances-adapter = { workspace = true } pallet-common = { workspace = true } pallet-evm = { workspace = true } pallet-evm-coder-substrate = { workspace = true } -- gitstuff