Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incremental recovery changes #36

Merged
merged 4 commits into from
Dec 27, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "manta-signer"
edition = "2018"
version = "0.4.1"
version = "0.5.0"
authors = ["Manta Network <contact@manta.network>"]
readme = "README.md"
license-file = "LICENSE"
Expand Down Expand Up @@ -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"] }
Kevingislason marked this conversation as resolved.
Show resolved Hide resolved
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" }
Expand Down
29 changes: 21 additions & 8 deletions src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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<A>) -> ServerResult<String> {
Self::log(String::from("HEARTBEAT")).await?;
async fn version(request: Request<A>) -> ServerResult {
Self::log(String::from("VERSION")).await?;
Kevingislason marked this conversation as resolved.
Show resolved Hide resolved
let _ = request;
Ok(String::from("heartbeat"))
Ok(Body::from_json(&VersionMessage::default())?.into())
}

/// Runs an account recovery for the given `request`.
Expand Down Expand Up @@ -499,14 +499,28 @@ 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 {
/// Address
pub address: Vec<u8>,

/// Version
pub version: String,
pub version: &'static str,
}

impl ShieldedAddressMessage {
Expand All @@ -515,11 +529,10 @@ impl ShieldedAddressMessage {
pub fn new(address: Vec<u8>) -> Self {
Self {
address,
version: "0.0.0".into(),
version: VERSION,
}
}
}

/// Recover Account Message
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct RecoverAccountMessage {
Expand Down
20 changes: 14 additions & 6 deletions ui/public/about.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
Expand All @@ -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;
}
</style>
</head>

<body>
<main>
<img src="Square89x89Logo.png" />
<h3>Manta Signer</h3>
<p>Version 0.4.1</p>
<p>Version 0.5.0</p>
<p>Copyright © 2019-2021 Manta Network</p>
<p><a href="https://github.com/manta-network/manta-signer">manta-network/manta-signer</a></p>
<br>
<p style="font-size: 0.75em; color: red">DOLPHIN TESTNET</p>
<p>
<a href="https://github.com/manta-network/manta-signer">manta-network/manta-signer</a
>
Kevingislason marked this conversation as resolved.
Show resolved Hide resolved
</p>
<br />
<p style="font-size: 0.75em; color: red">DOLPHIN TESTNET</p>
</main>
</body>
</html>
</body>
</html>
6 changes: 3 additions & 3 deletions ui/src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ui/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "manta-signer-ui"
edition = "2018"
version = "0.4.1"
version = "0.5.0"
authors = ["Manta Network <contact@manta.network>"]
readme = "README.md"
license-file = "LICENSE"
Expand Down
4 changes: 2 additions & 2 deletions ui/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"package": {
"productName": "Manta Signer",
"version": "0.4.1"
"version": "0.5.0"
},
"build": {
"distDir": "../build",
Expand Down Expand Up @@ -87,4 +87,4 @@
"iconAsTemplate": true
}
}
}
}