Skip to content

Commit

Permalink
Merge pull request #120 from Concordium/company-gui
Browse files Browse the repository at this point in the history
Fix wrong network error message
  • Loading branch information
lassemoldrup authored Nov 22, 2023
2 parents 3f1b4ce + 2ea7e4e commit 3a4dc75
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
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")),
}
}

let time_since_last_finalized = client
Expand Down

0 comments on commit 3a4dc75

Please sign in to comment.