Conversation
src/roles/actors.rs
Outdated
| pub min_stake: BalanceOf<T>, | ||
|
|
||
| // the maximum number of spots available to fill for a role | ||
| pub max_actors: u32, |
There was a problem hiding this comment.
Better to swap a position: first min_actors, then max_actors.
It's easier for perception like in counting: from smaller to bigger.
src/roles/actors.rs
Outdated
| AvailableRoles get(available_roles) : Vec<Role>; // = vec![Role::Storage]; | ||
|
|
||
| /// Actors list | ||
| Actors get(actors) : Vec<T::AccountId>; |
There was a problem hiding this comment.
Actually, this is a list of actors' account ids, not Actors
| Actors get(actors) : Vec<T::AccountId>; | |
| ActorIds get(actor_ids) : Vec<T::AccountId>; |
src/roles/actors.rs
Outdated
| Actors get(actors) : Vec<T::AccountId>; | ||
|
|
||
| /// actor accounts mapped to their actor | ||
| ActorsByAccountId get(actors_by_account_id) : map T::AccountId => Option<Actor<T>>; |
There was a problem hiding this comment.
Actor, not Actors, because you return option of an actor, not a list of actors.
| ActorsByAccountId get(actors_by_account_id) : map T::AccountId => Option<Actor<T>>; | |
| ActorByAccountId get(actor_by_account_id) : map T::AccountId => Option<Actor<T>>; |
src/roles/actors.rs
Outdated
| ActorsByAccountId get(actors_by_account_id) : map T::AccountId => Option<Actor<T>>; | ||
|
|
||
| /// actor accounts associated with a role | ||
| AccountsByRole get(accounts_by_role) : map Role => Vec<T::AccountId>; |
There was a problem hiding this comment.
| AccountsByRole get(accounts_by_role) : map Role => Vec<T::AccountId>; | |
| AccountIdsByRole get(account_ids_by_role) : map Role => Vec<T::AccountId>; |
src/roles/actors.rs
Outdated
| AccountsByRole get(accounts_by_role) : map Role => Vec<T::AccountId>; | ||
|
|
||
| /// actor accounts associated with a member id | ||
| AccountsByMember get(accounts_by_member) : map MemberId<T> => Vec<T::AccountId>; |
There was a problem hiding this comment.
| AccountsByMember get(accounts_by_member) : map MemberId<T> => Vec<T::AccountId>; | |
| AccountIdsByMemberId get(account_ids_by_member_id) : map MemberId<T> => Vec<T::AccountId>; |
src/roles/actors.rs
Outdated
| } | ||
|
|
||
| impl<T: Trait> Module<T> { | ||
| fn role_is_available(role: Role) -> bool { |
There was a problem hiding this comment.
| fn role_is_available(role: Role) -> bool { | |
| fn is_role_available(role: Role) -> bool { |
|
|
||
| fn on_initialise(now: T::BlockNumber) { | ||
| // clear expired requests | ||
| if now % T::BlockNumber::sa(DEFAULT_REQUEST_CLEARING_INTERVAL) == T::BlockNumber::zero() { |
There was a problem hiding this comment.
Consider creating an extra variable just to make code easier to read, then you can get rid of a comment:
| if now % T::BlockNumber::sa(DEFAULT_REQUEST_CLEARING_INTERVAL) == T::BlockNumber::zero() { | |
| let is_request_expired = now % T::BlockNumber::sa(DEFAULT_REQUEST_CLEARING_INTERVAL) == T::BlockNumber::zero() | |
| if is_request_expired { |
There was a problem hiding this comment.
I see you point in general, but in this exact case the that check is just a check to see if we reached the interval where we actually check each request.
New Grid component.
Revert "Bring all up to date."
* Add homepage URL * Allow deployment to gh-pages branch * Bump @polkadot/dev (with deploy:ghpages)
Fix channel agent permissions test cases for initialize/cancel channel transfer
…on-test fix: terminateLeads integraion-tests job in full scenario
Builds on membership module, #3
Some refactoring of council elections, and runtime upgrade proposals module to only allow members to participate.
Adding a simple staking mechanism to enter the new roles introduced in athens. It follows a similar mechanism to validator staking, but allows for using a separate account than will be associated with a members account. A member can enter a role (become an actor for a role) with these steps:
and there is enough balance in the actor account it will be bonded and role is entered into.
Still todo: