Skip to content

Commit

Permalink
remove mirai macros
Browse files Browse the repository at this point in the history
  • Loading branch information
0o-de-lally committed Jan 20, 2025
1 parent 7150ce3 commit 2b223a5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions tools/wallet/src/core/key_factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ use crate::core::mnemonic::Mnemonic;
use anyhow::{anyhow, Result};
use byteorder::{ByteOrder, LittleEndian};
use hmac::Hmac;
use mirai_annotations::*;
use pbkdf2::pbkdf2;
use serde::{Deserialize, Serialize};
use std::ops::AddAssign;
Expand Down Expand Up @@ -63,8 +62,8 @@ impl ChildNumber {

impl std::ops::AddAssign for ChildNumber {
fn add_assign(&mut self, other: Self) {
assume!(self.0 <= u64::MAX / 2); // invariant
assume!(other.0 <= u64::MAX / 2); // invariant
// assume!(self.0 <= u64::MAX / 2); // invariant
// assume!(other.0 <= u64::MAX / 2); // invariant
*self = Self(self.0 + other.0)
}
}
Expand Down
7 changes: 4 additions & 3 deletions tools/wallet/src/core/mnemonic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use anyhow::{bail, Result};
#[cfg(test)]
use diem_temppath::TempPath;
use mirai_annotations::*;
// use mirai_annotations::*; // TODO: enable mirai
#[cfg(test)]
use rand::rngs::OsRng;
#[cfg(test)]
Expand Down Expand Up @@ -171,7 +171,7 @@ struct U11BitWriter {
impl U11BitWriter {
/// Create a new `BitWriter` around the given writer.
fn new(mnemonic_len: usize) -> U11BitWriter {
precondition!(mnemonic_len <= 24);
// precondition!(mnemonic_len <= 24);
U11BitWriter {
bytes: Vec::with_capacity(11 * mnemonic_len / 8 + 1),
unused: 8,
Expand Down Expand Up @@ -201,7 +201,8 @@ impl U11BitWriter {
nbits_remaining -= 8;
self.bytes.push((value >> nbits_remaining) as u8);
}
verify!(nbits_remaining < 8);

// verify!(nbits_remaining < 8);

// Put the remaining bits in the buffer.
if nbits_remaining > 0 {
Expand Down
1 change: 0 additions & 1 deletion tools/wallet/src/core/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! 0L key scheme
#![forbid(unsafe_code)]

pub mod key_factory;
pub mod legacy_scheme;
pub mod mnemonic;
Expand Down

0 comments on commit 2b223a5

Please sign in to comment.