Skip to content

Commit

Permalink
clippy changes
Browse files Browse the repository at this point in the history
  • Loading branch information
aie0 committed Dec 12, 2023
1 parent 116d5f0 commit 23a46f3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
3 changes: 2 additions & 1 deletion pallets/ddc-customers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,15 @@ pub mod pallet {
if balance < min {
if let Some(vault) = &self.feeder_account {
let _ = <T as pallet::Config>::Currency::transfer(
&vault,
vault,
&account_id,
min - balance,
ExistenceRequirement::AllowDeath,
);
} else {
let _ = <T as pallet::Config>::Currency::make_free_balance_be(&account_id, min);
}
}

for &(ref cluster_id, ref owner_id, ref deposit) in &self.buckets {
let cur_bucket_id = <BucketsCount<T>>::get()
Expand Down
8 changes: 5 additions & 3 deletions pallets/ddc-customers/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,11 @@ impl ExtBuilder {
}
.assimilate_storage(&mut storage);

let _customer_genesis =
pallet_ddc_customers::GenesisConfig::<Test> { feeder_account: None }
.assimilate_storage(&mut storage);
let _customer_genesis = pallet_ddc_customers::GenesisConfig::<Test> {
feeder_account: None,
buckets: Default::default(),
}
.assimilate_storage(&mut storage);

TestExternalities::new(storage)
}
Expand Down
2 changes: 1 addition & 1 deletion pallets/ddc-payouts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ pub mod pallet {
if balance < min {
if let Some(vault) = &self.feeder_account {
let _ = <T as pallet::Config>::Currency::transfer(
&vault,
vault,
&account_id,
min - balance,
ExistenceRequirement::AllowDeath,
Expand Down
4 changes: 2 additions & 2 deletions pallets/ddc-payouts/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1515,7 +1515,7 @@ fn send_rewarding_providers_batch_works100nodes() {
node_batch.clear();
}
}
if node_batch.len() > 0 {
if !node_batch.is_empty() {
payees.push(node_batch.clone());
}

Expand Down Expand Up @@ -1553,7 +1553,7 @@ fn send_rewarding_providers_batch_works100nodes() {
user_batch.clear();
}
}
if user_batch.len() > 0 {
if !user_batch.is_empty() {
payers.push(user_batch.clone());
}

Expand Down

0 comments on commit 23a46f3

Please sign in to comment.