mirror of
https://github.com/fluencelabs/registry.git
synced 2025-04-25 10:12:13 +00:00
WIP for Mikhail
This commit is contained in:
parent
f9c62f2e9a
commit
957bf5ba9f
15
Cargo.lock
generated
15
Cargo.lock
generated
@ -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",
|
||||
|
@ -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"
|
||||
|
@ -176,7 +176,7 @@ pub fn republish_values_impl(key: String, records: Vec<Record>, 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}',\
|
||||
|
@ -82,7 +82,7 @@ pub fn republish_values(key: String, records: Vec<Record>, 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()
|
||||
|
@ -226,3 +226,8 @@ impl From<SqliteResult<u64>> for RepublishValuesResult {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// #[marine]
|
||||
// pub struct EvictStaleResult {
|
||||
//
|
||||
// }
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user