Skip to content

Commit

Permalink
fix(pallets/communities): lint
Browse files Browse the repository at this point in the history
  • Loading branch information
pandres95 committed Oct 17, 2023
1 parent 54ad06d commit ee0463f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pallets/communities/src/functions/governance/poll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl<T: Config> Pallet<T> {
match governance_strategy {
CommunityGovernanceStrategy::AdminBased(_) => Ok(PollOutcome::Approved),
CommunityGovernanceStrategy::MemberCountPoll { min } => {
if ayes.saturating_add(nays) >= min.into() {
if ayes.saturating_add(nays) >= min {
if ayes > nays {
Ok(PollOutcome::Approved)
} else {
Expand Down
2 changes: 1 addition & 1 deletion pallets/communities/src/functions/governance/proposals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl<T: Config> Pallet<T> {
proposal.origin,
proposal.call,
)
.and_then(|_| Ok(()))
.map(|_| ())
}

fn do_enqueue_proposal(community_id: &CommunityIdOf<T>, proposal: CommunityProposal<T>) -> DispatchResult {
Expand Down
4 changes: 2 additions & 2 deletions pallets/communities/src/functions/membership.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ impl<T: Config> Pallet<T> {
let caller = ensure_signed(origin)?;

Self::membership(community_id, &caller)
.ok_or(DispatchError::BadOrigin.into())
.and_then(|_| Ok(caller))
.ok_or(DispatchError::BadOrigin)
.map(|_| caller)
}

#[allow(dead_code)]
Expand Down
2 changes: 1 addition & 1 deletion pallets/communities/src/tests/governance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ mod execute_call {
record.event
== frame_system::Event::<Test>::Remarked {
sender: community_account_id,
hash: H256::from(blake2_256(&b"Hello, governance!".to_vec())),
hash: H256::from(blake2_256(b"Hello, governance!".as_ref())),
}
.into()
}));
Expand Down

0 comments on commit ee0463f

Please sign in to comment.