Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 🎨 implement requested changes for stop challenge cycle PR #316

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ runtimes/
.env
*.tmp
**/tmp/
res/benchmarking

.DS_Store
.vscode/
Expand Down
3 changes: 1 addition & 2 deletions api-augment/dist/interfaces/lookup.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api-augment/dist/interfaces/lookup.js.map

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions api-augment/dist/types/interfaces/augment-api-errors.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -447,10 +447,6 @@ declare module "@polkadot/api-base/types/errors" {
* Number of removed BSPs volunteered from storage request prefix did not match the expected number.
**/
UnexpectedNumberOfRemovedVolunteeredBsps: AugmentedError<ApiType>;
/**
* Used Capacity value should be 0.
**/
UsedCapacityShouldBeZero: AugmentedError<ApiType>;
/**
* A SP tried to stop storing files from a user that was supposedly insolvent, but the user is not insolvent.
**/
Expand Down
4 changes: 1 addition & 3 deletions api-augment/dist/types/interfaces/types-lookup.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5457,7 +5457,6 @@ declare module "@polkadot/types/lookup" {
readonly isRootNotUpdated: boolean;
readonly isNoPrivacyChange: boolean;
readonly isOperationNotAllowedForInsolventProvider: boolean;
readonly isUsedCapacityShouldBeZero: boolean;
readonly type:
| "StorageRequestAlreadyRegistered"
| "StorageRequestNotFound"
Expand Down Expand Up @@ -5532,8 +5531,7 @@ declare module "@polkadot/types/lookup" {
| "NoFileKeysToConfirm"
| "RootNotUpdated"
| "NoPrivacyChange"
| "OperationNotAllowedForInsolventProvider"
| "UsedCapacityShouldBeZero";
| "OperationNotAllowedForInsolventProvider";
}
/** @name PalletProofsDealerProofSubmissionRecord (467) */
interface PalletProofsDealerProofSubmissionRecord extends Struct {
Expand Down
4 changes: 0 additions & 4 deletions api-augment/src/interfaces/augment-api-errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,10 +455,6 @@ declare module "@polkadot/api-base/types/errors" {
* Number of removed BSPs volunteered from storage request prefix did not match the expected number.
**/
UnexpectedNumberOfRemovedVolunteeredBsps: AugmentedError<ApiType>;
/**
* Used Capacity value should be 0.
**/
UsedCapacityShouldBeZero: AugmentedError<ApiType>;
/**
* A SP tried to stop storing files from a user that was supposedly insolvent, but the user is not insolvent.
**/
Expand Down
3 changes: 1 addition & 2 deletions api-augment/src/interfaces/lookup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4541,8 +4541,7 @@ export default {
"NoFileKeysToConfirm",
"RootNotUpdated",
"NoPrivacyChange",
"OperationNotAllowedForInsolventProvider",
"UsedCapacityShouldBeZero"
"OperationNotAllowedForInsolventProvider"
]
},
/**
Expand Down
4 changes: 1 addition & 3 deletions api-augment/src/interfaces/types-lookup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5724,7 +5724,6 @@ declare module "@polkadot/types/lookup" {
readonly isRootNotUpdated: boolean;
readonly isNoPrivacyChange: boolean;
readonly isOperationNotAllowedForInsolventProvider: boolean;
readonly isUsedCapacityShouldBeZero: boolean;
readonly type:
| "StorageRequestAlreadyRegistered"
| "StorageRequestNotFound"
Expand Down Expand Up @@ -5799,8 +5798,7 @@ declare module "@polkadot/types/lookup" {
| "NoFileKeysToConfirm"
| "RootNotUpdated"
| "NoPrivacyChange"
| "OperationNotAllowedForInsolventProvider"
| "UsedCapacityShouldBeZero";
| "OperationNotAllowedForInsolventProvider";
}

/** @name PalletProofsDealerProofSubmissionRecord (467) */
Expand Down
2 changes: 1 addition & 1 deletion api-augment/storagehub.json

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions pallets/file-system/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -826,8 +826,6 @@ pub mod pallet {
NoPrivacyChange,
/// Operations not allowed for insolvent provider
OperationNotAllowedForInsolventProvider,
/// Used Capacity value should be 0.
UsedCapacityShouldBeZero,
}

/// This enum holds the HoldReasons for this pallet, allowing the runtime to identify each held balance with different reasons separately
Expand Down
3 changes: 2 additions & 1 deletion pallets/file-system/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
}};
// Handle boolean type
($condition:expr, $error_msg:expr, $error_type:path, bool) => {{
if !$condition {

Check warning on line 71 in pallets/file-system/src/utils.rs

View workflow job for this annotation

GitHub Actions / Check lint with clippy

the use of negated comparison operators on partially ordered types produces code that is hard to read and refactor, please consider using the `partial_cmp` method instead, to make it clear that the two values could be incomparable
#[cfg(test)]
unreachable!($error_msg);

Expand Down Expand Up @@ -1800,8 +1800,9 @@
});
}

// We should remove the BSP from the dealer proof
// Stop the BSP's challenge and randomness cycles.
<T::ProofDealer as shp_traits::ProofsDealerInterface>::stop_challenge_cycle(&bsp_id)?;
<T::CrRandomness as CommitRevealRandomnessInterface>::stop_randomness_cycle(&bsp_id)?;
};

Ok((bsp_id, new_root))
Expand Down
Loading