Skip to content

Commit

Permalink
feat(ton): Fix rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
satoshiotomakan committed Sep 9, 2024
1 parent 845ad51 commit 098d541
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions rust/tw_keypair/tests/crypto_box_ffi_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ use tw_memory::test_utils::tw_wrapper::TWAutoWrapper;

fn random_key_pair() -> (TWCryptoBoxSecretKeyHelper, TWCryptoBoxPublicKeyHelper) {
let secret = TWAutoWrapper::wrap(unsafe { tw_crypto_box_secret_key_create() });
let pubkey = TWAutoWrapper::wrap(unsafe { tw_crypto_box_secret_key_get_public_key(secret.ptr()) });
let pubkey =
TWAutoWrapper::wrap(unsafe { tw_crypto_box_secret_key_get_public_key(secret.ptr()) });
(secret, pubkey)
}

Expand Down Expand Up @@ -83,8 +84,9 @@ fn test_public_key() {
let pubkey_data = TWDataHelper::create(pubkey_bytes.clone());
assert!(unsafe { tw_crypto_box_public_key_is_valid(pubkey_data.ptr()) });

let pubkey =
TWAutoWrapper::wrap(unsafe { tw_crypto_box_public_key_create_with_data(pubkey_data.ptr()) });
let pubkey = TWAutoWrapper::wrap(unsafe {
tw_crypto_box_public_key_create_with_data(pubkey_data.ptr())
});
let actual_data = TWDataHelper::wrap(unsafe { tw_crypto_box_public_key_data(pubkey.ptr()) });
assert_eq!(actual_data.to_vec().unwrap(), pubkey_bytes);
}
Expand All @@ -98,8 +100,9 @@ fn test_secret_key() {
let secret_data = TWDataHelper::create(secret_bytes.clone());
assert!(unsafe { tw_crypto_box_secret_key_is_valid(secret_data.ptr()) });

let pubkey =
TWAutoWrapper::wrap(unsafe { tw_crypto_box_secret_key_create_with_data(secret_data.ptr()) });
let pubkey = TWAutoWrapper::wrap(unsafe {
tw_crypto_box_secret_key_create_with_data(secret_data.ptr())
});
let actual_data = TWDataHelper::wrap(unsafe { tw_crypto_box_secret_key_data(pubkey.ptr()) });
assert_eq!(actual_data.to_vec().unwrap(), secret_bytes);
}

0 comments on commit 098d541

Please sign in to comment.