diff --git a/Cargo.lock b/Cargo.lock index 6ff523fe..0bf5d063 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -181,7 +181,6 @@ dependencies = [ "beefy-primitives", "borsh", "deip-asset-system", - "deip-assets-error", "deip-projects-info", "frame-benchmarking", "frame-executive", @@ -201,9 +200,9 @@ dependencies = [ "pallet-deip", "pallet-deip-assets", "pallet-deip-balances", + "pallet-deip-crowdfunding", "pallet-deip-dao", "pallet-deip-ecosystem-fund", - "pallet-deip-investment-opportunity", "pallet-deip-nft", "pallet-deip-portal", "pallet-deip-proposal", @@ -1035,8 +1034,8 @@ dependencies = [ "frame-support", "pallet-deip", "pallet-deip-assets", + "pallet-deip-crowdfunding", "pallet-deip-dao", - "pallet-deip-investment-opportunity", "pallet-deip-proposal", "parity-scale-codec", "scale-info", @@ -1406,7 +1405,6 @@ dependencies = [ name = "deip-asset-system" version = "0.1.0" dependencies = [ - "deip-assets-error", "deip_serializable_u128", "frame-support", "frame-system", @@ -1419,10 +1417,6 @@ dependencies = [ "sp-std", ] -[[package]] -name = "deip-assets-error" -version = "0.1.0" - [[package]] name = "deip-assets-rpc" version = "3.0.0" @@ -1642,6 +1636,16 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" +[[package]] +name = "draft" +version = "0.1.0" +dependencies = [ + "frame-support", + "pallet-timestamp", + "parity-scale-codec", + "rustc-hex", +] + [[package]] name = "dtoa" version = "0.4.8" @@ -4296,7 +4300,6 @@ name = "pallet-deip" version = "3.0.0" dependencies = [ "deip-asset-system", - "deip-assets-error", "deip-projects-info", "deip-transaction-ctx", "deip_serializable_u128", @@ -4323,7 +4326,6 @@ name = "pallet-deip-assets" version = "3.0.0" dependencies = [ "deip-asset-system", - "deip-assets-error", "deip-projects-info", "deip_serializable_u128", "frame-support", @@ -4355,21 +4357,24 @@ dependencies = [ ] [[package]] -name = "pallet-deip-dao" +name = "pallet-deip-crowdfunding" version = "3.0.0" dependencies = [ - "deip-storage-ops", + "deip-asset-system", + "deip-projects-info", + "deip-transaction-ctx", + "deip_serializable_u128", "frame-benchmarking", "frame-support", "frame-system", "pallet-assets", "pallet-balances", - "pallet-sudo", + "pallet-deip-assets", + "pallet-timestamp", "pallet-transaction-payment", "parity-scale-codec", "scale-info", "serde", - "sp-api", "sp-core", "sp-io", "sp-runtime", @@ -4377,43 +4382,40 @@ dependencies = [ ] [[package]] -name = "pallet-deip-ecosystem-fund" +name = "pallet-deip-dao" version = "3.0.0" dependencies = [ + "deip-storage-ops", "frame-benchmarking", "frame-support", "frame-system", + "pallet-assets", "pallet-balances", + "pallet-sudo", "pallet-transaction-payment", "parity-scale-codec", "scale-info", "serde", + "sp-api", "sp-core", + "sp-io", "sp-runtime", "sp-std", ] [[package]] -name = "pallet-deip-investment-opportunity" +name = "pallet-deip-ecosystem-fund" version = "3.0.0" dependencies = [ - "deip-asset-system", - "deip-projects-info", - "deip-transaction-ctx", - "deip_serializable_u128", "frame-benchmarking", "frame-support", "frame-system", - "pallet-assets", "pallet-balances", - "pallet-deip-assets", - "pallet-timestamp", "pallet-transaction-payment", "parity-scale-codec", "scale-info", "serde", "sp-core", - "sp-io", "sp-runtime", "sp-std", ] diff --git a/ci/deploy.sh b/ci/deploy.sh index 8ce7569f..e5e35d1a 100755 --- a/ci/deploy.sh +++ b/ci/deploy.sh @@ -12,13 +12,13 @@ cat /dev/null > .env LOCAL_REPO="localhost" echo "LOCAL_REPO=$LOCAL_REPO" >> .env -export BUILD_SCRIPT="event-proxy/build.sh" -export BUILD_WORKDIR="event-proxy" -export BINARY_NAME="event-proxy" -export APP_IMAGE="$BINARY_NAME:$REVISION" -./build_img.sh && docker tag $APP_IMAGE "$LOCAL_REPO/$APP_IMAGE" -echo "EVENT_PROXY_IMG=$APP_IMAGE" >> .env -echo "EVENT_PROXY_BIN=$BINARY_NAME" >> .env +#export BUILD_SCRIPT="event-proxy/build.sh" +#export BUILD_WORKDIR="event-proxy" +#export BINARY_NAME="event-proxy" +#export APP_IMAGE="$BINARY_NAME:$REVISION" +#./build_img.sh && docker tag $APP_IMAGE "$LOCAL_REPO/$APP_IMAGE" +#echo "EVENT_PROXY_IMG=$APP_IMAGE" >> .env +#echo "EVENT_PROXY_BIN=$BINARY_NAME" >> .env export BUILD_SCRIPT="node/build.sh" export BUILD_WORKDIR="." @@ -27,13 +27,13 @@ export APP_IMAGE="$BINARY_NAME:$REVISION" ./build_img.sh && docker tag $APP_IMAGE "$LOCAL_REPO/$APP_IMAGE" echo "BLOCKCHAIN_NODE_IMG=$APP_IMAGE" >> .env echo "BLOCKCHAIN_NODE_BIN=$BINARY_NAME" >> .env - -export BUILD_SCRIPT="event-proxy-client/build.sh" -export BUILD_WORKDIR="event-proxy-client" -export BINARY_NAME="event-proxy-client" -export APP_IMAGE="$BINARY_NAME:$REVISION" -./build_img.sh && docker tag $APP_IMAGE "$LOCAL_REPO/$APP_IMAGE" -echo "EVENT_PROXY_CLIENT_IMG=$APP_IMAGE" >> .env -echo "EVENT_PROXY_CLIENT_BIN=$BINARY_NAME" >> .env - +# +#export BUILD_SCRIPT="event-proxy-client/build.sh" +#export BUILD_WORKDIR="event-proxy-client" +#export BINARY_NAME="event-proxy-client" +#export APP_IMAGE="$BINARY_NAME:$REVISION" +#./build_img.sh && docker tag $APP_IMAGE "$LOCAL_REPO/$APP_IMAGE" +#echo "EVENT_PROXY_CLIENT_IMG=$APP_IMAGE" >> .env +#echo "EVENT_PROXY_CLIENT_BIN=$BINARY_NAME" >> .env +# docker-compose up -d --no-build diff --git a/ci/docker-compose.yml b/ci/docker-compose.yml index 35c6b2a0..d1933601 100644 --- a/ci/docker-compose.yml +++ b/ci/docker-compose.yml @@ -1,34 +1,34 @@ version: "3.3" services: - zookeeper: - image: bitnami/zookeeper:3.7 - ports: - - "2181:2181" - volumes: - - "zookeeper_data:/bitnami" - environment: - - ALLOW_ANONYMOUS_LOGIN=yes - kafka: - image: bitnami/kafka:2 - ports: - - "9092:9092" - volumes: - - "kafka_data:/bitnami" - environment: - - KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181 - - ALLOW_PLAINTEXT_LISTENER=yes - depends_on: - - zookeeper - deip-event-proxy: - image: "$LOCAL_REPO/$EVENT_PROXY_IMG" - command: $EVENT_PROXY_BIN --config=/event-proxy.toml - environment: - RUST_LOG: "error,librdkafka=error,rdkafka::client=error" - volumes: - - "./event-proxy.toml:/event-proxy.toml" - depends_on: - - kafka +# zookeeper: +# image: bitnami/zookeeper:3.7 +# ports: +# - "2181:2181" +# volumes: +# - "zookeeper_data:/bitnami" +# environment: +# - ALLOW_ANONYMOUS_LOGIN=yes +# kafka: +# image: bitnami/kafka:2 +# ports: +# - "9092:9092" +# volumes: +# - "kafka_data:/bitnami" +# environment: +# - KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181 +# - ALLOW_PLAINTEXT_LISTENER=yes +# depends_on: +# - zookeeper +# deip-event-proxy: +# image: "$LOCAL_REPO/$EVENT_PROXY_IMG" +# command: $EVENT_PROXY_BIN --config=/event-proxy.toml +# environment: +# RUST_LOG: "error,librdkafka=error,rdkafka::client=error" +# volumes: +# - "./event-proxy.toml:/event-proxy.toml" +# depends_on: +# - kafka deip-blockchain-node: image: "$LOCAL_REPO/$BLOCKCHAIN_NODE_IMG" command: | @@ -41,13 +41,13 @@ services: ports: - "9944:9944" - "9933:9933" - deip-event-proxy-client: - image: "$LOCAL_REPO/$EVENT_PROXY_CLIENT_IMG" - command: $EVENT_PROXY_CLIENT_BIN - environment: - KAFKA_BOOTSTRAP_SERVERS: "kafka:9092" - depends_on: - - kafka +# deip-event-proxy-client: +# image: "$LOCAL_REPO/$EVENT_PROXY_CLIENT_IMG" +# command: $EVENT_PROXY_CLIENT_BIN +# environment: +# KAFKA_BOOTSTRAP_SERVERS: "kafka:9092" +# depends_on: +# - kafka volumes: zookeeper_data: diff --git a/deip_common/deip_asset_system/Cargo.toml b/deip_common/deip_asset_system/Cargo.toml index a01ea7a9..12eb18bb 100644 --- a/deip_common/deip_asset_system/Cargo.toml +++ b/deip_common/deip_asset_system/Cargo.toml @@ -13,7 +13,6 @@ sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "po sp-std = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13", default-features = false } sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13", default-features = false } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html -deip-assets-error = { path = "../deip_assets_error", default-features = false } deip_serializable_u128 = { path = "../../deip_common/deip_serializable_u128", default-features = false } # alias "parity-scale-code" to "codec" @@ -35,6 +34,5 @@ std = [ "sp-core/std", "frame-system/std", "frame-support/std", - "deip-assets-error/std", "deip_serializable_u128/std", ] diff --git a/deip_common/deip_asset_system/src/lib.rs b/deip_common/deip_asset_system/src/lib.rs index 7da47777..d62266e2 100644 --- a/deip_common/deip_asset_system/src/lib.rs +++ b/deip_common/deip_asset_system/src/lib.rs @@ -1,7 +1,5 @@ #![cfg_attr(not(feature = "std"), no_std)] -extern crate core; - pub mod asset; pub mod nft_impl; pub mod fnft; @@ -13,7 +11,6 @@ pub use nft_impl::*; pub use fnft::*; pub use ft_impl::*; -pub use deip_assets_error::{ReserveError, UnreserveError}; use sp_std::prelude::*; #[derive(Debug, Clone, Copy)] diff --git a/deip_common/deip_assets_error/Cargo.toml b/deip_common/deip_assets_error/Cargo.toml deleted file mode 100644 index 9c4d2a63..00000000 --- a/deip_common/deip_assets_error/Cargo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "deip-assets-error" -version = "0.1.0" -edition = "2018" - -[dependencies] - -[features] -default = ["std"] -std = [] diff --git a/deip_common/deip_assets_error/src/lib.rs b/deip_common/deip_assets_error/src/lib.rs deleted file mode 100644 index 511a5843..00000000 --- a/deip_common/deip_assets_error/src/lib.rs +++ /dev/null @@ -1,12 +0,0 @@ -#![cfg_attr(not(feature = "std"), no_std)] - -pub enum ReserveError { - NotEnoughBalance, - AlreadyReserved, - AssetTransferFailed(AssetId), -} - -pub enum UnreserveError { - NoSuchInvestment, - AssetTransferFailed(AssetId), -} diff --git a/deip_common/deip_call/Cargo.toml b/deip_common/deip_call/Cargo.toml index 00596021..b8444db2 100644 --- a/deip_common/deip_call/Cargo.toml +++ b/deip_common/deip_call/Cargo.toml @@ -16,7 +16,7 @@ pallet-deip = { path = "../../pallets/deip", default-features = false } pallet-deip-assets = { path = "../../pallets/deip_assets", default-features = false } pallet-deip-dao = { path = "../../pallets/deip_dao", default-features = false } pallet-deip-proposal = { path = "../../pallets/deip_proposal", default-features = false } -pallet-deip-investment-opportunity = { path = "../../pallets/deip_investment_opportunity", default-features = false } +pallet-deip-crowdfunding = { path = "../../pallets/deip_crowdfunding", default-features = false } serde = { version = "1.0.130", features = ["derive"], optional = true } sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13", default-features = false } sp-std = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13", default-features = false } @@ -36,5 +36,5 @@ std = [ "pallet-deip-dao/std", "pallet-deip/std", "pallet-deip-assets/std", - "pallet-deip-investment-opportunity/std", + "pallet-deip-crowdfunding/std", ] diff --git a/event-proxy/Cargo.toml b/event-proxy/Cargo.toml index 41e6dff5..73e5338e 100644 --- a/event-proxy/Cargo.toml +++ b/event-proxy/Cargo.toml @@ -34,7 +34,7 @@ pallet-deip-portal = { path = "../pallets/deip_portal" } pallet-deip = { path = "../pallets/deip"} pallet-deip-assets = { path = "../pallets/deip_assets"} pallet-deip-vesting = { path = "../pallets/deip_vesting"} -pallet-deip-investment-opportunity = { path = "../pallets/deip_investment_opportunity"} +pallet-deip-crowdfunding = { path = "../pallets/deip_crowdfunding" } node-template-runtime = { package = "appchain-deip-runtime", path = "../runtime"} deip-call = { package = "common-deip-call", path = "../deip_common/deip_call" } diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index 02d702cd..28e4d09d 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -4,7 +4,7 @@ use appchain_deip_runtime::{ AccountId, DeipAssetsConfig, BabeConfig, DeipConfig, DeipDaoConfig, DeipPortalConfig, DeipProposalConfig, DeipVestingConfig, GenesisConfig, GrandpaConfig, BalancesConfig, Signature, SudoConfig, SystemConfig, DeipUniquesConfig, SessionConfig, - OctopusLposConfig, WASM_BINARY, DeipEcosystemFundConfig, DeipInvestmentOpportunityConfig, + OctopusLposConfig, WASM_BINARY, DeipEcosystemFundConfig, DeipCrowdfundingConfig, }; use sc_chain_spec::ChainSpecExtension; @@ -316,6 +316,6 @@ fn genesis( deip_ecosystem_fund: DeipEcosystemFundConfig { fee_recipient: ecosystem_fund_key.clone() }, - deip_investment_opportunity: DeipInvestmentOpportunityConfig {}, + deip_crowdfunding: DeipCrowdfundingConfig {}, } } diff --git a/pallets/deip/Cargo.toml b/pallets/deip/Cargo.toml index 9f472c42..9cec172f 100644 --- a/pallets/deip/Cargo.toml +++ b/pallets/deip/Cargo.toml @@ -15,7 +15,6 @@ targets = ["x86_64-unknown-linux-gnu"] frame-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13", default-features = false, optional = true } -deip-assets-error = { path = "../../deip_common/deip_assets_error", default-features = false } deip-transaction-ctx = { path = "../../deip_common/deip_transaction_ctx", default-features = false } deip_serializable_u128 = { path = "../../deip_common/deip_serializable_u128", default-features = false } deip-asset-system = { path = "../../deip_common/deip_asset_system", default-features = false } @@ -73,7 +72,6 @@ std = [ "sp-io/std", "sp-runtime/std", "sp-std/std", - "deip-assets-error/std", "deip_serializable_u128/std", "deip-transaction-ctx/std", "frame-benchmarking/std", diff --git a/pallets/deip/src/mock.rs b/pallets/deip/src/mock.rs index 1cbac64f..f0047629 100644 --- a/pallets/deip/src/mock.rs +++ b/pallets/deip/src/mock.rs @@ -10,8 +10,6 @@ use sp_runtime::{ use codec::{Decode, Encode}; use serde::{Deserialize, Serialize}; -use deip_assets_error::{ReserveError, UnreserveError}; - pub const DEFAULT_ACCOUNT_ID: ::AccountId = 123; pub const ALICE_ACCOUNT_ID: ::AccountId = 124; pub const BOB_ACCOUNT_ID: ::AccountId = 125; diff --git a/pallets/deip_assets/Cargo.toml b/pallets/deip_assets/Cargo.toml index 61e0ff36..b191c23c 100644 --- a/pallets/deip_assets/Cargo.toml +++ b/pallets/deip_assets/Cargo.toml @@ -27,7 +27,6 @@ sp-io = { git = "https://github.com/paritytech/substrate.git", branch = "polkado sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13", default-features = false } sp-std = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13", default-features = false } -deip-assets-error = { path = "../../deip_common/deip_assets_error", default-features = false } deip-projects-info = {path = "../../deip_common/deip_projects_info", default-features = false } deip_serializable_u128 = { path = "../../deip_common/deip_serializable_u128", default-features = false } deip-asset-system = { path = "../../deip_common/deip_asset_system", default-features = false } @@ -48,7 +47,6 @@ std = [ "sp-io/std", "sp-runtime/std", "sp-std/std", - "deip-assets-error/std", "deip-projects-info/std", "deip_serializable_u128/std", "deip-asset-system/std", diff --git a/pallets/deip_investment_opportunity/Cargo.toml b/pallets/deip_crowdfunding/Cargo.toml similarity index 97% rename from pallets/deip_investment_opportunity/Cargo.toml rename to pallets/deip_crowdfunding/Cargo.toml index ad19d7ef..a5b73f14 100644 --- a/pallets/deip_investment_opportunity/Cargo.toml +++ b/pallets/deip_crowdfunding/Cargo.toml @@ -1,10 +1,10 @@ [package] authors = ["DEIP world "] -description = "FRAME pallet for investment opportunities" +description = "FRAME pallet for crowdfunding" edition = "2018" homepage = "https://deip.world/" license = "Apache-2.0" -name = "pallet-deip-investment-opportunity" +name = "pallet-deip-crowdfunding" repository = "https://github.com/DEIPworld/deip-polkadot" version = "3.0.0" diff --git a/pallets/deip_investment_opportunity/src/benchmarking.rs b/pallets/deip_crowdfunding/src/benchmarking.rs similarity index 100% rename from pallets/deip_investment_opportunity/src/benchmarking.rs rename to pallets/deip_crowdfunding/src/benchmarking.rs diff --git a/pallets/deip_investment_opportunity/src/crowdfunding.rs b/pallets/deip_crowdfunding/src/crowdfunding.rs similarity index 97% rename from pallets/deip_investment_opportunity/src/crowdfunding.rs rename to pallets/deip_crowdfunding/src/crowdfunding.rs index 0a0da881..96dd793f 100644 --- a/pallets/deip_investment_opportunity/src/crowdfunding.rs +++ b/pallets/deip_crowdfunding/src/crowdfunding.rs @@ -14,6 +14,7 @@ use sp_std::collections::btree_map::BTreeMap; use sp_std::default::Default; use deip_serializable_u128::SerializableAtLeast32BitUnsigned; use deip_asset_system::asset::{Asset}; +use deip_asset_system::transfer_fraction; use deip_transaction_ctx::{TransactionCtxId, TransactionCtxT}; use crate::module::{*}; @@ -132,12 +133,10 @@ impl CrowdfundingT for SimpleCrowdfundingV2 { ensure!(self.shares < T::MaxShares::get(), crate::Error::TooMuchShares); self.shares.saturating_inc(); - let (id, amount) = shares; Ok(SharesTransfer::::new( - T::Asset::pick_fraction(id, self.creator()) - .ok_or_else(|| crate::Error::BalanceIsNotEnough)?, + shares, + self.creator(), self.account(), - amount )) } @@ -148,12 +147,10 @@ impl CrowdfundingT for SimpleCrowdfundingV2 { ensure!(self.shares > 0, crate::Error::NoShares); self.shares.saturating_dec(); - let (id, amount) = shares; Ok(SharesTransfer::::new( - T::Asset::pick_fraction(id, self.account()) - .ok_or_else(|| crate::Error::ImpossibleSituation)?, + shares, + self.account(), self.creator(), - amount )) } @@ -250,17 +247,23 @@ impl CrowdfundingT for SimpleCrowdfundingV2 } pub struct SharesTransfer<'a, T: Config> { - asset: T::Asset, + shares: (T::AssetId, T::AssetAmount), + from: &'a T::AccountId, to: &'a T::AccountId, - amount: T::AssetAmount } impl<'a, T: Config> SharesTransfer<'a, T> { - fn new(asset: T::Asset, to: &'a T::AccountId, amount: T::AssetAmount) -> Self { - Self { asset, to, amount } + fn new( + shares: (T::AssetId, T::AssetAmount), + from: &'a T::AccountId, + to: &'a T::AccountId + ) -> Self + { + Self { shares, from, to } } pub fn transfer(self) { - self.asset.transfer_amount(self.to, self.amount); + let Self { shares: (asset_id, amount), from, to } = self; + transfer_fraction::(asset_id, from, to, amount); } } diff --git a/pallets/deip_investment_opportunity/src/lib.rs b/pallets/deip_crowdfunding/src/lib.rs similarity index 100% rename from pallets/deip_investment_opportunity/src/lib.rs rename to pallets/deip_crowdfunding/src/lib.rs diff --git a/pallets/deip_investment_opportunity/src/module.rs b/pallets/deip_crowdfunding/src/module.rs similarity index 99% rename from pallets/deip_investment_opportunity/src/module.rs rename to pallets/deip_crowdfunding/src/module.rs index f61f7008..0e47c512 100644 --- a/pallets/deip_investment_opportunity/src/module.rs +++ b/pallets/deip_crowdfunding/src/module.rs @@ -23,7 +23,7 @@ use scale_info::TypeInfo; use sp_core::H160; use sp_std::prelude::*; use crate::{Config, Error, Event, Call, Pallet}; -use deip_asset_system::{NFTokenFractionT, ReserveError, UnreserveError}; +use deip_asset_system::{NFTokenFractionT}; pub use crate::crowdfunding::*; pub use deip_asset_system::asset::*; use crate::{ diff --git a/pallets/deip_investment_opportunity/src/tests.rs b/pallets/deip_crowdfunding/src/tests.rs similarity index 100% rename from pallets/deip_investment_opportunity/src/tests.rs rename to pallets/deip_crowdfunding/src/tests.rs diff --git a/pallets/deip_investment_opportunity/src/weights.rs b/pallets/deip_crowdfunding/src/weights.rs similarity index 100% rename from pallets/deip_investment_opportunity/src/weights.rs rename to pallets/deip_crowdfunding/src/weights.rs diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index d51d7e9b..e18c617f 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -20,7 +20,6 @@ beefy-primitives = { git = "https://github.com/paritytech/substrate.git", branch borsh = { version = "=0.9.1", default-features = false } codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } -deip-assets-error = { path = "../deip_common/deip_assets_error", default-features = false } deip-projects-info = { path = "../deip_common/deip_projects_info", default-features = false } deip-asset-system = { path = "../deip_common/deip_asset_system", default-features = false } @@ -44,7 +43,7 @@ pallet-deip-assets = { path = "../pallets/deip_assets", default-features = false pallet-deip-balances = { path = "../pallets/deip_balances", default-features = false } pallet-deip-dao = { path = "../pallets/deip_dao", default-features = false } pallet-deip-ecosystem-fund = { path = "../pallets/deip_ecosystem_fund", default-features = false } -pallet-deip-investment-opportunity = { path = "../pallets/deip_investment_opportunity", default-features = false } +pallet-deip-crowdfunding = { path = "../pallets/deip_crowdfunding", default-features = false } pallet-deip-nft = { path = "../pallets/deip_nft", default-features = false } pallet-deip-portal = { path = "../pallets/deip_portal", default-features = false } pallet-deip-proposal = { path = "../pallets/deip_proposal", default-features = false } @@ -99,7 +98,7 @@ runtime-benchmarks = [ "pallet-deip-portal/runtime-benchmarks", "pallet-deip/runtime-benchmarks", "pallet-deip-ecosystem-fund/runtime-benchmarks", - "pallet-deip-investment-opportunity/runtime-benchmarks", + "pallet-deip-crowdfunding/runtime-benchmarks", ] std = [ "serde", @@ -145,13 +144,12 @@ std = [ "borsh/std", "pallet-octopus-lpos/std", "pallet-octopus-upward-messages/std", - "deip-assets-error/std", "pallet-deip/std", "pallet-deip-assets/std", "pallet-deip-balances/std", "pallet-deip-dao/std", "pallet-deip-ecosystem-fund/std", - "pallet-deip-investment-opportunity/std", + "pallet-deip-crowdfunding/std", "pallet-deip-nft/std", "pallet-deip-portal/std", "pallet-deip-proposal/std", diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index cd6536ba..977f78f7 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -572,7 +572,7 @@ impl pallet_assets::Config for Runtime { impl deip_projects_info::DeipProjectsInfo for Runtime { type ProjectId = pallet_deip::ProjectId; - type InvestmentId = pallet_deip_investment_opportunity::crowdfunding::CrowdfundingId; + type InvestmentId = pallet_deip_crowdfunding::crowdfunding::CrowdfundingId; fn try_get_project_team(id: &Self::ProjectId) -> Option { Deip::try_get_project_team(id) @@ -759,16 +759,15 @@ impl pallet_deip::Config for Runtime { use deip_asset_system::{NFTokenFraction}; -impl pallet_deip_investment_opportunity::Config for Runtime { - type DeipInvestmentWeightInfo = pallet_deip_investment_opportunity::weights::Weights; +impl pallet_deip_crowdfunding::Config for Runtime { + type DeipInvestmentWeightInfo = pallet_deip_crowdfunding::weights::Weights; type Event = Event; type TransactionCtx = TransactionCtx; type DeipAccountId = deip_account::DeipAccountId; type MaxShares = MaxCrowdfundingShares; type Currency = Balances; - type Crowdfunding = - pallet_deip_investment_opportunity::crowdfunding::SimpleCrowdfundingV2; + type Crowdfunding = pallet_deip_crowdfunding::crowdfunding::SimpleCrowdfundingV2; type AssetAmount = ::Balance; @@ -916,8 +915,7 @@ construct_runtime!( DeipPortal: pallet_deip_portal::{Pallet, Call, Storage, Config, ValidateUnsigned}, DeipVesting: pallet_deip_vesting::{Pallet, Call, Storage, Event, Config}, DeipEcosystemFund: pallet_deip_ecosystem_fund::{Pallet, Config, Storage}, - DeipInvestmentOpportunity: pallet_deip_investment_opportunity, - + DeipCrowdfunding: pallet_deip_crowdfunding, DeipNft: pallet_deip_nft, } ); @@ -1199,7 +1197,7 @@ impl_runtime_apis! { list_benchmark!(list, extra, pallet_deip_dao, DeipDao); list_benchmark!(list, extra, pallet_deip_portal, DeipPortal); // list_benchmark!(list, extra, pallet_deip, Deip); - list_benchmark!(list, extra, pallet_deip_investment_opportunity, DeipInvestmentOpportunity); + list_benchmark!(list, extra, pallet_deip_crowdfunding, DeipCrowdfunding); let storage_info = AllPalletsWithSystem::storage_info(); @@ -1240,7 +1238,7 @@ impl_runtime_apis! { add_benchmark!(params, batches, pallet_deip_dao, DeipDao); add_benchmark!(params, batches, pallet_deip_portal, DeipPortal); // add_benchmark!(params, batches, pallet_deip, Deip); - add_benchmark!(params, batches, pallet_deip_investment_opportunity, DeipInvestmentOpportunity); + add_benchmark!(params, batches, pallet_deip_crowdfunding, DeipCrowdfunding); Ok(batches) }