From 5a94aa36620949527e75c74aa6d116c0827f2ef6 Mon Sep 17 00:00:00 2001 From: Patrik Stas Date: Mon, 10 Apr 2023 22:12:35 +0200 Subject: [PATCH 1/5] Remove unnecessary dependencies Signed-off-by: Patrik Stas --- Cargo.lock | 14 +------------- aries_vcx/Cargo.toml | 4 +--- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3f3350a3bc..536af75de0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -198,7 +198,6 @@ dependencies = [ "indy-credx", "indy-vdr", "lazy_static", - "libloading 0.5.2", "libvdrtools", "log", "messages", @@ -215,7 +214,6 @@ dependencies = [ "time", "tokio", "uuid 0.8.2", - "zmq", ] [[package]] @@ -2370,16 +2368,6 @@ version = "0.2.139" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" -[[package]] -name = "libloading" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" -dependencies = [ - "cc", - "winapi", -] - [[package]] name = "libloading" version = "0.7.4" @@ -2752,7 +2740,7 @@ version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "166b5ef52a3ab5575047a9fe8d4a030cdd0f63c96f071cd6907674453b07bae3" dependencies = [ - "libloading 0.7.4", + "libloading", ] [[package]] diff --git a/aries_vcx/Cargo.toml b/aries_vcx/Cargo.toml index 0f3b997193..a41240c725 100644 --- a/aries_vcx/Cargo.toml +++ b/aries_vcx/Cargo.toml @@ -24,7 +24,7 @@ modular_libs = ["dep:indy-vdr", "dep:indy-credx"] test_utils = [ "messages/test_utils", "vdrtools", "modular_libs" ] # Feature flag for categorising tests which require a ledger to be running pool_tests = [ "test_utils" ] -# Feature flag for categorising tests which require a ledger and messaging agency to be running +# Feature flag for categorising tests which require a ledger and messaging agency to be running agency_pool_tests = [ "test_utils" ] # Feature flag for categorising general tests (usually unit tests) general_test = [ "test_utils", "messages/general_test" ] @@ -71,7 +71,6 @@ indy-vdr = { version = "0.3.4", default-features = false, features = ["ffi", "lo indy-credx = { git = "https://github.com/anonyome/indy-shared-rs.git", rev = "7342bc624d23ece8845d1a701cd2cdc9cd401bb0", optional = true } # ---------------------- futures = { version = "0.3", default-features = false } -libloading = "0.5.0" uuid = { version = "0.8", default-features = false, features = ["v4"] } strum = "0.16.0" strum_macros = "0.16.0" @@ -79,7 +78,6 @@ agency_client = { path = "../agency_client" } derive_builder = "0.10.2" tokio = { version = "1.20.4" } messages = { path = "../messages" } -zmq = { version = "0.9.2" } thiserror = "1.0.37" [target.'cfg(target_os = "android")'.dependencies] From 5dc1273da3bcbcd5fbe357512b4f24212ea37ca9 Mon Sep 17 00:00:00 2001 From: Patrik Stas Date: Tue, 11 Apr 2023 12:37:46 +0200 Subject: [PATCH 2/5] vdrtools: Remove unnecessary wallet ffi functions Signed-off-by: Patrik Stas --- libvdrtools/indy-api-types/src/lib.rs | 356 -------------------------- 1 file changed, 356 deletions(-) diff --git a/libvdrtools/indy-api-types/src/lib.rs b/libvdrtools/indy-api-types/src/lib.rs index 4ccd25f081..228ee50bfa 100644 --- a/libvdrtools/indy-api-types/src/lib.rs +++ b/libvdrtools/indy-api-types/src/lib.rs @@ -279,359 +279,3 @@ pub enum ErrorCode { // Registered Ledger type does not match to the network of id IncompatibleLedger = 812, } - -pub mod wallet { - use super::*; - use libc::c_char; - - /// Create the wallet storage (For example, database creation) - /// - /// #Params - /// name: wallet storage name (the same as wallet name) - /// config: wallet storage config (For example, database config) - /// credentials_json: wallet storage credentials (For example, database credentials) - /// metadata: wallet metadata (For example encrypted keys). - pub type WalletCreate = extern "C" fn( - name: *const c_char, - config: *const c_char, - credentials_json: *const c_char, - metadata: *const c_char, - ) -> ErrorCode; - - /// Open the wallet storage (For example, opening database connection) - /// - /// #Params - /// name: wallet storage name (the same as wallet name) - /// config: wallet storage config (For example, database config) - /// credentials_json: wallet storage credentials (For example, database credentials) - /// storage_handle_p: pointer to store opened storage handle - pub type WalletOpen = extern "C" fn( - name: *const c_char, - config: *const c_char, - credentials_json: *const c_char, - storage_handle_p: *mut IndyHandle, - ) -> ErrorCode; - - /// Close the opened walled storage (For example, closing database connection) - /// - /// #Params - /// storage_handle: opened storage handle (See open handler) - pub type WalletClose = extern "C" fn(storage_handle: StorageHandle) -> ErrorCode; - - /// Delete the wallet storage (For example, database deletion) - /// - /// #Params - /// name: wallet storage name (the same as wallet name) - /// config: wallet storage config (For example, database config) - /// credentials_json: wallet storage credentials (For example, database credentials) - pub type WalletDelete = extern "C" fn( - name: *const c_char, - config: *const c_char, - credentials_json: *const c_char, - ) -> ErrorCode; - - /// Create a new record in the wallet storage - /// - /// #Params - /// storage_handle: opened storage handle (See open handler) - /// type_: allows to separate different record types collections - /// id: the id of record - /// value: the value of record (pointer to buffer) - /// value_len: the value of record (buffer size) - /// tags_json: the record tags used for search and storing meta information as json: - /// { - /// "tagName1": "tag value 1", // string value - /// "tagName2": 123, // numeric value - /// } - /// Note that null means no tags - pub type WalletAddRecord = extern "C" fn( - storage_handle: StorageHandle, - type_: *const c_char, - id: *const c_char, - value: *const u8, - value_len: usize, - tags_json: *const c_char, - ) -> ErrorCode; - - /// Update a record value - /// - /// #Params - /// storage_handle: opened storage handle (See open handler) - /// type_: allows to separate different record types collections - /// id: the id of record - /// value: the value of record (pointer to buffer) - /// value_len: the value of record (buffer size) - pub type WalletUpdateRecordValue = extern "C" fn( - storage_handle: StorageHandle, - type_: *const c_char, - id: *const c_char, - value: *const u8, - value_len: usize, - ) -> ErrorCode; - - /// Update a record tags - /// - /// #Params - /// storage_handle: opened storage handle (See open handler) - /// type_: allows to separate different record types collections - /// id: the id of record - /// tags_json: the new record tags used for search and storing meta information as json: - /// { - /// "tagName1": "tag value 1", // string value - /// "tagName2": 123, // numeric value - /// } - /// Note that null means no tags - pub type WalletUpdateRecordTags = extern "C" fn( - storage_handle: StorageHandle, - type_: *const c_char, - id: *const c_char, - tags_json: *const c_char, - ) -> ErrorCode; - - /// Add new tags to the record - /// - /// #Params - /// storage_handle: opened storage handle (See open handler) - /// type_: allows to separate different record types collections - /// id: the id of record - /// tags_json: the additional record tags as json: - /// { - /// "tagName1": "tag value 1", // string value - /// "tagName2": 123, // numeric value, - /// ... - /// } - /// Note that null means no tags - /// Note if some from provided tags already assigned to the record than - /// corresponding tags values will be replaced - pub type WalletAddRecordTags = extern "C" fn( - storage_handle: StorageHandle, - type_: *const c_char, - id: *const c_char, - tags_json: *const c_char, - ) -> ErrorCode; - - /// Delete tags from the record - /// - /// #Params - /// storage_handle: opened storage handle (See open handler) - /// type_: allows to separate different record types collections - /// id: the id of record - /// tag_names_json: the list of tag names to remove from the record as json array: - /// ["tagName1", "tagName2", ...] - /// Note that null means no tag names - pub type WalletDeleteRecordTags = extern "C" fn( - storage_handle: StorageHandle, - type_: *const c_char, - id: *const c_char, - tag_names_json: *const c_char, - ) -> ErrorCode; - - /// Delete an existing record in the wallet storage - /// - /// #Params - /// storage_handle: opened storage handle (See open handler) - /// type_: record type - /// id: the id of record - pub type WalletDeleteRecord = extern "C" fn( - storage_handle: StorageHandle, - type_: *const c_char, - id: *const c_char, - ) -> ErrorCode; - - /// Get an wallet storage record by id - /// - /// #Params - /// storage_handle: opened storage handle (See open handler) - /// type_: allows to separate different record types collections - /// id: the id of record - /// options_json: //TODO: FIXME: Think about replacing by bitmask - /// { - /// retrieveType: (optional, false by default) Retrieve record type, - /// retrieveValue: (optional, true by default) Retrieve record value, - /// retrieveTags: (optional, false by default) Retrieve record tags - /// } - /// record_handle_p: pointer to store retrieved record handle - pub type WalletGetRecord = extern "C" fn( - storage_handle: StorageHandle, - type_: *const c_char, - id: *const c_char, - options_json: *const c_char, - record_handle_p: *mut IndyHandle, - ) -> ErrorCode; - - /// Get an id for retrieved wallet storage record - /// - /// #Params - /// storage_handle: opened storage handle (See open handler) - /// record_handle: retrieved record handle (See get_record handler) - /// - /// returns: record id - /// Note that pointer lifetime the same as retrieved record lifetime - /// (until record_free called) - pub type WalletGetRecordId = extern "C" fn( - storage_handle: StorageHandle, - record_handle: IndyHandle, - record_id_p: *mut *const c_char, - ) -> ErrorCode; - - /// Get an type for retrieved wallet storage record - /// - /// #Params - /// storage_handle: opened storage handle (See open handler) - /// record_handle: retrieved record handle (See get_record handler) - /// - /// returns: record type - /// Note that pointer lifetime the same as retrieved record lifetime - /// (until record_free called) - pub type WalletGetRecordType = extern "C" fn( - storage_handle: StorageHandle, - record_handle: IndyHandle, - record_type_p: *mut *const c_char, - ) -> ErrorCode; - - /// Get an value for retrieved wallet storage record - /// - /// #Params - /// storage_handle: opened storage handle (See open handler) - /// record_handle: retrieved record handle (See get_record handler) - /// - /// returns: record value - /// Note that pointer lifetime the same as retrieved record lifetime - /// (until record_free called) - /// Note that null be returned if no value retrieved - pub type WalletGetRecordValue = extern "C" fn( - storage_handle: StorageHandle, - record_handle: IndyHandle, - record_value_p: *mut *const u8, - record_value_len_p: *mut usize, - ) -> ErrorCode; - - /// Get an tags for retrieved wallet record - /// - /// #Params - /// storage_handle: opened storage handle (See open handler) - /// record_handle: retrieved record handle (See get_record handler) - /// - /// returns: record tags as json - /// Note that pointer lifetime the same as retrieved record lifetime - /// (until record_free called) - /// Note that null be returned if no tags retrieved - pub type WalletGetRecordTags = extern "C" fn( - storage_handle: StorageHandle, - record_handle: IndyHandle, - record_tags_p: *mut *const c_char, - ) -> ErrorCode; - - /// Free retrieved wallet record (make retrieved record handle invalid) - /// - /// #Params - /// storage_handle: opened storage handle (See open_wallet_storage) - /// record_handle: retrieved record handle (See wallet_storage_get_wallet_record) - pub type WalletFreeRecord = - extern "C" fn(storage_handle: StorageHandle, record_handle: IndyHandle) -> ErrorCode; - - /// Get storage metadata - /// - /// #Params - /// storage_handle: opened storage handle (See open handler) - /// - /// returns: metadata as base64 value - /// Note that pointer lifetime is static - pub type WalletGetStorageMetadata = extern "C" fn( - storage_handle: StorageHandle, - metadata_p: *mut *const c_char, - metadata_handle: *mut IndyHandle, - ) -> ErrorCode; - - /// Set storage metadata - /// - /// #Params - /// storage_handle: opened storage handle (See open handler) - /// metadata_p: base64 value of metadata - /// - /// Note if storage already have metadata record it will be overwritten. - pub type WalletSetStorageMetadata = - extern "C" fn(storage_handle: StorageHandle, metadata_p: *const c_char) -> ErrorCode; - - /// Free retrieved storage metadata record (make retrieved storage metadata handle invalid) - /// - /// #Params - /// storage_handle: opened storage handle (See open_wallet_storage) - /// metadata_handle: retrieved record handle (See wallet_storage_get_storage_metadata) - pub type WalletFreeStorageMetadata = - extern "C" fn(storage_handle: StorageHandle, metadata_handle: IndyHandle) -> ErrorCode; - - /// Search for wallet storage records - /// - /// #Params - /// storage_handle: opened storage handle (See open handler) - /// type_: allows to separate different record types collections - /// query_json: MongoDB style query to wallet record tags: - /// { - /// "tagName": "tagValue", - /// $or: { - /// "tagName2": { $regex: 'pattern' }, - /// "tagName3": { $gte: 123 }, - /// }, - /// } - /// options_json: //TODO: FIXME: Think about replacing by bitmask - /// { - /// retrieveRecords: (optional, true by default) If false only "counts" will be calculated, - /// retrieveTotalCount: (optional, false by default) Calculate total count, - /// retrieveType: (optional, false by default) Retrieve record type, - /// retrieveValue: (optional, true by default) Retrieve record value, - /// retrieveTags: (optional, false by default) Retrieve record tags, - /// } - /// search_handle_p: pointer to store wallet search handle - pub type WalletSearchRecords = extern "C" fn( - storage_handle: StorageHandle, - type_: *const c_char, - query_json: *const c_char, - options_json: *const c_char, - search_handle_p: *mut i32, - ) -> ErrorCode; - - /// Search for all wallet storage records - /// - /// #Params - /// storage_handle: opened storage handle (See open handler) - /// search_handle_p: pointer to store wallet search handle - pub type WalletSearchAllRecords = - extern "C" fn(storage_handle: StorageHandle, search_handle_p: *mut i32) -> ErrorCode; - - /// Get total count of records that corresponds to wallet storage search query - /// - /// #Params - /// storage_handle: opened storage handle (See open handler) - /// search_handle: wallet search handle (See search_records handler) - /// - /// returns: total count of records that corresponds to wallet storage search query - /// Note -1 will be returned if retrieveTotalCount set to false for search_records - pub type WalletGetSearchTotalCount = extern "C" fn( - storage_handle: StorageHandle, - search_handle: i32, - total_count_p: *mut usize, - ) -> ErrorCode; - - /// Get the next wallet storage record handle retrieved by this wallet search. - /// - /// #Params - /// storage_handle: opened storage handle (See open handler) - /// search_handle: wallet search handle (See search_records handler) - /// - /// returns: record handle (the same as for get_record handler) - /// Note if no more records WalletNoRecords error will be returned - pub type WalletFetchSearchNextRecord = extern "C" fn( - storage_handle: StorageHandle, - search_handle: i32, - record_handle_p: *mut IndyHandle, - ) -> ErrorCode; - - /// Free wallet search (make search handle invalid) - /// - /// #Params - /// storage_handle: opened storage handle (See open handler) - /// search_handle: wallet search handle (See search_records handler) - pub type WalletFreeSearch = - extern "C" fn(storage_handle: StorageHandle, search_handle: i32) -> ErrorCode; -} From 948827beafe8aef89c96a2564890c89ccbf38654 Mon Sep 17 00:00:00 2001 From: Patrik Stas Date: Tue, 11 Apr 2023 12:38:28 +0200 Subject: [PATCH 3/5] vdrtools: remove commented tests Signed-off-by: Patrik Stas --- libvdrtools/src/services/pool/mod.rs | 43 ---------------------------- 1 file changed, 43 deletions(-) diff --git a/libvdrtools/src/services/pool/mod.rs b/libvdrtools/src/services/pool/mod.rs index fb1c5a27a3..3f97359253 100644 --- a/libvdrtools/src/services/pool/mod.rs +++ b/libvdrtools/src/services/pool/mod.rs @@ -827,49 +827,6 @@ pub mod tests { let res = block_on(ps.refresh(INVALID_POOL_HANDLE)); assert_eq!(IndyErrorKind::InvalidPoolHandle, res.unwrap_err().kind()); } - - // FIXME: - // #[test] - // fn pool_register_sp_parser_works() { - // test::cleanup_storage("pool_register_sp_parser_works"); - // REGISTERED_SP_PARSERS.lock().unwrap().clear(); - // extern "C" fn test_sp( - // _reply_from_node: *const c_char, - // _parsed_sp: *mut *const c_char, - // ) -> ErrorCode { - // ErrorCode::Success - // } - // extern "C" fn test_free(_data: *const c_char) -> ErrorCode { - // ErrorCode::Success - // } - // PoolService::register_sp_parser("test", test_sp, test_free).unwrap(); - // } - - // FIMXE: - // #[test] - // fn pool_get_sp_parser_works() { - // test::cleanup_storage("pool_get_sp_parser_works"); - // REGISTERED_SP_PARSERS.lock().unwrap().clear(); - // extern "C" fn test_sp( - // _reply_from_node: *const c_char, - // _parsed_sp: *mut *const c_char, - // ) -> ErrorCode { - // ErrorCode::Success - // } - // extern "C" fn test_free(_data: *const c_char) -> ErrorCode { - // ErrorCode::Success - // } - // PoolService::register_sp_parser("test", test_sp, test_free).unwrap(); - // PoolService::get_sp_parser("test").unwrap(); - // } - - // FIXME: - // #[test] - // fn pool_get_sp_parser_works_for_invalid_name() { - // test::cleanup_storage("pool_get_sp_parser_works_for_invalid_name"); - // REGISTERED_SP_PARSERS.lock().unwrap().clear(); - // assert_eq!(None, PoolService::get_sp_parser("test")); - // } } #[async_std::test] From 288217c516272858db90441ad509b3bd9bcc3257 Mon Sep 17 00:00:00 2001 From: Patrik Stas Date: Tue, 11 Apr 2023 12:38:47 +0200 Subject: [PATCH 4/5] vdrtools: Remove unused dependencies Signed-off-by: Patrik Stas --- libvdrtools/Cargo.toml | 10 ---------- libvdrtools/indy-wallet/Cargo.toml | 7 ------- libvdrtools/src/lib.rs | 2 -- libvdrtools/src/utils/logger.rs | 6 ------ 4 files changed, 25 deletions(-) diff --git a/libvdrtools/Cargo.toml b/libvdrtools/Cargo.toml index 925a27f097..baf18841dc 100644 --- a/libvdrtools/Cargo.toml +++ b/libvdrtools/Cargo.toml @@ -28,8 +28,6 @@ fatal_warnings = [] [dependencies] async-std = "1.8.0" async-trait = "0.1.42" -cfg-if = "1.0.0" -etcommon-rlp = "0.2.4" failure = { version = "0.1.8", features = ["backtrace"] } hex = "0.4.0" libc = "0.2.114" @@ -47,24 +45,16 @@ time = "0.1.44" zmq = "0.9.2" lazy_static = "1.3" byteorder = "1.3.2" -log-panics = "2.0.0" zeroize = "~1.3.0" regex = "1.2.1" indy-api-types = { path = "./indy-api-types"} indy-utils = { path = "./indy-utils"} indy-wallet = { path = "./indy-wallet"} -variant_count = "*" num-traits = "0.2" num-derive = "0.3" -convert_case = "0.3.2" futures = { version = "0.3", default-features = false, features = [ "executor", "alloc" ] } uuid = { version = "0.8", default-features = false, features = ["v4"] } ursa = { version = "0.3.7", optional = true} -[target.'cfg(target_os = "android")'.dependencies] -android_logger = "0.5" - [dev-dependencies] -criterion = "0.2" dirs = "2.0.2" -rstest = "0.6.4" diff --git a/libvdrtools/indy-wallet/Cargo.toml b/libvdrtools/indy-wallet/Cargo.toml index b5fe8abb15..b9035a89f1 100644 --- a/libvdrtools/indy-wallet/Cargo.toml +++ b/libvdrtools/indy-wallet/Cargo.toml @@ -27,10 +27,3 @@ serde_derive = "1.0.99" sqlx = { version = "0.5.8", git = "https://github.com/jovfer/sqlx", branch = "feature/json_no_preserve_order_v5", features = [ "sqlite", "mysql", "json_no_preserve_order", "runtime-tokio-rustls" ] } zeroize = "~1.3.0" lru = "0.7.6" - -[dev-dependencies] -rand = "0.7.0" -lazy_static = "1.3" - -# [target.'cfg(any(target_os = "android", target_os = "ios"))'.dependencies] -# rusqlite = { version = "0.20", features=["bundled"] } diff --git a/libvdrtools/src/lib.rs b/libvdrtools/src/lib.rs index aa0c9e94f0..92eed40dc0 100644 --- a/libvdrtools/src/lib.rs +++ b/libvdrtools/src/lib.rs @@ -3,8 +3,6 @@ #[macro_use] extern crate log; -extern crate variant_count; - #[macro_use] extern crate num_derive; diff --git a/libvdrtools/src/utils/logger.rs b/libvdrtools/src/utils/logger.rs index 9e3138df37..e1fb77db9e 100644 --- a/libvdrtools/src/utils/logger.rs +++ b/libvdrtools/src/utils/logger.rs @@ -1,9 +1,3 @@ -#[cfg(target_os = "android")] -extern crate android_logger; - -#[cfg(target_os = "android")] -use self::android_logger::Filter; - #[macro_export] macro_rules! try_log { ($expr:expr) => { From a70b5e8d4f7650da4bdfed23380074b4f6fc1aa8 Mon Sep 17 00:00:00 2001 From: Patrik Stas Date: Tue, 11 Apr 2023 12:48:13 +0200 Subject: [PATCH 5/5] Revert removal or rlp dependency, removed legacy wallet plugin functions Signed-off-by: Patrik Stas --- Cargo.lock | 239 +------------------------- libvdrtools/Cargo.toml | 1 + libvdrtools/indy-wallet/src/lib.rs | 56 ------ libvdrtools/src/controllers/wallet.rs | 93 ---------- 4 files changed, 7 insertions(+), 382 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 536af75de0..d875781ded 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -585,18 +585,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" -[[package]] -name = "bstr" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" -dependencies = [ - "lazy_static", - "memchr", - "regex-automata", - "serde", -] - [[package]] name = "bumpalo" version = "3.11.1" @@ -656,21 +644,12 @@ checksum = "08a1ec454bc3eead8719cb56e15dbbfecdbc14e4b3a3ae4936cc6e31f5fc0d07" dependencies = [ "camino", "cargo-platform", - "semver 1.0.16", + "semver", "serde", "serde_json", "thiserror", ] -[[package]] -name = "cast" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c24dab4283a142afa2fdca129b80ad2c6284e073930f964c3a1293c225ee39a" -dependencies = [ - "rustc_version 0.4.0", -] - [[package]] name = "cc" version = "1.0.77" @@ -746,17 +725,6 @@ dependencies = [ "generic-array 0.14.6", ] -[[package]] -name = "clap" -version = "2.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" -dependencies = [ - "bitflags", - "textwrap 0.11.0", - "unicode-width", -] - [[package]] name = "clap" version = "3.2.23" @@ -771,7 +739,7 @@ dependencies = [ "once_cell", "strsim 0.10.0", "termcolor", - "textwrap 0.16.0", + "textwrap", ] [[package]] @@ -830,12 +798,6 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d6f2aa4d0537bcc1c74df8755072bd31c1ef1a3a1b85a68e8404a8c353b7b8b" -[[package]] -name = "convert_case" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e1f025f441cdfb75831bec89b9d6a6ed02e5e763f78fc5e1ff30d4870fefaec" - [[package]] name = "convert_case" version = "0.4.0" @@ -897,44 +859,6 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccaeedb56da03b09f598226e25e80088cb4cd25f316e6e4df7d695f0feeb1403" -[[package]] -name = "criterion" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0363053954f3e679645fc443321ca128b7b950a6fe288cf5f9335cc22ee58394" -dependencies = [ - "atty", - "cast", - "clap 2.34.0", - "criterion-plot", - "csv", - "itertools 0.8.2", - "lazy_static", - "libc", - "num-traits", - "rand_core 0.3.1", - "rand_os", - "rand_xoshiro", - "rayon", - "rayon-core", - "serde", - "serde_derive", - "serde_json", - "tinytemplate", - "walkdir", -] - -[[package]] -name = "criterion-plot" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76f9212ddf2f4a9eb2d401635190600656a1f88a932ef53d06e7fa4c7e02fb8e" -dependencies = [ - "byteorder", - "cast", - "itertools 0.8.2", -] - [[package]] name = "crossbeam-channel" version = "0.5.6" @@ -1030,28 +954,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "csv" -version = "1.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22813a6dc45b335f9bade10bf7271dc477e81113e89eb251a0bc2a8a81c536e1" -dependencies = [ - "bstr", - "csv-core", - "itoa 0.4.8", - "ryu", - "serde", -] - -[[package]] -name = "csv-core" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" -dependencies = [ - "memchr", -] - [[package]] name = "ctor" version = "0.1.26" @@ -1314,7 +1216,7 @@ dependencies = [ "convert_case 0.4.0", "proc-macro2", "quote", - "rustc_version 0.4.0", + "rustc_version", "syn", ] @@ -2222,11 +2124,9 @@ dependencies = [ "futures", "indy-api-types", "indy-utils 0.1.0", - "lazy_static", "libc", "log", "lru", - "rand 0.7.3", "rmp-serde", "serde", "serde_derive", @@ -2284,15 +2184,6 @@ dependencies = [ "phf", ] -[[package]] -name = "itertools" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.10.5" @@ -2463,14 +2354,10 @@ dependencies = [ name = "libvdrtools" version = "0.8.6" dependencies = [ - "android_logger", "async-std", "async-trait", "bs58 0.4.0", "byteorder", - "cfg-if 1.0.0", - "convert_case 0.3.2", - "criterion", "dirs", "etcommon-rlp", "failure", @@ -2483,13 +2370,11 @@ dependencies = [ "libc", "log", "log-derive", - "log-panics", "num-derive", "num-traits", "rand 0.8.5", "regex", "rmp-serde", - "rstest", "serde", "serde_derive", "serde_json", @@ -2498,7 +2383,6 @@ dependencies = [ "time", "ursa", "uuid 0.8.2", - "variant_count", "zeroize", "zmq", ] @@ -2545,15 +2429,6 @@ dependencies = [ "syn", ] -[[package]] -name = "log-panics" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f9dd8546191c1850ecf67d22f5ff00a935b890d0e84713159a55495cc2ac5f" -dependencies = [ - "log", -] - [[package]] name = "lru" version = "0.7.8" @@ -3336,16 +3211,6 @@ dependencies = [ "rand_core 0.3.1", ] -[[package]] -name = "rand_xoshiro" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b418169fb9c46533f326efd6eed2576699c44ca92d3052a066214a8d828929" -dependencies = [ - "byteorder", - "rand_core 0.3.1", -] - [[package]] name = "rayon" version = "1.6.0" @@ -3409,12 +3274,6 @@ dependencies = [ "regex-syntax", ] -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" - [[package]] name = "regex-syntax" version = "0.6.28" @@ -3544,41 +3403,19 @@ dependencies = [ "zeroize", ] -[[package]] -name = "rstest" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dec448bc157977efdc0a71369cf923915b0c4806b1b2449c3fb011071d6f7c38" -dependencies = [ - "cfg-if 0.1.10", - "proc-macro2", - "quote", - "rustc_version 0.2.3", - "syn", -] - [[package]] name = "rustc-demangle" version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver 0.9.0", -] - [[package]] name = "rustc_version" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.16", + "semver", ] [[package]] @@ -3606,15 +3443,6 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - [[package]] name = "schannel" version = "0.1.20" @@ -3710,15 +3538,6 @@ dependencies = [ "libc", ] -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - [[package]] name = "semver" version = "1.0.16" @@ -3728,12 +3547,6 @@ dependencies = [ "serde", ] -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - [[package]] name = "serde" version = "1.0.149" @@ -3953,7 +3766,7 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4b7922be017ee70900be125523f38bdd644f4f06a1b16e8fa5a8ee8c34bffd4" dependencies = [ - "itertools 0.10.5", + "itertools", "nom", "unicode_categories", ] @@ -4262,15 +4075,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "textwrap" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -dependencies = [ - "unicode-width", -] - [[package]] name = "textwrap" version = "0.16.0" @@ -4317,16 +4121,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "tinytemplate" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" -dependencies = [ - "serde", - "serde_json", -] - [[package]] name = "tinyvec" version = "1.6.0" @@ -4543,7 +4337,7 @@ checksum = "f71cc01459bc34cfe43fabf32b39f1228709bc6db1b3a664a92940af3d062376" dependencies = [ "anyhow", "camino", - "clap 3.2.23", + "clap", "uniffi_bindgen", "uniffi_build", "uniffi_core", @@ -4770,16 +4564,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "variant_count" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aae2faf80ac463422992abf4de234731279c058aaf33171ca70277c98406b124" -dependencies = [ - "quote", - "syn", -] - [[package]] name = "vcpkg" version = "0.2.15" @@ -4809,17 +4593,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" -[[package]] -name = "walkdir" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" -dependencies = [ - "same-file", - "winapi", - "winapi-util", -] - [[package]] name = "want" version = "0.3.0" diff --git a/libvdrtools/Cargo.toml b/libvdrtools/Cargo.toml index baf18841dc..3107736beb 100644 --- a/libvdrtools/Cargo.toml +++ b/libvdrtools/Cargo.toml @@ -28,6 +28,7 @@ fatal_warnings = [] [dependencies] async-std = "1.8.0" async-trait = "0.1.42" +etcommon-rlp = "0.2.4" failure = { version = "0.1.8", features = ["backtrace"] } hex = "0.4.0" libc = "0.2.114" diff --git a/libvdrtools/indy-wallet/src/lib.rs b/libvdrtools/indy-wallet/src/lib.rs index 705c427b8d..6a3108081a 100644 --- a/libvdrtools/indy-wallet/src/lib.rs +++ b/libvdrtools/indy-wallet/src/lib.rs @@ -13,7 +13,6 @@ use std::{ use indy_api_types::{ domain::wallet::{Config, Credentials, ExportConfig, Tags}, errors::prelude::*, - wallet::*, WalletHandle, }; use indy_utils::{ @@ -36,8 +35,6 @@ use crate::{ }; use indy_api_types::domain::wallet::CacheConfig; -//use crate::storage::plugged::PluggedStorageType; FXIME: - mod encryption; mod iterator; mod query_encryption; @@ -102,59 +99,6 @@ impl WalletService { } } - pub fn register_wallet_storage( - &self, - type_: &str, - _create: WalletCreate, - _open: WalletOpen, - _close: WalletClose, - _delete: WalletDelete, - _add_record: WalletAddRecord, - _update_record_value: WalletUpdateRecordValue, - _update_record_tags: WalletUpdateRecordTags, - _add_record_tags: WalletAddRecordTags, - _delete_record_tags: WalletDeleteRecordTags, - _delete_record: WalletDeleteRecord, - _get_record: WalletGetRecord, - _get_record_id: WalletGetRecordId, - _get_record_type: WalletGetRecordType, - _get_record_value: WalletGetRecordValue, - _get_record_tags: WalletGetRecordTags, - _free_record: WalletFreeRecord, - _get_storage_metadata: WalletGetStorageMetadata, - _set_storage_metadata: WalletSetStorageMetadata, - _free_storage_metadata: WalletFreeStorageMetadata, - _search_records: WalletSearchRecords, - _search_all_records: WalletSearchAllRecords, - _get_search_total_count: WalletGetSearchTotalCount, - _fetch_search_next_record: WalletFetchSearchNextRecord, - _free_search: WalletFreeSearch, - ) -> IndyResult<()> { - trace!("register_wallet_storage >>> type_: {:?}", type_); - Ok(()) // FIXME: !!! - - // let mut storage_types = self.storage_types.lock().await; - - // if storage_types.contains_key(type_) { - // return Err(err_msg(IndyErrorKind::WalletStorageTypeAlreadyRegistered, format!("Wallet storage is already registered for type: {}", type_))); - // } - - // storage_types.insert(type_.to_string(), - // Box::new( - // PluggedStorageType::new(create, open, close, delete, - // add_record, update_record_value, - // update_record_tags, add_record_tags, delete_record_tags, - // delete_record, get_record, get_record_id, - // get_record_type, get_record_value, get_record_tags, free_record, - // get_storage_metadata, set_storage_metadata, free_storage_metadata, - // search_records, search_all_records, - // get_search_total_count, - // fetch_search_next_record, free_search))); - - // trace!("register_wallet_storage <<<"); - // Ok(()) - } - pub async fn create_wallet( &self, config: &Config, diff --git a/libvdrtools/src/controllers/wallet.rs b/libvdrtools/src/controllers/wallet.rs index 8b5ed0d66d..4f608ef6b5 100644 --- a/libvdrtools/src/controllers/wallet.rs +++ b/libvdrtools/src/controllers/wallet.rs @@ -5,7 +5,6 @@ use std::sync::Arc; use indy_api_types::{ domain::wallet::{Config, Credentials, ExportConfig, KeyConfig}, errors::prelude::*, - wallet::*, WalletHandle, }; @@ -34,98 +33,6 @@ impl WalletController { } } - /// Register custom wallet storage implementation. - /// - /// #Params - - /// type_: Storage type name. - /// create: WalletType create operation handler - /// open: WalletType open operation handler - /// close: Wallet close operation handler - /// delete: WalletType delete operation handler - /// add_record: WalletType add record operation handler - /// update_record_value: WalletType update record value operation handler - /// update_record_tags: WalletType update record tags operation handler - /// add_record_tags: WalletType add record tags operation handler - /// delete_record_tags: WalletType delete record tags operation handler - /// delete_record: WalletType delete record operation handler - /// get_record: WalletType get record operation handler - /// get_record_id: WalletType get record id operation handler - /// get_record_type: WalletType get record type operation handler - /// get_record_value: WalletType get record value operation handler - /// get_record_tags: WalletType get record tags operation handler - /// free_record: WalletType free record operation handler - /// search_records: WalletType search records operation handler - /// search_all_records: WalletType search all records operation handler - /// get_search_total_count: WalletType get search total count operation handler - /// fetch_search_next_record: WalletType fetch search next record operation handler - /// free_search: WalletType free search operation handler - /// free: Handler that allows to de-allocate strings allocated in caller code - /// - /// #Returns - /// Error code - pub fn register_type( - &self, - type_: String, - create: WalletCreate, - open: WalletOpen, - close: WalletClose, - delete: WalletDelete, - add_record: WalletAddRecord, - update_record_value: WalletUpdateRecordValue, - update_record_tags: WalletUpdateRecordTags, - add_record_tags: WalletAddRecordTags, - delete_record_tags: WalletDeleteRecordTags, - delete_record: WalletDeleteRecord, - get_record: WalletGetRecord, - get_record_id: WalletGetRecordId, - get_record_type: WalletGetRecordType, - get_record_value: WalletGetRecordValue, - get_record_tags: WalletGetRecordTags, - free_record: WalletFreeRecord, - get_storage_metadata: WalletGetStorageMetadata, - set_storage_metadata: WalletSetStorageMetadata, - free_storage_metadata: WalletFreeStorageMetadata, - search_records: WalletSearchRecords, - search_all_records: WalletSearchAllRecords, - get_search_total_count: WalletGetSearchTotalCount, - fetch_search_next_record: WalletFetchSearchNextRecord, - free_search: WalletFreeSearch, - ) -> IndyResult<()> { - trace!("register_type > type_: {:?}", type_); - - self.wallet_service.register_wallet_storage( - &type_, - create, - open, - close, - delete, - add_record, - update_record_value, - update_record_tags, - add_record_tags, - delete_record_tags, - delete_record, - get_record, - get_record_id, - get_record_type, - get_record_value, - get_record_tags, - free_record, - get_storage_metadata, - set_storage_metadata, - free_storage_metadata, - search_records, - search_all_records, - get_search_total_count, - fetch_search_next_record, - free_search, - )?; - - trace!("register_type < res: ()"); - Ok(()) - } - /// Create a new secure wallet. /// /// #Params