Skip to content

Commit

Permalink
Upgrade substrate to v0.9.25 (#52)
Browse files Browse the repository at this point in the history
* Update Sense pallet

* Draft update Flow, Control, Traits

* Updated Control pallet

* Updated Flow pallet

* Updated Signal pallet

* Updated tests and benchmarks for all GameDAO pallets

* Add missing types

* Change error for missing owner of the campaign

* Updated benchmarks

Co-authored-by: vasylenko-yevhen <[email protected]>
  • Loading branch information
vovacha and vayesy committed Jul 22, 2022
1 parent 55a0340 commit 100620d
Show file tree
Hide file tree
Showing 31 changed files with 858 additions and 594 deletions.
34 changes: 16 additions & 18 deletions control/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,35 @@ license = "GPL-3.0-or-later"
description = "DAO Factory"

[dependencies]
hex-literal = "0.3.1"
hex-literal = "0.3.4"
num_enum = { version = "0.5.1", default-features = false }

serde = { version = "1.0.124", optional = true }
codec = { package = "parity-scale-codec", version = "2.3.1", default-features = false }
scale-info = { version = "1.0", default-features = false, features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }

sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sp-storage = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
sp-storage = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }

frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13", default-features = false, optional = true }
frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25", default-features = false, optional = true }

pallet-assets = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }

orml-traits = { path = "../../orml/traits", default-features = false }
gamedao-traits = { package = "gamedao-traits", path = "../traits", default-features = false }

# tangram = { package = "module-tangram", path = "../../zero/tangram", default-features = false }

[dev-dependencies]
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sp-io = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
frame-support-test = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
sp-io = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.25" }
frame-support-test = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.25" }
pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
orml-tokens = { path = "../../orml/tokens", default-features = false }
orml-currencies = { path = "../../orml/currencies", default-features = false }

Expand All @@ -58,7 +57,6 @@ std = [
"scale-info/std",
"num_enum/std",

# "pallet-assets/std",
# "pallet-balances/std",
"frame-support/std",
"frame-system/std",
Expand Down
15 changes: 7 additions & 8 deletions control/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ benchmarks! {
}: _(
RawOrigin::Signed(caller.clone()),
caller.clone().into(),
(0..255).collect(),
(0..255).collect(),
BoundedVec::truncate_from((0..255).collect()),
BoundedVec::truncate_from((0..255).collect()),
OrgType::Individual,
AccessModel::Open,
FeeModel::NoFees,
Expand Down Expand Up @@ -77,7 +77,7 @@ benchmarks! {
}

add_member {
let r in 1 .. T::MaxMembersPerDAO::get()-1; // Limit members per org
let r in 1 .. T::MaxMembersPerOrg::get()-1; // Limit members per org

// Prepare org creator and members
let creator: T::AccountId = whitelisted_caller();
Expand All @@ -92,7 +92,7 @@ benchmarks! {

// Create org and fill with members
let org_id = <Pallet::<T> as ControlBenchmarkingTrait<T::AccountId, T::Hash>>::create_org(creator.clone()).unwrap();
Pallet::<T>::fill_org_with_members(&org_id, &accounts)?;
Pallet::<T>::fill_org_with_members(&org_id, accounts)?;
}: _(
RawOrigin::Signed(creator),
org_id,
Expand All @@ -103,7 +103,7 @@ benchmarks! {
}

remove_member {
let r in 1 .. T::MaxMembersPerDAO::get(); // Limit members per org
let r in 1 .. T::MaxMembersPerOrg::get(); // Limit members per org

// Prepare org creator and members
let creator: T::AccountId = whitelisted_caller();
Expand All @@ -117,7 +117,7 @@ benchmarks! {
fund_accounts::<T>(&accounts)?;

// Add members to org
Pallet::<T>::fill_org_with_members(&org_id, &accounts)?;
Pallet::<T>::fill_org_with_members(&org_id, accounts.clone())?;
}: _(
RawOrigin::Signed(creator),
org_id,
Expand All @@ -137,6 +137,5 @@ benchmarks! {
caller.clone()
)

impl_benchmark_test_suite!(Control, crate::mock::new_test_ext(), crate::mock::Test);
}

impl_benchmark_test_suite!(Control, crate::mock::new_test_ext(), crate::mock::Test);
Loading

0 comments on commit 100620d

Please sign in to comment.