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
61bd1a4a60
commit
8f83b7d188
@ -10,6 +10,9 @@ name = "aqua-dht"
|
|||||||
path = "src/main.rs"
|
path = "src/main.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
fluence = "0.5.0"
|
fluence = "0.6.1"
|
||||||
fce-sqlite-connector = "0.3.0"
|
fce-sqlite-connector = "0.4.0"
|
||||||
fstrings = "0.2.3"
|
fstrings = "0.2.3"
|
||||||
|
|
||||||
|
[dev-dependencies]
|
||||||
|
fluence-test = "0.1.2"
|
2
build.sh
2
build.sh
@ -7,4 +7,4 @@ fce build --release
|
|||||||
rm -f artifacts/*
|
rm -f artifacts/*
|
||||||
mkdir -p artifacts
|
mkdir -p artifacts
|
||||||
cp target/wasm32-wasi/release/aqua-dht.wasm artifacts/
|
cp target/wasm32-wasi/release/aqua-dht.wasm artifacts/
|
||||||
curl -L https://github.com/fluencelabs/sqlite/releases/download/v0.10.0_w/sqlite3.wasm -o artifacts/sqlite3.wasm
|
curl -L https://github.com/fluencelabs/sqlite/releases/download/v0.14.0_w/sqlite3.wasm -o artifacts/sqlite3.wasm
|
||||||
|
12
src/main.rs
12
src/main.rs
@ -20,7 +20,6 @@ use crate::results::{Record, GetValueResult, PutValueResult, ClearExpiredResult,
|
|||||||
|
|
||||||
use fluence::fce;
|
use fluence::fce;
|
||||||
use fluence::module_manifest;
|
use fluence::module_manifest;
|
||||||
|
|
||||||
use fce_sqlite_connector;
|
use fce_sqlite_connector;
|
||||||
use fce_sqlite_connector::{Connection, Result as SqliteResult, Error as SqliteError, State};
|
use fce_sqlite_connector::{Connection, Result as SqliteResult, Error as SqliteError, State};
|
||||||
|
|
||||||
@ -131,3 +130,14 @@ pub fn get_stale_records(current_timestamp: u64) -> GetStaleRecordsResult {
|
|||||||
|
|
||||||
get_stale_records_impl(current_timestamp).into()
|
get_stale_records_impl(current_timestamp).into()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use fluence_test::fce_test;
|
||||||
|
|
||||||
|
#[fce_test(config_path = "Config.toml", modules_dir = "artifacts")]
|
||||||
|
fn test() {
|
||||||
|
let result = aqua - dht.get_value("key3");
|
||||||
|
assert(!result.success);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user