From 1bbcac7c6874129607e0ba1cffd10d7cc7c97f72 Mon Sep 17 00:00:00 2001 From: Kevin Gislason Date: Wed, 22 Dec 2021 03:10:45 -0600 Subject: [PATCH 1/4] add versioni --- Cargo.toml | 4 ++-- src/service.rs | 29 +++++++++++++++++++++-------- ui/public/about.html | 20 ++++++++++++++------ ui/src-tauri/Cargo.lock | 6 +++--- ui/src-tauri/Cargo.toml | 2 +- ui/src-tauri/tauri.conf.json | 6 +++--- 6 files changed, 44 insertions(+), 23 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0ae92f52..644646ad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "manta-signer" edition = "2018" -version = "0.4.1" +version = "0.5.0" authors = ["Manta Network "] readme = "README.md" license-file = "LICENSE" @@ -40,7 +40,7 @@ derivative = { version = "2.2.0", default-features = false, features = ["use_cor dirs-next = { version = "2.0.0" } futures = { version = "0.3.17", default-features = false } http-types = { version = "2.12.0", default-features = false } -manta-api = { git = "https://github.com/Manta-Network/manta-api", branch = "manta", default-features = false, features = ["signer", "testnet"] } +manta-api = { git = "https://github.com/Manta-Network/manta-api", branch = "incremental_refresh", default-features = false, features = ["signer", "testnet"] } manta-asset = { git = "https://github.com/Manta-Network/manta-types", branch = "manta" } manta-crypto = { git = "https://github.com/Manta-Network/manta-crypto", branch = "manta" } manta-data = { git = "https://github.com/Manta-Network/manta-types", branch = "manta" } diff --git a/src/service.rs b/src/service.rs index 0e9c5870..b4984f03 100644 --- a/src/service.rs +++ b/src/service.rs @@ -318,7 +318,7 @@ where .allow_credentials(false); let mut server = Server::with_state(State::new(config, authorizer)); server.with(cors); - server.at("/heartbeat").get(Self::heartbeat); + server.at("/version").get(Self::version); server.at("/recoverAccount").post(Self::recover_account); server .at("/deriveShieldedAddress") @@ -366,12 +366,12 @@ where self.0.state() } - /// Sends a heartbeat to the client. + /// Sends version to the client. #[inline] - async fn heartbeat(request: Request) -> ServerResult { - Self::log(String::from("HEARTBEAT")).await?; + async fn version(request: Request) -> ServerResult { + Self::log(String::from("VERSION")).await?; let _ = request; - Ok(String::from("heartbeat")) + Ok(Body::from_json(&VersionMessage::default())?.into()) } /// Runs an account recovery for the given `request`. @@ -499,6 +499,20 @@ where } } +/// Version Message +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct VersionMessage { + /// Version + pub version: &'static str, +} + +impl Default for VersionMessage { + /// Builds a default [`VersionMessage`]. + fn default() -> Self { + Self { version: VERSION } + } +} + /// Shielded Address Message #[derive(Clone, Debug, Deserialize, Serialize)] pub struct ShieldedAddressMessage { @@ -506,7 +520,7 @@ pub struct ShieldedAddressMessage { pub address: Vec, /// Version - pub version: String, + pub version: &'static str, } impl ShieldedAddressMessage { @@ -515,11 +529,10 @@ impl ShieldedAddressMessage { pub fn new(address: Vec) -> Self { Self { address, - version: "0.0.0".into(), + version: VERSION, } } } - /// Recover Account Message #[derive(Clone, Debug, Deserialize, Serialize)] pub struct RecoverAccountMessage { diff --git a/ui/public/about.html b/ui/public/about.html index 07dba783..58df212d 100644 --- a/ui/public/about.html +++ b/ui/public/about.html @@ -1,5 +1,6 @@ + @@ -15,29 +16,36 @@ color: black; font-family: monospace; } + main { text-align: center; margin-top: 3em; } + p { margin: 0.25em; font-size: 0.85em; } + button { margin: 1em; width: 6em; } +

Manta Signer

-

Version 0.4.1

+

Version 0.5.0

Copyright © 2019-2021 Manta Network

-

manta-network/manta-signer

-
-

DOLPHIN TESTNET

+

+ manta-network/manta-signer +

+
+

DOLPHIN TESTNET

- - + + \ No newline at end of file diff --git a/ui/src-tauri/Cargo.lock b/ui/src-tauri/Cargo.lock index 591b4c4a..ca147c50 100644 --- a/ui/src-tauri/Cargo.lock +++ b/ui/src-tauri/Cargo.lock @@ -2694,7 +2694,7 @@ dependencies = [ [[package]] name = "manta-api" version = "0.3.3" -source = "git+https://github.com/Manta-Network/manta-api?branch=manta#bb37de4b7a72c267eaefe458b1060107e46bbf9c" +source = "git+https://github.com/Manta-Network/manta-api?branch=incremental_refresh#45eea96be843675fa667abafc554bcdced2d60de" dependencies = [ "ark-bls12-381", "ark-crypto-primitives", @@ -2796,7 +2796,7 @@ dependencies = [ [[package]] name = "manta-signer" -version = "0.4.1" +version = "0.5.0" dependencies = [ "ark-serialize", "async-std", @@ -2824,7 +2824,7 @@ dependencies = [ [[package]] name = "manta-signer-ui" -version = "0.4.1" +version = "0.5.0" dependencies = [ "async-std", "manta-signer", diff --git a/ui/src-tauri/Cargo.toml b/ui/src-tauri/Cargo.toml index 3c60b72e..73577e24 100644 --- a/ui/src-tauri/Cargo.toml +++ b/ui/src-tauri/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "manta-signer-ui" edition = "2018" -version = "0.4.1" +version = "0.5.0" authors = ["Manta Network "] readme = "README.md" license-file = "LICENSE" diff --git a/ui/src-tauri/tauri.conf.json b/ui/src-tauri/tauri.conf.json index 5f0f8855..f9ba599c 100644 --- a/ui/src-tauri/tauri.conf.json +++ b/ui/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "package": { "productName": "Manta Signer", - "version": "0.4.1" + "version": "0.5.0" }, "build": { "distDir": "../build", @@ -22,7 +22,7 @@ "icons/icon.icns", "icons/icon.ico" ], - "resources": ["*.bin"], + "resources": [], "externalBin": [], "copyright": "Copyright 2019-2021 Manta Network", "category": "DeveloperTool", @@ -87,4 +87,4 @@ "iconAsTemplate": true } } -} +} \ No newline at end of file From cd6455c034a5798d98e28c887fd781fe98ee3bad Mon Sep 17 00:00:00 2001 From: Kevin Gislason Date: Wed, 22 Dec 2021 03:25:57 -0600 Subject: [PATCH 2/4] add back resources --- ui/src-tauri/tauri.conf.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src-tauri/tauri.conf.json b/ui/src-tauri/tauri.conf.json index f9ba599c..3cc94c61 100644 --- a/ui/src-tauri/tauri.conf.json +++ b/ui/src-tauri/tauri.conf.json @@ -22,7 +22,7 @@ "icons/icon.icns", "icons/icon.ico" ], - "resources": [], + "resources": ["*.bin"], "externalBin": [], "copyright": "Copyright 2019-2021 Manta Network", "category": "DeveloperTool", From 1a33e60371fc15b4b6a98eb2603d72419407fff9 Mon Sep 17 00:00:00 2001 From: Kevin Gislason Date: Wed, 22 Dec 2021 19:29:25 -0600 Subject: [PATCH 3/4] code review --- release.sh | 3 ++- src/service.rs | 3 ++- ui/package.json | 4 ++-- ui/public/about.html | 12 ++++++------ 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/release.sh b/release.sh index 077865ce..9d3e8189 100755 --- a/release.sh +++ b/release.sh @@ -28,7 +28,8 @@ The version numbers in the following files must be updated: 2. ui/src-tauri/Cargo.toml 3. ui/src-tauri/tauri.conf.json 4. ui/public/about.html - + 5. ui/package.json + EOF prompt "Did you update the version numbers?" diff --git a/src/service.rs b/src/service.rs index b4984f03..988eeb50 100644 --- a/src/service.rs +++ b/src/service.rs @@ -369,8 +369,9 @@ where /// Sends version to the client. #[inline] async fn version(request: Request) -> ServerResult { - Self::log(String::from("VERSION")).await?; + Self::log(String::from("REQUEST: version")).await?; let _ = request; + Self::log(format!("RESPONSE: {:?}", VERSION)).await?; Ok(Body::from_json(&VersionMessage::default())?.into()) } diff --git a/ui/package.json b/ui/package.json index e9859a45..7006c8f6 100644 --- a/ui/package.json +++ b/ui/package.json @@ -1,6 +1,6 @@ { "name": "manta-signer-ui", - "version": "0.4.0", + "version": "0.5.0", "private": true, "dependencies": { "@tauri-apps/api": "^1.0.0-beta.8", @@ -43,4 +43,4 @@ "devDependencies": { "@tauri-apps/cli": "^1.0.0-beta.10" } -} +} \ No newline at end of file diff --git a/ui/public/about.html b/ui/public/about.html index 58df212d..df664507 100644 --- a/ui/public/about.html +++ b/ui/public/about.html @@ -41,11 +41,11 @@

Manta Signer

Version 0.5.0

Copyright © 2019-2021 Manta Network

- manta-network/manta-signer -

-
-

DOLPHIN TESTNET

+ manta-network/manta-signer +

+
+

DOLPHIN TESTNET

- + + \ No newline at end of file From 9b60be47e761055f4750bbfd086a3000c6118b75 Mon Sep 17 00:00:00 2001 From: Kevin Gislason Date: Sun, 26 Dec 2021 21:25:47 -0600 Subject: [PATCH 4/4] update manta-api --- Cargo.toml | 2 +- ui/src-tauri/Cargo.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 644646ad..a42ecd06 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,7 +40,7 @@ derivative = { version = "2.2.0", default-features = false, features = ["use_cor dirs-next = { version = "2.0.0" } futures = { version = "0.3.17", default-features = false } http-types = { version = "2.12.0", default-features = false } -manta-api = { git = "https://github.com/Manta-Network/manta-api", branch = "incremental_refresh", default-features = false, features = ["signer", "testnet"] } +manta-api = { git = "https://github.com/Manta-Network/manta-api", branch = "manta", default-features = false, features = ["signer", "testnet"] } manta-asset = { git = "https://github.com/Manta-Network/manta-types", branch = "manta" } manta-crypto = { git = "https://github.com/Manta-Network/manta-crypto", branch = "manta" } manta-data = { git = "https://github.com/Manta-Network/manta-types", branch = "manta" } diff --git a/ui/src-tauri/Cargo.lock b/ui/src-tauri/Cargo.lock index ca147c50..043790e9 100644 --- a/ui/src-tauri/Cargo.lock +++ b/ui/src-tauri/Cargo.lock @@ -2694,7 +2694,7 @@ dependencies = [ [[package]] name = "manta-api" version = "0.3.3" -source = "git+https://github.com/Manta-Network/manta-api?branch=incremental_refresh#45eea96be843675fa667abafc554bcdced2d60de" +source = "git+https://github.com/Manta-Network/manta-api?branch=manta#309e272f46a9a25b468a11d9c36716a7e32c85a5" dependencies = [ "ark-bls12-381", "ark-crypto-primitives",