Skip to content

Commit

Permalink
imp(cmd): Update testnet Mintscan link and allow non-rc versions (#45)
Browse files Browse the repository at this point in the history
* adjust testnet links

* adjust testnet version regex

* add changelog entry

* fix failing testnet version test
  • Loading branch information
MalteHerrmann authored Sep 17, 2024
1 parent a000f23 commit 415a269
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

### Improvements

- (command) [#45](https://github.com/evmos/proposer/pull/45) Update testnet Mintscan link and allow non-rc versions.
- (all) [#44](https://github.com/evmos/proposer/pull/44) Minor improvements and updated README.
- (command) [#40](https://github.com/evmos/proposer/pull/40) Improve handling of Commonwealth info.
- (block) [#39](https://github.com/evmos/proposer/pull/39) Round upgrade height to nearest 500.
Expand Down
6 changes: 3 additions & 3 deletions src/proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ fn get_height_with_link(network: Network, height: u64) -> String {
let height_with_commas = height.to_formatted_string(&num_format::Locale::en);
match network {
Network::LocalNode => format!(
"[{}](https://www.mintscan.io/evmos/blocks/{})",
"[{}](https://mintscan.io/evmos/blocks/{})",
height_with_commas, height
),
Network::Mainnet => format!(
"[{}](https://www.mintscan.io/evmos/blocks/{})",
"[{}](https://mintscan.io/evmos/blocks/{})",
height_with_commas, height
),
Network::Testnet => format!(
"[{}](https://testnet.mintscan.io/evmos-testnet/blocks/{})",
"[{}](https://mintscan.io/evmos-testnet/blocks/{})",
height_with_commas, height
),
}
Expand Down
4 changes: 2 additions & 2 deletions src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub fn is_valid_version(version: &str) -> bool {
pub fn is_valid_version_for_network(network: Network, target_version: &str) -> bool {
let re = match network {
Network::LocalNode => Regex::new(r"^v\d+\.\d{1}\.\d+(-rc\d+)*$").unwrap(),
Network::Testnet => Regex::new(r"^v\d+\.\d{1}\.\d+-rc\d+$").unwrap(),
Network::Testnet => Regex::new(r"^v\d+\.\d{1}\.\d+(-rc\d+)*$").unwrap(),
Network::Mainnet => Regex::new(r"^v\d+\.\d{1}\.\d+$").unwrap(),
};

Expand Down Expand Up @@ -67,7 +67,7 @@ mod tests {
#[test]
fn test_is_valid_target_version_testnet_fail() {
assert_eq!(
is_valid_version_for_network(network::Network::Testnet, "v14.0.0",),
is_valid_version_for_network(network::Network::Testnet, "v14.00",),
false
);
}
Expand Down

0 comments on commit 415a269

Please sign in to comment.