Skip to content

Commit

Permalink
fix: fix migration unit test error
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoguang1010 committed Dec 12, 2023
1 parent 26db2f0 commit b34befb
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions token-core/tcx-migration/src/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,17 +338,10 @@ impl LegacyKeystore {

#[cfg(test)]
mod tests {
use serde_json::Value;
use tcx_common::FromHex;
use tcx_constants::{CoinInfo, TEST_MNEMONIC};
use tcx_common::utf8_or_hex_to_bytes;
use tcx_constants::{TEST_PASSWORD, TEST_PRIVATE_KEY};
use tcx_crypto::crypto::SCryptParams;
use tcx_crypto::Crypto;
use tcx_crypto::Pbkdf2Params;
use tcx_crypto::{EncPair, Key};
use tcx_keystore::keystore::Store;
use tcx_keystore::HdKeystore;
use tcx_keystore::{Keystore, KeystoreGuard, Metadata, PrivateKeystore, Source};
use tcx_crypto::Key;
use tcx_keystore::Keystore;

use super::LegacyKeystore;

Expand Down Expand Up @@ -543,10 +536,10 @@ mod tests {

#[test]
fn test_export_v3_keystore() {
let private_key_bytes = &Vec::<u8>::from_hex(TEST_PRIVATE_KEY).unwrap();
let private_key_bytes = utf8_or_hex_to_bytes(TEST_PRIVATE_KEY).unwrap();
let v3_keystore =
LegacyKeystore::new_v3(&private_key_bytes, TEST_PASSWORD).expect("v3 keystore");
let keystore_json = serde_json::to_string(&v3_keystore).expect("serde v3");
assert_eq!("", keystore_json);
let keystore_json = serde_json::to_string(&v3_keystore);
assert!(keystore_json.is_ok());
}
}

0 comments on commit b34befb

Please sign in to comment.