diff --git a/Cargo.lock b/Cargo.lock index 114639a..c8586ca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -482,9 +482,8 @@ dependencies = [ [[package]] name = "fluence-test" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7be0d7928e5e6a74a8e303b7f539116fdb4043f5788f78e9eaf32c53700c4c18" +version = "0.1.9" +source = "git+https://github.com/fluencelabs/rust-sdk?branch=separate_struct_module#fd2fc07595c5a037c7267cb848b8ea6eb741c735" dependencies = [ "fluence-app-service", "marine-test-macro", @@ -929,9 +928,8 @@ dependencies = [ [[package]] name = "marine-test-macro" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "709eebc4ee6c8e6aa49066ab066c9f137d9cf164f298f578a67bfb11a0508f65" +version = "0.1.9" +source = "git+https://github.com/fluencelabs/rust-sdk?branch=separate_struct_module#fd2fc07595c5a037c7267cb848b8ea6eb741c735" dependencies = [ "marine-test-macro-impl", "proc-macro-error", @@ -942,9 +940,8 @@ dependencies = [ [[package]] name = "marine-test-macro-impl" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2432fd5233a088981c79324668b76f3ee2ae6d313d4522b5490226e5e7827ce" +version = "0.1.9" +source = "git+https://github.com/fluencelabs/rust-sdk?branch=separate_struct_module#fd2fc07595c5a037c7267cb848b8ea6eb741c735" dependencies = [ "darling", "fluence-app-service", diff --git a/Cargo.toml b/Cargo.toml index 4a4f3c4..8b12c5b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,5 +16,5 @@ fstrings = "0.2.3" eyre = "0.6.5" [dev-dependencies] -fluence-test = "0.1.7" +fluence-test = {git ="https://github.com/fluencelabs/rust-sdk", branch = "separate_struct_module"} rusqlite = "0.25.1" diff --git a/src/impls.rs b/src/impls.rs index 019a077..d50ccdc 100644 --- a/src/impls.rs +++ b/src/impls.rs @@ -176,7 +176,7 @@ pub fn republish_values_impl(key: String, records: Vec, current_timestam let _key = get_key_metadata_helper(&connection, key.clone())?; let mut updated = 0u64; - for record in records { + for record in records.iter() { connection.execute( f!("INSERT OR REPLACE INTO {VALUES_TABLE_NAME} \ VALUES ('{key}', '{record.value}', '{record.peer_id}', '{record.relay_id}',\ diff --git a/src/main.rs b/src/main.rs index 096de2a..31d27f3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -82,7 +82,7 @@ pub fn republish_values(key: String, records: Vec, current_timestamp: u6 pub fn clear_expired(current_timestamp: u64) -> ClearExpiredResult { clear_expired_impl(current_timestamp).into() } -// + // #[marine] // pub fn evict_stale(current_timestamp: u64) -> GetStaleResult { // evict_stale_impl(current_timestamp).into() diff --git a/src/results.rs b/src/results.rs index 0a9904c..c321c8c 100644 --- a/src/results.rs +++ b/src/results.rs @@ -226,3 +226,8 @@ impl From> for RepublishValuesResult { } } } + +// #[marine] +// pub struct EvictStaleResult { +// +// } diff --git a/src/tests.rs b/src/tests.rs index f2f9157..8381ee3 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -162,12 +162,13 @@ mod tests { #[marine_test(config_path = "../Config.toml", modules_dir = "../artifacts/")] fn republish_key_not_exists() { clear_db(); - let key = __m_generated_aqua_dht::Key { + let key = aqua_dht_structs::Key { key: "some_key".to_string(), peer_id: "some_peer".to_string(), timestamp_created: 0, }; + println!("{:?}", key); republish_key_and_check!(aqua_dht, key, 123u64, get_correct_timestamp_cp(1)); }