From 0a57eb46c60cdad91bd50ebe866b063a8fedf01c Mon Sep 17 00:00:00 2001 From: sneurlax Date: Wed, 16 Oct 2024 21:02:46 -0500 Subject: add get_status fn for error-handling --- impls/monero.rs/tests/integration_tests.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'impls/monero.rs/tests') diff --git a/impls/monero.rs/tests/integration_tests.rs b/impls/monero.rs/tests/integration_tests.rs index 0235bb8..2e439d1 100644 --- a/impls/monero.rs/tests/integration_tests.rs +++ b/impls/monero.rs/tests/integration_tests.rs @@ -264,3 +264,21 @@ fn test_wallet_error_display() { _ => panic!("Expected WalletErrorCode variant"), } } + +#[test] +fn test_wallet_status_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"); + + // Check the status of the wallet. + let status = manager.get_status(wallet.ptr.as_ptr()); + assert!(status.is_ok(), "Expected status OK, got error: {:?}", status.err()); + + // Clean up. + teardown(&temp_dir).expect("Failed to clean up after test"); +} -- cgit v1.2.3