v0.2.6-pre.016
This commit is contained in:
18
crates/ksp-wallet-lib/unit_tests/format.rs
Normal file
18
crates/ksp-wallet-lib/unit_tests/format.rs
Normal file
@@ -0,0 +1,18 @@
|
||||
// file: crates/ksp-wallet-lib/unit_tests/format.rs
|
||||
// version: 1
|
||||
|
||||
#[test]
|
||||
fn default_and_latest_are_explicit_and_currently_v2() {
|
||||
assert_eq!(crate::DEFAULT_WALLET_FORMAT, crate::WalletFormat::V2);
|
||||
assert_eq!(crate::LATEST_SUPPORTED_WALLET_FORMAT, crate::WalletFormat::V2);
|
||||
assert_eq!(crate::DEFAULT_WALLET_FORMAT.version(), crate::KSPWALLET_FORMAT_VERSION_V2);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn detector_distinguishes_v1_json_and_v2_binary_without_crypto() -> ksp_core_lib::Result<()> {
|
||||
let v1 = include_bytes!("../tests/fixtures/kspwallet_v1_wire_only.json");
|
||||
let v2 = include_bytes!("../tests/fixtures/kspwallet_v2_wire_only.bin");
|
||||
assert_eq!(crate::detect_wallet_format(v1)?, crate::WalletFormat::V1);
|
||||
assert_eq!(crate::detect_wallet_format(v2)?, crate::WalletFormat::V2);
|
||||
return std::result::Result::Ok(());
|
||||
}
|
||||
Reference in New Issue
Block a user