|
17 | 17 |
|
18 | 18 | //! # Society Module
|
19 | 19 | //!
|
20 |
| -//! - [`society::Trait`](./trait.Trait.html) |
| 20 | +//! - [`society::Config`](./trait.Config.html) |
21 | 21 | //! - [`Call`](./enum.Call.html)
|
22 | 22 | //!
|
23 | 23 | //! ## Overview
|
@@ -268,13 +268,13 @@ use frame_support::traits::{
|
268 | 268 | };
|
269 | 269 | use frame_system::{self as system, ensure_signed, ensure_root};
|
270 | 270 |
|
271 |
| -type BalanceOf<T, I> = <<T as Trait<I>>::Currency as Currency<<T as system::Trait>::AccountId>>::Balance; |
272 |
| -type NegativeImbalanceOf<T> = <<T as Trait>::Currency as Currency<<T as frame_system::Trait>::AccountId>>::NegativeImbalance; |
| 271 | +type BalanceOf<T, I> = <<T as Config<I>>::Currency as Currency<<T as system::Config>::AccountId>>::Balance; |
| 272 | +type NegativeImbalanceOf<T> = <<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::NegativeImbalance; |
273 | 273 |
|
274 | 274 | /// The module's configuration trait.
|
275 |
| -pub trait Trait<I=DefaultInstance>: system::Trait { |
| 275 | +pub trait Config<I=DefaultInstance>: system::Config { |
276 | 276 | /// The overarching event type.
|
277 |
| - type Event: From<Event<Self, I>> + Into<<Self as system::Trait>::Event>; |
| 277 | + type Event: From<Event<Self, I>> + Into<<Self as system::Config>::Event>; |
278 | 278 |
|
279 | 279 | /// The societies's module id
|
280 | 280 | type ModuleId: Get<ModuleId>;
|
@@ -403,7 +403,7 @@ impl<AccountId: PartialEq, Balance> BidKind<AccountId, Balance> {
|
403 | 403 |
|
404 | 404 | // This module's storage items.
|
405 | 405 | decl_storage! {
|
406 |
| - trait Store for Module<T: Trait<I>, I: Instance=DefaultInstance> as Society { |
| 406 | + trait Store for Module<T: Config<I>, I: Instance=DefaultInstance> as Society { |
407 | 407 | /// The first member.
|
408 | 408 | pub Founder get(fn founder) build(|config: &GenesisConfig<T, I>| config.members.first().cloned()):
|
409 | 409 | Option<T::AccountId>;
|
@@ -472,7 +472,7 @@ decl_storage! {
|
472 | 472 | // The module's dispatchable functions.
|
473 | 473 | decl_module! {
|
474 | 474 | /// The module declaration.
|
475 |
| - pub struct Module<T: Trait<I>, I: Instance=DefaultInstance> for enum Call where origin: T::Origin { |
| 475 | + pub struct Module<T: Config<I>, I: Instance=DefaultInstance> for enum Call where origin: T::Origin { |
476 | 476 | type Error = Error<T, I>;
|
477 | 477 | /// The minimum amount of a deposit required for a bid to be made.
|
478 | 478 | const CandidateDeposit: BalanceOf<T, I> = T::CandidateDeposit::get();
|
@@ -1065,7 +1065,7 @@ decl_module! {
|
1065 | 1065 |
|
1066 | 1066 | decl_error! {
|
1067 | 1067 | /// Errors for this module.
|
1068 |
| - pub enum Error for Module<T: Trait<I>, I: Instance> { |
| 1068 | + pub enum Error for Module<T: Config<I>, I: Instance> { |
1069 | 1069 | /// An incorrect position was provided.
|
1070 | 1070 | BadPosition,
|
1071 | 1071 | /// User is not a member.
|
@@ -1108,7 +1108,7 @@ decl_error! {
|
1108 | 1108 | decl_event! {
|
1109 | 1109 | /// Events for this module.
|
1110 | 1110 | pub enum Event<T, I=DefaultInstance> where
|
1111 |
| - AccountId = <T as system::Trait>::AccountId, |
| 1111 | + AccountId = <T as system::Config>::AccountId, |
1112 | 1112 | Balance = BalanceOf<T, I>
|
1113 | 1113 | {
|
1114 | 1114 | /// The society is founded by the given identity. \[founder\]
|
@@ -1151,7 +1151,7 @@ decl_event! {
|
1151 | 1151 |
|
1152 | 1152 | /// Simple ensure origin struct to filter for the founder account.
|
1153 | 1153 | pub struct EnsureFounder<T>(sp_std::marker::PhantomData<T>);
|
1154 |
| -impl<T: Trait> EnsureOrigin<T::Origin> for EnsureFounder<T> { |
| 1154 | +impl<T: Config> EnsureOrigin<T::Origin> for EnsureFounder<T> { |
1155 | 1155 | type Success = T::AccountId;
|
1156 | 1156 | fn try_origin(o: T::Origin) -> Result<Self::Success, T::Origin> {
|
1157 | 1157 | o.into().and_then(|o| match (o, Founder::<T>::get()) {
|
@@ -1182,7 +1182,7 @@ fn pick_usize<'a, R: RngCore>(rng: &mut R, max: usize) -> usize {
|
1182 | 1182 | (rng.next_u32() % (max as u32 + 1)) as usize
|
1183 | 1183 | }
|
1184 | 1184 |
|
1185 |
| -impl<T: Trait<I>, I: Instance> Module<T, I> { |
| 1185 | +impl<T: Config<I>, I: Instance> Module<T, I> { |
1186 | 1186 | /// Puts a bid into storage ordered by smallest to largest value.
|
1187 | 1187 | /// Allows a maximum of 1000 bids in queue, removing largest value people first.
|
1188 | 1188 | fn put_bid(
|
@@ -1669,7 +1669,7 @@ impl<T: Trait<I>, I: Instance> Module<T, I> {
|
1669 | 1669 | }
|
1670 | 1670 | }
|
1671 | 1671 |
|
1672 |
| -impl<T: Trait> OnUnbalanced<NegativeImbalanceOf<T>> for Module<T> { |
| 1672 | +impl<T: Config> OnUnbalanced<NegativeImbalanceOf<T>> for Module<T> { |
1673 | 1673 | fn on_nonzero_unbalanced(amount: NegativeImbalanceOf<T>) {
|
1674 | 1674 | let numeric_amount = amount.peek();
|
1675 | 1675 |
|
|
0 commit comments