Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Prev Previous commit
Next Next commit
switch crowdfund to configurable moduleid
  • Loading branch information
emostov committed Apr 20, 2020
commit 35b9d014a8321fc01adede7ca177b506488b8fd7
7 changes: 4 additions & 3 deletions runtime/common/src/crowdfund.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ pub type NegativeImbalanceOf<T> =
pub trait Trait: slots::Trait {
type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;

// type ModuleId: Get<ModuleId>;
type ModuleId: Get<ModuleId>;

/// The amount to be held on deposit by the owner of a crowdfund.
type SubmissionDeposit: Get<BalanceOf<Self>>;
Expand Down Expand Up @@ -252,6 +252,7 @@ decl_module! {
type Error = Error<T>;

// type ModuleId: Get<ModuleId>;
const ModuleId: ModuleId = T::ModuleId::get();

fn deposit_event() = default;

Expand Down Expand Up @@ -531,8 +532,8 @@ impl<T: Trait> Module<T> {
/// This actually does computation. If you need to keep using it, then make sure you cache the
/// value and only call this once.
pub fn fund_account_id(index: FundIndex) -> T::AccountId {
MODULE_ID.into_sub_account(index)
// T::ModuleId::get().into_sub_account(index)
// MODULE_ID.into_sub_account(index)
T::ModuleId::get().into_sub_account(index)
}

pub fn id_from_index(index: FundIndex) -> Vec<u8> {
Expand Down