Skip to content

Commit 0879a43

Browse files
authored
Merge pull request #36 from Manta-Network/incremental_recovery
Incremental recovery changes
2 parents bd3626f + 9b60be4 commit 0879a43

File tree

8 files changed

+45
-22
lines changed

8 files changed

+45
-22
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "manta-signer"
33
edition = "2018"
4-
version = "0.4.1"
4+
version = "0.5.0"
55
authors = ["Manta Network <contact@manta.network>"]
66
readme = "README.md"
77
license-file = "LICENSE"

release.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ The version numbers in the following files must be updated:
2828
2. ui/src-tauri/Cargo.toml
2929
3. ui/src-tauri/tauri.conf.json
3030
4. ui/public/about.html
31-
31+
5. ui/package.json
32+
3233
EOF
3334
prompt "Did you update the version numbers?"
3435

src/service.rs

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ where
318318
.allow_credentials(false);
319319
let mut server = Server::with_state(State::new(config, authorizer));
320320
server.with(cors);
321-
server.at("/heartbeat").get(Self::heartbeat);
321+
server.at("/version").get(Self::version);
322322
server.at("/recoverAccount").post(Self::recover_account);
323323
server
324324
.at("/deriveShieldedAddress")
@@ -366,12 +366,13 @@ where
366366
self.0.state()
367367
}
368368

369-
/// Sends a heartbeat to the client.
369+
/// Sends version to the client.
370370
#[inline]
371-
async fn heartbeat(request: Request<A>) -> ServerResult<String> {
372-
Self::log(String::from("HEARTBEAT")).await?;
371+
async fn version(request: Request<A>) -> ServerResult {
372+
Self::log(String::from("REQUEST: version")).await?;
373373
let _ = request;
374-
Ok(String::from("heartbeat"))
374+
Self::log(format!("RESPONSE: {:?}", VERSION)).await?;
375+
Ok(Body::from_json(&VersionMessage::default())?.into())
375376
}
376377

377378
/// Runs an account recovery for the given `request`.
@@ -499,14 +500,28 @@ where
499500
}
500501
}
501502

503+
/// Version Message
504+
#[derive(Clone, Debug, Deserialize, Serialize)]
505+
pub struct VersionMessage {
506+
/// Version
507+
pub version: &'static str,
508+
}
509+
510+
impl Default for VersionMessage {
511+
/// Builds a default [`VersionMessage`].
512+
fn default() -> Self {
513+
Self { version: VERSION }
514+
}
515+
}
516+
502517
/// Shielded Address Message
503518
#[derive(Clone, Debug, Deserialize, Serialize)]
504519
pub struct ShieldedAddressMessage {
505520
/// Address
506521
pub address: Vec<u8>,
507522

508523
/// Version
509-
pub version: String,
524+
pub version: &'static str,
510525
}
511526

512527
impl ShieldedAddressMessage {
@@ -515,11 +530,10 @@ impl ShieldedAddressMessage {
515530
pub fn new(address: Vec<u8>) -> Self {
516531
Self {
517532
address,
518-
version: "0.0.0".into(),
533+
version: VERSION,
519534
}
520535
}
521536
}
522-
523537
/// Recover Account Message
524538
#[derive(Clone, Debug, Deserialize, Serialize)]
525539
pub struct RecoverAccountMessage {

ui/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "manta-signer-ui",
3-
"version": "0.4.0",
3+
"version": "0.5.0",
44
"private": true,
55
"dependencies": {
66
"@tauri-apps/api": "^1.0.0-beta.8",
@@ -43,4 +43,4 @@
4343
"devDependencies": {
4444
"@tauri-apps/cli": "^1.0.0-beta.10"
4545
}
46-
}
46+
}

ui/public/about.html

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<!DOCTYPE html>
22
<html lang="en">
3+
34
<head>
45
<meta charset="utf-8" />
56
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
@@ -15,29 +16,36 @@
1516
color: black;
1617
font-family: monospace;
1718
}
19+
1820
main {
1921
text-align: center;
2022
margin-top: 3em;
2123
}
24+
2225
p {
2326
margin: 0.25em;
2427
font-size: 0.85em;
2528
}
29+
2630
button {
2731
margin: 1em;
2832
width: 6em;
2933
}
3034
</style>
3135
</head>
36+
3237
<body>
3338
<main>
3439
<img src="Square89x89Logo.png" />
3540
<h3>Manta Signer</h3>
36-
<p>Version 0.4.1</p>
41+
<p>Version 0.5.0</p>
3742
<p>Copyright © 2019-2021 Manta Network</p>
38-
<p><a href="https://github.com/manta-network/manta-signer">manta-network/manta-signer</a></p>
39-
<br>
43+
<p>
44+
<a href="https://github.com/manta-network/manta-signer">manta-network/manta-signer</a>
45+
</p>
46+
<br />
4047
<p style="font-size: 0.75em; color: red">DOLPHIN TESTNET</p>
4148
</main>
4249
</body>
43-
</html>
50+
51+
</html>

ui/src-tauri/Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "manta-signer-ui"
33
edition = "2018"
4-
version = "0.4.1"
4+
version = "0.5.0"
55
authors = ["Manta Network <contact@manta.network>"]
66
readme = "README.md"
77
license-file = "LICENSE"

ui/src-tauri/tauri.conf.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"package": {
33
"productName": "Manta Signer",
4-
"version": "0.4.1"
4+
"version": "0.5.0"
55
},
66
"build": {
77
"distDir": "../build",
@@ -87,4 +87,4 @@
8787
"iconAsTemplate": true
8888
}
8989
}
90-
}
90+
}

0 commit comments

Comments
 (0)