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

Fix wrong network error message #120

Merged
merged 1 commit into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion company-id-gui/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "company-id-gui",
"private": true,
"version": "1.0.1",
"version": "1.0.2",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
2 changes: 1 addition & 1 deletion company-id-gui/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 company-id-gui/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "company-id-gui"
version = "1.0.1"
version = "1.0.2"
description = "Concordium Company ID GUI"
authors = ["Concordium <developers@concordium.com>"]
license = "Apache-2.0"
Expand Down
7 changes: 5 additions & 2 deletions company-id-gui/src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ enum Error {
#[error("Failed to create file: {0}")]
FileError(#[from] Box<dyn std::error::Error>),
#[error("Node is not on the {0} network.")]
WrongNetwork(Net),
WrongNetwork(&'static str),
#[error("Node is not caught up. Please try again later.")]
NotCaughtUp,
#[error("Invalid identity object: {0}")]
Expand Down Expand Up @@ -184,7 +184,10 @@ async fn set_node_and_network(
Net::Testnet => TESTNET_GENESIS_HASH,
};
if genesis_hash.to_string() != expected_genesis_hash {
return Err(Error::WrongNetwork(net));
match net {
Net::Mainnet => return Err(Error::WrongNetwork("Mainnet")),
Net::Testnet => return Err(Error::WrongNetwork("Testnet")),
abizjak marked this conversation as resolved.
Show resolved Hide resolved
}
}

let time_since_last_finalized = client
Expand Down
Loading