summaryrefslogtreecommitdiff
path: root/impls/monero.rs/src/lib.rs
diff options
context:
space:
mode:
authorsneurlax <sneurlax@gmail.com>2024-10-12 02:25:46 -0500
committersneurlax <sneurlax@gmail.com>2024-10-12 02:25:46 -0500
commita046d9002345918bc39dd53c8b13885b2db84263 (patch)
tree32e6d5537d43b41eae29c24d01f26537107b9c0f /impls/monero.rs/src/lib.rs
parentdc103c890cc1752f246fef3f8e472bc852ddd487 (diff)
replace main.rs demo with integration tests
TODO unit and docs tests
Diffstat (limited to 'impls/monero.rs/src/lib.rs')
-rw-r--r--impls/monero.rs/src/lib.rs22
1 files changed, 11 insertions, 11 deletions
diff --git a/impls/monero.rs/src/lib.rs b/impls/monero.rs/src/lib.rs
index 7c21c9d..c9b1d81 100644
--- a/impls/monero.rs/src/lib.rs
+++ b/impls/monero.rs/src/lib.rs
@@ -6,6 +6,17 @@ use std::sync::Arc;
use libloading::{Library, Symbol};
+#[cfg(target_os = "android")]
+const LIB_NAME: &str = "libmonero_libwallet2_api_c.so";
+#[cfg(target_os = "ios")]
+const LIB_NAME: &str = "MoneroWallet.framework/MoneroWallet";
+#[cfg(target_os = "linux")]
+const LIB_NAME: &str = "monero_libwallet2_api_c.so";
+#[cfg(target_os = "macos")]
+const LIB_NAME: &str = "monero_libwallet2_api_c.dylib";
+#[cfg(target_os = "windows")]
+const LIB_NAME: &str = "monero_libwallet2_api_c.dll";
+
pub mod network {
use std::os::raw::c_int;
pub const MAINNET: c_int = 0;
@@ -28,17 +39,6 @@ pub struct WalletManager {
library: Library,
}
-#[cfg(target_os = "android")]
-const LIB_NAME: &str = "libmonero_libwallet2_api_c.so";
-#[cfg(target_os = "ios")]
-const LIB_NAME: &str = "MoneroWallet.framework/MoneroWallet";
-#[cfg(target_os = "linux")]
-const LIB_NAME: &str = "monero_libwallet2_api_c.so";
-#[cfg(target_os = "macos")]
-const LIB_NAME: &str = "monero_libwallet2_api_c.dylib";
-#[cfg(target_os = "windows")]
-const LIB_NAME: &str = "monero_libwallet2_api_c.dll";
-
impl WalletManager {
/// Creates a new `WalletManager`, loading the Monero wallet library (`wallet2_api_c`).
pub fn new(lib_path: Option<&str>) -> WalletResult<Arc<Self>> {