From 710700e0ba381d1fc476645ec12f5aa5c8b606b0 Mon Sep 17 00:00:00 2001 From: vms Date: Tue, 29 Dec 2020 14:11:18 +0300 Subject: [PATCH] Move to fluence_it_types from wasmer-wit (#53) --- Cargo.lock | 63 ++++++++++++++++++----------- crates/stepper-interface/Cargo.toml | 4 +- crates/stepper-interface/src/lib.rs | 2 +- stepper-lib/Cargo.toml | 2 +- stepper-lib/src/execution.rs | 2 +- stepper-lib/src/lib.rs | 1 + stepper-lib/src/stepper_outcome.rs | 34 ---------------- stepper/Cargo.toml | 3 +- stepper/src/fce.rs | 2 +- 9 files changed, 47 insertions(+), 66 deletions(-) delete mode 100644 stepper-lib/src/stepper_outcome.rs diff --git a/Cargo.lock b/Cargo.lock index 08aab1ec..e3428948 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -34,9 +34,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68803225a7b13e47191bab76f2687382b60d259e8cf37f6e1893658b84bb9479" +checksum = "ee67c11feeac938fae061b232e38e0b6d94f97a9df10e6271319325ac4c56a86" [[package]] name = "aqua-test-module" @@ -56,13 +56,12 @@ dependencies = [ [[package]] name = "aquamarine" -version = "0.1.3" +version = "0.2.1" dependencies = [ "fluence", "log", "serde", "serde_json", - "stepper-interface 0.1.0", "stepper-lib", "wasm-bindgen", ] @@ -79,7 +78,7 @@ dependencies = [ "parking_lot 0.11.1", "serde", "serde_json", - "stepper-interface 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "stepper-interface 0.1.0", ] [[package]] @@ -506,9 +505,9 @@ dependencies = [ [[package]] name = "ctor" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fbaabec2c953050352311293be5c6aba8e141ba19d6811862b232d6fd020484" +checksum = "373c88d9506e2e9230f6107701b7d8425f4cb3f6df108ec3042a26e936666da5" dependencies = [ "quote", "syn", @@ -597,9 +596,9 @@ dependencies = [ [[package]] name = "erased-serde" -version = "0.3.12" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ca8b296792113e1500fd935ae487be6e00ce318952a6880555554824d6ebf38" +checksum = "0465971a8cc1fa2455c8465aaa377131e1f1cf4983280f474a13e68793aa770c" dependencies = [ "serde", ] @@ -739,6 +738,16 @@ dependencies = [ "wasmer-wasi-fl", ] +[[package]] +name = "fluence-it-types" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b81c770e52b35e2406f8251f6c01b3b882c3eaed3029731d8c19c74dc1b423c" +dependencies = [ + "it-to-bytes", + "serde", +] + [[package]] name = "fluence-sdk-macro" version = "0.2.13" @@ -955,6 +964,12 @@ dependencies = [ "syn", ] +[[package]] +name = "it-to-bytes" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "729c74bb4236418898a219c6d96f14cba77456dd7c04a2e99e65e9c643709b56" + [[package]] name = "itertools" version = "0.9.0" @@ -966,9 +981,9 @@ dependencies = [ [[package]] name = "itoa" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" +checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" [[package]] name = "js-sys" @@ -1608,9 +1623,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.60" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1500e84d27fe482ed1dc791a56eddc2f230046a040fa908c08bda1d9fb615779" +checksum = "4fceb2595057b6891a4ee808f70054bd2d12f0e97f1cbb78689b59f676df325a" dependencies = [ "indexmap", "itoa", @@ -1648,15 +1663,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "stepper-interface" -version = "0.1.0" -dependencies = [ - "fluence", - "serde", - "wasmer-interface-types-fl", -] - [[package]] name = "stepper-interface" version = "0.1.0" @@ -1668,9 +1674,18 @@ dependencies = [ "wasmer-interface-types-fl", ] +[[package]] +name = "stepper-interface" +version = "0.1.1" +dependencies = [ + "fluence", + "fluence-it-types", + "serde", +] + [[package]] name = "stepper-lib" -version = "0.2.0" +version = "0.2.1" dependencies = [ "air-parser", "aqua-test-utils", @@ -1689,7 +1704,7 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "stepper-interface 0.1.0", + "stepper-interface 0.1.1", "wasm-bindgen", ] diff --git a/crates/stepper-interface/Cargo.toml b/crates/stepper-interface/Cargo.toml index 70cf7d85..eaac93e6 100644 --- a/crates/stepper-interface/Cargo.toml +++ b/crates/stepper-interface/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "stepper-interface" description = "Interface of the Aquamarine stepper" -version = "0.1.0" +version = "0.1.1" authors = ["Fluence Labs"] edition = "2018" license = "Apache-2.0" @@ -12,6 +12,6 @@ path = "src/lib.rs" [dependencies] fluence = "=0.2.13" -wasmer-wit = { package = "wasmer-interface-types-fl", version = "=0.17.20" } +fluence-it-types = "0.1.0" serde = "1.0.118" diff --git a/crates/stepper-interface/src/lib.rs b/crates/stepper-interface/src/lib.rs index 394c3be3..8c998ceb 100644 --- a/crates/stepper-interface/src/lib.rs +++ b/crates/stepper-interface/src/lib.rs @@ -16,9 +16,9 @@ use fluence::fce; +use fluence_it_types::IValue; use serde::Deserialize; use serde::Serialize; -use wasmer_wit::values::InterfaceValue as IValue; pub const STEPPER_SUCCESS: i32 = 0; diff --git a/stepper-lib/Cargo.toml b/stepper-lib/Cargo.toml index 318efa8f..d1438162 100644 --- a/stepper-lib/Cargo.toml +++ b/stepper-lib/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "stepper-lib" -version = "0.2.0" +version = "0.2.1" authors = ["Fluence Labs"] edition = "2018" diff --git a/stepper-lib/src/execution.rs b/stepper-lib/src/execution.rs index 45cd38f6..a61866d8 100644 --- a/stepper-lib/src/execution.rs +++ b/stepper-lib/src/execution.rs @@ -23,7 +23,7 @@ use preparation::prepare; use preparation::PrepareResult; use crate::air::ExecutableInstruction; -use stepper_interface::StepperOutcome; +use crate::StepperOutcome; use std::convert::identity; diff --git a/stepper-lib/src/lib.rs b/stepper-lib/src/lib.rs index 88454366..b770006e 100644 --- a/stepper-lib/src/lib.rs +++ b/stepper-lib/src/lib.rs @@ -43,6 +43,7 @@ pub use execution::parse; pub use polyplets::ResolvedTriplet; pub use polyplets::SecurityTetraplet; +pub use stepper_interface::StepperOutcome; pub(crate) type Result = std::result::Result; pub(crate) type JValue = serde_json::Value; diff --git a/stepper-lib/src/stepper_outcome.rs b/stepper-lib/src/stepper_outcome.rs deleted file mode 100644 index 763bcc14..00000000 --- a/stepper-lib/src/stepper_outcome.rs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2020 Fluence Labs Limited - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -use fluence::fce; -use serde::{Deserialize, Serialize}; - -pub const STEPPER_SUCCESS: i32 = 0; - -/// Describes a return value of the stepper. -#[fce] -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct StepperOutcome { - /// A return code, where SUCCESS_ERROR_CODE means success. - pub ret_code: i32, - - /// Contains data if ret_code == 0, otherwise error message (that could be empty string). - pub data: String, - - /// Public keys of peers that should receive data. - pub next_peer_pks: Vec, -} diff --git a/stepper/Cargo.toml b/stepper/Cargo.toml index 11f49bc0..81af3f7a 100644 --- a/stepper/Cargo.toml +++ b/stepper/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aquamarine" -version = "0.1.3" +version = "0.2.1" authors = ["Fluence Labs"] edition = "2018" @@ -15,7 +15,6 @@ path = "src/fce.rs" [dependencies] stepper-lib = { path = "../stepper-lib" } -stepper-interface = { path = "../crates/stepper-interface" } fluence = { version = "=0.2.13", features = ["logger"] } diff --git a/stepper/src/fce.rs b/stepper/src/fce.rs index 822eb8a1..f9afed5f 100644 --- a/stepper/src/fce.rs +++ b/stepper/src/fce.rs @@ -31,8 +31,8 @@ mod logger; use fluence::fce; use logger::DEFAULT_LOG_LEVEL; -use stepper_interface::StepperOutcome; use stepper_lib::execute_aqua; +use stepper_lib::StepperOutcome; use log::Level as LogLevel;