Trait governance_os_support::traits::VotingRouter [−][src]
pub trait VotingRouter { type AccountId; type VotingSystemId: Parameter; type Parameters: Parameter; type ProposalId: Parameter; type VoteData: Parameter; fn initiate(
voting_system: Self::VotingSystemId,
proposal: Self::ProposalId,
parameters: Self::Parameters
) -> DispatchResult; fn veto(
voting_system: Self::VotingSystemId,
proposal: Self::ProposalId
) -> DispatchResult; fn vote(
voting_system: Self::VotingSystemId,
proposal: Self::ProposalId,
voter: &Self::AccountId,
data: Self::VoteData
) -> DispatchResult; fn close(
voting_system: Self::VotingSystemId,
proposal: Self::ProposalId
) -> Result<ProposalResult, DispatchError>; }
Used to route votes and related actions between different voting system implementations.
Associated Types
type AccountId
[src]
How accounts are represented, used to identify voters.
type VotingSystemId: Parameter
[src]
How the runtime defines a voting system. And how users can select it. Typically this
would be a rust enum
.
type Parameters: Parameter
[src]
How the parameters of a voting system are represented and set at the
organization level. Typically an enum
to account for all the different
parameters for the different voting systems.
type ProposalId: Parameter
[src]
How we represent a proposal. Typically a Hash
.
type VoteData: Parameter
[src]
How the runtime represents the different vote data of the different voting systems.
Typically an enum
to account for all the different voting systems.
Required methods
fn initiate(
voting_system: Self::VotingSystemId,
proposal: Self::ProposalId,
parameters: Self::Parameters
) -> DispatchResult
[src]
voting_system: Self::VotingSystemId,
proposal: Self::ProposalId,
parameters: Self::Parameters
) -> DispatchResult
Route the initiate
call to the right StandardizedVoting
implementation based
on the value of voting_systems
.
fn veto(
voting_system: Self::VotingSystemId,
proposal: Self::ProposalId
) -> DispatchResult
[src]
voting_system: Self::VotingSystemId,
proposal: Self::ProposalId
) -> DispatchResult
Route the veto
call to the right StandardizedVoting
implementation based
on the value of voting_systems
.
fn vote(
voting_system: Self::VotingSystemId,
proposal: Self::ProposalId,
voter: &Self::AccountId,
data: Self::VoteData
) -> DispatchResult
[src]
voting_system: Self::VotingSystemId,
proposal: Self::ProposalId,
voter: &Self::AccountId,
data: Self::VoteData
) -> DispatchResult
Route the vote
call to the right StandardizedVoting
implementation based
on the value of voting_systems
.
fn close(
voting_system: Self::VotingSystemId,
proposal: Self::ProposalId
) -> Result<ProposalResult, DispatchError>
[src]
voting_system: Self::VotingSystemId,
proposal: Self::ProposalId
) -> Result<ProposalResult, DispatchError>
Route the close
call to the right StandardizedVoting
implementation based
on the value of voting_systems
.