mirror of
https://github.com/fluencelabs/examples
synced 2025-04-24 10:12:16 +00:00
update tests, bump version
This commit is contained in:
parent
5add429180
commit
125e838ba5
@ -11,12 +11,11 @@ name = "ts_oracle"
|
||||
path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
fluence = { version="0.6.9", features=["logger"]}
|
||||
marine-rs-sdk = { version = "0.6.11", features = ["logger"] }
|
||||
log = "0.4.14"
|
||||
|
||||
|
||||
[dev-dependencies]
|
||||
fluence-test = "0.1.9"
|
||||
marine-rs-sdk-test = "0.2.0"
|
||||
|
||||
[dev]
|
||||
[profile.release]
|
||||
|
@ -1,6 +0,0 @@
|
||||
fldist new_service --ms artifacts/ts_oracle.wasm:artifacts/ts_oracle_cfg.json --name ts-consensus --verbose
|
||||
client seed: 7EbFfPnbjZHBWmkDT5dc5mXfY4ntFxiQ9hwynYxjL1S4
|
||||
client peerId: 12D3KooWAw1obs4xApwechRaz7GEqTA54JLTq8KR7MJwRShjxBaH
|
||||
relay peerId: 12D3KooWHLxVhUQyAuZe6AHMB29P7wkvTNMn7eDMcsqimJYLKREf
|
||||
service id: ed657e45-0fe3-4d6c-b3a4-a2981b7cadb9
|
||||
service created successfully
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"name": "ts_oracle"
|
||||
}
|
@ -13,8 +13,10 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
use fluence::{marine, module_manifest, WasmLoggerBuilder};
|
||||
|
||||
use marine_rs_sdk::marine;
|
||||
use marine_rs_sdk::module_manifest;
|
||||
use marine_rs_sdk::WasmLoggerBuilder;
|
||||
mod stats;
|
||||
|
||||
module_manifest!();
|
||||
@ -66,7 +68,7 @@ pub fn point_estimate(tstamps: Vec<u64>, min_points: u32) -> Oracle {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use fluence_test::marine_test;
|
||||
use marine_rs_sdk_test::marine_test;
|
||||
|
||||
#[test]
|
||||
fn test_mean_good() {
|
||||
@ -92,7 +94,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[marine_test(config_path = "../Config.toml", modules_dir = "../artifacts")]
|
||||
fn test_point_estimate_good() {
|
||||
fn test_point_estimate_good(ts_oracle: marine_test_env::ts_oracle::ModuleInterface) {
|
||||
let data = vec![1u64, 1u64, 3u64, 3u64, 3u64, 5u64];
|
||||
let min_points = 2u32;
|
||||
let res = ts_oracle.point_estimate(data, min_points);
|
||||
@ -101,7 +103,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[marine_test(config_path = "../Config.toml", modules_dir = "../artifacts")]
|
||||
fn test_point_estimate_bad() {
|
||||
fn test_point_estimate_bad(ts_oracle: marine_test_env::ts_oracle::ModuleInterface) {
|
||||
let data = vec![1u64, 1u64, 3u64, 3u64, 3u64, 5u64];
|
||||
let n = data.len();
|
||||
let min_points = 20u32;
|
||||
@ -116,7 +118,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[marine_test(config_path = "../Config.toml", modules_dir = "../artifacts")]
|
||||
fn test_point_estimate_bad_2() {
|
||||
fn test_point_estimate_bad_2(ts_oracle: marine_test_env::ts_oracle::ModuleInterface) {
|
||||
let data = vec![];
|
||||
let n = data.len();
|
||||
let min_points = 0u32;
|
||||
|
Loading…
x
Reference in New Issue
Block a user