Skip to content

Commit

Permalink
Add SAFETY comments
Browse files Browse the repository at this point in the history
  • Loading branch information
james-chf committed Oct 21, 2022
1 parent db8c078 commit a284afc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apps/src/lib/config/ethereum_bridge/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ pub struct MinimumConfirmations(NonZeroU64);

impl Default for MinimumConfirmations {
fn default() -> Self {
// SAFETY: The only way the API contract of `NonZeroU64`can be violated
// is if we construct values of this type using 0 as argument.
Self(unsafe { NonZeroU64::new_unchecked(100) })
}
}
Expand Down Expand Up @@ -55,6 +57,8 @@ pub struct ContractVersion(NonZeroU64);

impl Default for ContractVersion {
fn default() -> Self {
// SAFETY: The only way the API contract of `NonZeroU64`can be violated
// is if we construct values of this type using 0 as argument.
Self(unsafe { NonZeroU64::new_unchecked(1) })
}
}
Expand Down

0 comments on commit a284afc

Please sign in to comment.