From 15a811484f48b3b43b1e40e801b1f542bfbf763f Mon Sep 17 00:00:00 2001 From: boneyard93501 <4523011+boneyard93501@users.noreply.github.com> Date: Sun, 13 Jun 2021 15:14:18 -0500 Subject: [PATCH] update to marine, marine-test, bump versions --- ether-price-getter/Config.toml | 4 ++-- ether-price-getter/build.sh | 12 +++++------- ether-price-getter/curl_adapter/Cargo.toml | 2 +- ether-price-getter/curl_adapter/src/main.rs | 6 +++--- ether-price-getter/ether_price_getter/Cargo.toml | 2 +- .../ether_price_getter/src/eth_price_getter.rs | 4 ++-- .../ether_price_getter/src/fce_results.rs | 2 +- ether-price-getter/ether_price_getter/src/main.rs | 4 ++-- 8 files changed, 17 insertions(+), 19 deletions(-) diff --git a/ether-price-getter/Config.toml b/ether-price-getter/Config.toml index c23b324..0714412 100644 --- a/ether-price-getter/Config.toml +++ b/ether-price-getter/Config.toml @@ -2,11 +2,11 @@ modules_dir = "artifacts/" [[module]] name = "curl_adapter" - # logger_enabled = false + logger_enabled = true [module.mounted_binaries] curl = "/usr/bin/curl" [[module]] name = "ether_price_getter" - # logger_enabled = true + logger_enabled = true diff --git a/ether-price-getter/build.sh b/ether-price-getter/build.sh index d970168..32f1a33 100755 --- a/ether-price-getter/build.sh +++ b/ether-price-getter/build.sh @@ -1,16 +1,14 @@ #!/usr/bin/env bash set -o errexit -o nounset -o pipefail -mkdir -p artifacts - cd curl_adapter -fce build --release -cd .. - -cd ether_price_getter -fce build --release +marine build --release + +cd ../ether_price_getter +marine build --release cd .. +mkdir -p artifacts rm -f artifacts/*.wasm cp curl_adapter/target/wasm32-wasi/release/curl_adapter.wasm artifacts/ cp ether_price_getter/target/wasm32-wasi/release/ether_price_getter.wasm artifacts/ diff --git a/ether-price-getter/curl_adapter/Cargo.toml b/ether-price-getter/curl_adapter/Cargo.toml index ae2a394..5a4e80c 100644 --- a/ether-price-getter/curl_adapter/Cargo.toml +++ b/ether-price-getter/curl_adapter/Cargo.toml @@ -10,5 +10,5 @@ path = "src/main.rs" name = "curl_adapter" [dependencies] -fluence = { version = "=0.6.2", features = ["logger"]} +fluence = { version = "=0.6.9", features = ["logger"]} log = "0.4.8" diff --git a/ether-price-getter/curl_adapter/src/main.rs b/ether-price-getter/curl_adapter/src/main.rs index 8e8da41..2d6461c 100644 --- a/ether-price-getter/curl_adapter/src/main.rs +++ b/ether-price-getter/curl_adapter/src/main.rs @@ -15,7 +15,7 @@ */ #![allow(improper_ctypes)] -use fluence::fce; +use fluence::marine; use fluence::module_manifest; use fluence::MountedBinaryResult; use fluence::WasmLoggerBuilder; @@ -26,14 +26,14 @@ fn main() { WasmLoggerBuilder::new().build().unwrap(); } -#[fce] +#[marine] pub fn curl_request(curl_cmd: Vec) -> MountedBinaryResult { let response = curl(curl_cmd); response } // mounted_binaries are available to import like this: -#[fce] +#[marine] #[link(wasm_import_module = "host")] extern "C" { pub fn curl(cmd: Vec) -> MountedBinaryResult; diff --git a/ether-price-getter/ether_price_getter/Cargo.toml b/ether-price-getter/ether_price_getter/Cargo.toml index 7e2e966..9751fbd 100644 --- a/ether-price-getter/ether_price_getter/Cargo.toml +++ b/ether-price-getter/ether_price_getter/Cargo.toml @@ -10,6 +10,6 @@ name = "ether_price_getter" path = "src/main.rs" [dependencies] -fluence = { version = "=0.6.2", features = ["logger"]} +fluence = { version = "=0.6.9", features = ["logger"]} log = "0.4.8" fstrings = { version="0.2.3" } diff --git a/ether-price-getter/ether_price_getter/src/eth_price_getter.rs b/ether-price-getter/ether_price_getter/src/eth_price_getter.rs index 3557d25..479c106 100644 --- a/ether-price-getter/ether_price_getter/src/eth_price_getter.rs +++ b/ether-price-getter/ether_price_getter/src/eth_price_getter.rs @@ -15,12 +15,12 @@ */ use crate::curl_request; -use fluence::fce; +use fluence::marine; static URL_LATEST: &'static str = "https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest"; -#[fce] +#[marine] pub fn ether_price_getter(api_key: String, currency_symbol: String) -> String { let curl_args = f!( r#"-H "X-CMC_PRO_API_KEY: {api_key}" -H "Accept: application/json" -d "symbol=ETH&convert={currency_symbol}" -G {URL_LATEST}"# diff --git a/ether-price-getter/ether_price_getter/src/fce_results.rs b/ether-price-getter/ether_price_getter/src/fce_results.rs index 727aa2a..86c257d 100644 --- a/ether-price-getter/ether_price_getter/src/fce_results.rs +++ b/ether-price-getter/ether_price_getter/src/fce_results.rs @@ -16,7 +16,7 @@ use crate::jsonrpc_helpers::JSON_RPC; use crate::Result; -use fluence::fce; +use fluence::marine; use serde_json::Value; #[fce] diff --git a/ether-price-getter/ether_price_getter/src/main.rs b/ether-price-getter/ether_price_getter/src/main.rs index 8c95f68..5295694 100644 --- a/ether-price-getter/ether_price_getter/src/main.rs +++ b/ether-price-getter/ether_price_getter/src/main.rs @@ -24,7 +24,7 @@ #[macro_use] extern crate fstrings; -use fluence::fce; +use fluence::marine; use fluence::module_manifest; use fluence::MountedBinaryResult; use fluence::WasmLoggerBuilder; @@ -40,7 +40,7 @@ pub fn main() { WasmLoggerBuilder::new().build().ok(); } -#[fce] +#[marine] #[link(wasm_import_module = "curl_adapter")] extern "C" { pub fn curl_request(url: Vec) -> MountedBinaryResult;