Skip to content

Commit

Permalink
clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
1xstj committed Nov 22, 2023
1 parent cb989fd commit 0de9ed0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pallets/jobs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ pub mod module {

for participant in participants {
ensure!(
T::RolesHandler::is_validator(participant.clone(), job_key.clone().into()),
T::RolesHandler::is_validator(participant.clone(), job_key.clone()),
Error::<T>::InvalidValidator
);

Expand Down Expand Up @@ -234,7 +234,7 @@ pub mod module {
// Ensure the phase one participants are still validators
for participant in result.participants {
ensure!(
T::RolesHandler::is_validator(participant.clone(), job_key.clone().into()),
T::RolesHandler::is_validator(participant.clone(), job_key.clone()),
Error::<T>::InvalidValidator
);

Expand Down
4 changes: 2 additions & 2 deletions pallets/jobs/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub type AccountId = u128;
pub type Balance = u128;
pub type BlockNumber = u64;

use tangle_primitives::{jobs::*, roles::RoleType};
use tangle_primitives::{jobs::*};

impl frame_system::Config for Runtime {
type RuntimeOrigin = RuntimeOrigin;
Expand Down Expand Up @@ -128,7 +128,7 @@ impl JobToFee<AccountId, BlockNumber> for MockJobToFeeHandler {
pub struct MockRolesHandler;

impl RolesHandler<AccountId> for MockRolesHandler {
fn is_validator(address: AccountId, _role_type: RoleType) -> bool {
fn is_validator(address: AccountId, _role_type: JobKey) -> bool {
let validators = [1, 2, 3, 4, 5];
validators.contains(&address)
}
Expand Down
1 change: 1 addition & 0 deletions primitives/src/types/roles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Tangle. If not, see <http://www.gnu.org/licenses/>.
use frame_support::pallet_prelude::*;
use frame_support::dispatch::Vec;

/// Role type to be used in the system.
#[derive(Encode, Decode, Clone, Debug, PartialEq, Eq, TypeInfo)]
Expand Down

0 comments on commit 0de9ed0

Please sign in to comment.