diff options
| author | sneurlax <sneurlax@gmail.com> | 2024-10-16 21:42:41 -0500 |
|---|---|---|
| committer | sneurlax <sneurlax@gmail.com> | 2024-10-16 21:42:41 -0500 |
| commit | ff39a2876b6708dafefe84d6a04237fa13b64303 (patch) | |
| tree | 20272aa90812df2f5121dd5b11cd94d0e3245d00 /impls/monero.rs/tests/integration_tests.rs | |
| parent | 824a8291ea22a08187cd377d87e08faa6c429e4a (diff) | |
add open_wallet
Diffstat (limited to 'impls/monero.rs/tests/integration_tests.rs')
| -rw-r--r-- | impls/monero.rs/tests/integration_tests.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/impls/monero.rs/tests/integration_tests.rs b/impls/monero.rs/tests/integration_tests.rs index 2e439d1..6aeeab0 100644 --- a/impls/monero.rs/tests/integration_tests.rs +++ b/impls/monero.rs/tests/integration_tests.rs @@ -282,3 +282,26 @@ fn test_wallet_status_integration() { // Clean up. teardown(&temp_dir).expect("Failed to clean up after test"); } + +#[test] +fn test_open_wallet_integration() { + let (manager, temp_dir) = setup().expect("Failed to set up test environment"); + + // Create a wallet. + let wallet_path = temp_dir.path().join("test_wallet"); + let wallet_str = wallet_path.to_str().expect("Failed to convert wallet path to string"); + + let wallet = manager + .create_wallet(wallet_str, "password", "English", NetworkType::Mainnet) + .expect("Failed to create wallet"); + + // Drop the wallet to simulate closing it. + drop(wallet); + + // Try opening the wallet. + let open_result = manager.open_wallet(wallet_str, "password", NetworkType::Mainnet); + assert!(open_result.is_ok(), "Failed to open wallet: {:?}", open_result.err()); + + // Clean up. + teardown(&temp_dir).expect("Failed to clean up after test"); +} |
