Skip to content

Commit

Permalink
Merge pull request #9 from Polimec/leonardo/mint-and-distribute-contr…
Browse files Browse the repository at this point in the history
…ibution-token

Mint and distribute Contribution Token via `pallet_asset`
  • Loading branch information
lrazovic committed Jan 16, 2023
2 parents df70523 + fc6b0eb commit 2d56a10
Show file tree
Hide file tree
Showing 10 changed files with 267 additions and 80 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions nodes/standalone/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,5 +180,6 @@ fn testnet_genesis(
})
.collect::<Vec<_>>(),
},
..Default::default()
}
}
1 change: 1 addition & 0 deletions pallets/funding/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ sp-core = { default-features = false, git = "https://github.com/paritytech/subst
sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }
pallet-balances = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }
pallet-randomness-collective-flip = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }
pallet-assets = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.32" }
pallet-credentials = { path = "../credentials", default-features = false }

[features]
Expand Down
8 changes: 4 additions & 4 deletions pallets/funding/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fn get_events<T: Config>() -> frame_benchmarking::Vec<<T as frame_system::Config

fn create_default_project<T: Config>(
id: Option<u32>,
) -> (T::ProjectIdentifier, T::AccountId, ProjectOf<T>) {
) -> (T::ProjectIdParameter, T::AccountId, ProjectOf<T>) {
let issuer: T::AccountId = account::<T::AccountId>("Alice", 1, 1);
let project_id_parameter = id.unwrap_or(0);
let project_id = T::BenchmarkHelper::create_project_id_parameter(project_id_parameter);
Expand All @@ -44,7 +44,7 @@ fn create_default_project<T: Config>(

fn create_default_minted_project<T: Config>(
id: Option<u32>,
) -> (T::ProjectIdentifier, T::AccountId) {
) -> (T::ProjectIdParameter, T::AccountId) {
let (project_id, issuer, project) = create_default_project::<T>(id);
assert!(
PolimecFunding::<T>::create(SystemOrigin::Signed(issuer.clone()).into(), project,).is_ok()
Expand Down Expand Up @@ -76,7 +76,7 @@ benchmarks! {
verify {
// assert_last_event::<T>(Event::ProjectCreated(0).into());
let project_id = T::BenchmarkHelper::create_project_id_parameter(1);
let project_info = PolimecFunding::<T>::project_info(project_id);
let project_info = PolimecFunding::<T>::project_info(project_id.into());
assert_eq!(project_info.project_status, ProjectStatus::Application);
}

Expand Down Expand Up @@ -108,7 +108,7 @@ benchmarks! {
let p = T::ActiveProjectsLimit::get();
for i in 0 .. p {
let project_id = T::BenchmarkHelper::create_project_id_parameter(i);
let project_info = PolimecFunding::<T>::project_info(project_id);
let project_info = PolimecFunding::<T>::project_info(project_id.into());
assert_eq!(project_info.project_status, ProjectStatus::EvaluationEnded);
}

Expand Down
Loading

0 comments on commit 2d56a10

Please sign in to comment.