Skip to content

Commit

Permalink
amend review
Browse files Browse the repository at this point in the history
  • Loading branch information
snowmead committed Dec 17, 2024
1 parent 0ebba7e commit 32b73e3
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
15 changes: 7 additions & 8 deletions pallets/file-system/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ where
}
};

// Check if the storage request is open to volunteers.
// This should always be true since the storage request would be deleted from storage if the `bsps_confirmed` is equal to `bsps_required`.
// This should always be true since the storage request will be deleted from storage if the `bsps_confirmed` is equal to `bsps_required`.
Ok(storage_request.bsps_confirmed < storage_request.bsps_required)
}

Expand Down Expand Up @@ -277,7 +276,7 @@ where
Error::<T>::NotAMsp
);

// Check if provider is insolvent
// Check if MSP is insolvent
ensure!(
!<T::Providers as ReadProvidersInterface>::is_provider_insolvent(msp_id),
Error::<T>::OperationNotAllowedForInsolventProvider
Expand Down Expand Up @@ -379,7 +378,7 @@ where
let msp_id = <T::Providers as shp_traits::ReadProvidersInterface>::get_provider_id(sender)
.ok_or(Error::<T>::NotAMsp)?;

// Check if provider is insolvent.
// Check if MSP is insolvent.
ensure!(
!<T::Providers as ReadProvidersInterface>::is_provider_insolvent(msp_id),
Error::<T>::OperationNotAllowedForInsolventProvider
Expand Down Expand Up @@ -614,7 +613,7 @@ where
Error::<T>::NotAMsp
);

// Check if the provider is insolvent
// Check if the MSP is insolvent
ensure!(
!<T::Providers as ReadProvidersInterface>::is_provider_insolvent(*msp_id),
Error::<T>::OperationNotAllowedForInsolventProvider
Expand Down Expand Up @@ -819,7 +818,7 @@ where
bucket_id: BucketIdFor<T>,
accepted_file_keys: StorageRequestMspAcceptedFileKeys<T>,
) -> Result<MerkleHash<T>, DispatchError> {
// Check if provider is insolvent.
// Check if MSP is insolvent.
ensure!(
!<T::Providers as ReadProvidersInterface>::is_provider_insolvent(msp_id),
Error::<T>::OperationNotAllowedForInsolventProvider
Expand Down Expand Up @@ -1042,7 +1041,7 @@ where
<T::Providers as shp_traits::ReadProvidersInterface>::get_provider_id(sender.clone())
.ok_or(Error::<T>::NotABsp)?;

// Check if provider is insolvent.
// Check if BSP is insolvent.
ensure!(
!<T::Providers as ReadProvidersInterface>::is_provider_insolvent(bsp_id),
Error::<T>::OperationNotAllowedForInsolventProvider
Expand Down Expand Up @@ -1150,7 +1149,7 @@ where
<T::Providers as shp_traits::ReadProvidersInterface>::get_provider_id(sender.clone())
.ok_or(Error::<T>::NotABsp)?;

// Check if provider is insolvent.
// Check if BSP is insolvent.
ensure!(
!<T::Providers as ReadProvidersInterface>::is_provider_insolvent(bsp_id),
Error::<T>::OperationNotAllowedForInsolventProvider
Expand Down
2 changes: 1 addition & 1 deletion pallets/payment-streams/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1864,7 +1864,7 @@ where
/// Returns the `ProviderLastChargeableInfo` of a Provider, which includes the last chargeable tick and the last chargeable price index.
///
/// If the provider is insolvent, the last chargeable tick is set to the block at which the provider became insolvent since we do not allow
/// Providers to charge for the time they were insolvent. `LastChargeableInfo` is updated to reflect this change.
/// providers to charge for the time they were insolvent. `LastChargeableInfo` is updated to reflect this change.
pub fn get_last_chargeable_info_with_privilege(
provider_id: &ProviderIdFor<T>,
) -> ProviderLastChargeableInfo<T> {
Expand Down
2 changes: 1 addition & 1 deletion pallets/providers/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ where
let msp_id =
AccountIdToMainStorageProviderId::<T>::get(who).ok_or(Error::<T>::NotRegistered)?;

// Check if provider is insolvent
// Check if MSP is insolvent
ensure!(
InsolventProviders::<T>::get(StorageProviderId::<T>::MainStorageProvider(msp_id))
.is_none(),
Expand Down
2 changes: 1 addition & 1 deletion primitives/traits/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,7 @@ pub trait PaymentStreamsInterface {
/// Remove a priviledge provider to the PriviledgerProvider storage.
fn remove_privileged_provider(provider_id: &Self::ProviderId) -> DispatchResult;

/// Get current tick
/// Get current tick.
fn current_tick() -> Self::TickNumber;
}

Expand Down
2 changes: 1 addition & 1 deletion test/suites/integration/bsp/single-volunteer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describeBspNet("Single BSP Volunteering", ({ before, createBspApi, it, createUse
shUser
);

// Wait for the bsp to volunteer
// Wait for the BSP to volunteer.
await sleep(500);

await userApi.assert.eventPresent("fileSystem", "NewStorageRequest");
Expand Down

0 comments on commit 32b73e3

Please sign in to comment.