Skip to content

Commit

Permalink
containers: remove unsafe modifier on assume_valid_unsafe method
Browse files Browse the repository at this point in the history
For the history record, I am strongly against having and using this method, since it violates the security model.

Strong conceptual NACK on merging this PR
  • Loading branch information
dr-orlovsky committed Jun 27, 2024
1 parent a9077d0 commit 9565f79
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/containers/consignment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,8 @@ impl<const TRANSFER: bool> Consignment<TRANSFER> {
///
/// The function runs no actual validation, but still constructs
/// [`ValidConsignment`] type, which is a violation of type safety.
pub unsafe fn assume_valid(self) -> ValidConsignment<TRANSFER> {
/// The method must be used only for tests.
pub fn assume_valid_unsafe(self) -> ValidConsignment<TRANSFER> {
let validation_status = Status::with_failure(validation::Failure::Custom(s!(
"consignment was assumed valid with no actual validation"
)));
Expand Down

0 comments on commit 9565f79

Please sign in to comment.