diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 496e9a4..8f47027 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -10,9 +10,9 @@ on: pull_request env: RUST_BACKTRACE: 1 RUSTFLAGS: "-D warnings" - CLIENT_VERSION: 0.1.2 - NODE_VERSION: 0.112.1 - NODE_MANAGER_VERSION: 0.11.0 + CLIENT_VERSION: 0.3.0-rc.1 + NODE_VERSION: 0.3.0-rc.1 + ANTCTL_VERSION: 0.11.4-rc.1 jobs: # The code in this crate uses lots of conditional compilation for cross-platform capabilities. @@ -142,20 +142,20 @@ jobs: run: | cargo run -- client --version $env:CLIENT_VERSION cargo run -- node --version $env:NODE_VERSION - cargo run -- node-manager --version $env:NODE_MANAGER_VERSION + cargo run -- antctl --version $env:ANTCTL_VERSION - name: Check if binaries are available in new shell session shell: pwsh run: | - if (!(Test-Path "$env:USERPROFILE\autonomi\autonomi.exe")) { - Write-Host "autonomi.exe does not exist" + if (!(Test-Path "$env:USERPROFILE\autonomi\ant.exe")) { + Write-Host "ant.exe does not exist" exit 1 } - if (!(Test-Path "$env:USERPROFILE\autonomi\safenode.exe")) { - Write-Host "safenode.exe does not exist" + if (!(Test-Path "$env:USERPROFILE\autonomi\antnode.exe")) { + Write-Host "antnode.exe does not exist" exit 1 } - if (!(Test-Path "$env:USERPROFILE\autonomi\safenode-manager.exe")) { - Write-Host "safenode-manager.exe does not exist" + if (!(Test-Path "$env:USERPROFILE\autonomi\antctl.exe")) { + Write-Host "antctl.exe does not exist" exit 1 } @@ -163,7 +163,7 @@ jobs: # being modified easily, so we need to refer to the binaries with their full paths. # Other manual testing has proven that the changes to the Path environment variable do # take effect. - $output = & "${env:USERPROFILE}\autonomi\autonomi.exe" --version + $output = & "${env:USERPROFILE}\autonomi\ant.exe" --version $version = $output | Select-String -Pattern "autonomi-cli (\d+\.\d+\.\d+(?:-[a-zA-Z0-9]+(?:\.[0-9]+)?)?)" $versionNumber = $version.Matches.Groups[1].Value if ($versionNumber -eq "$env:CLIENT_VERSION") { @@ -175,26 +175,26 @@ jobs: exit 1 } - $output = & "${env:USERPROFILE}\autonomi\safenode.exe" --version + $output = & "${env:USERPROFILE}\autonomi\antnode.exe" --version $version = $output -split "`n" | Select-Object -First 1 $versionNumber = ($version -split "v")[1].Trim() if ($versionNumber -eq "$env:NODE_VERSION") { - Write-Host "The correct version of safenode has been installed" + Write-Host "The correct version of antnode has been installed" } else { - Write-Host "The correct version of safenode has not been installed" + Write-Host "The correct version of antnode has not been installed" Write-Host "We expected version $env:NODE_VERSION" Write-Host "The downloaded binary has $versionNumber" exit 1 } - $output = & "${env:USERPROFILE}\autonomi\safenode-manager.exe" --version + $output = & "${env:USERPROFILE}\autonomi\antctl.exe" --version $version = $output -split "`n" | Select-Object -First 1 $versionNumber = ($version -split "v")[1].Trim() - if ($versionNumber -eq "$env:NODE_MANAGER_VERSION") { - Write-Host "The correct version of safenode-manager has been installed" + if ($versionNumber -eq "$env:ANTCTL_VERSION") { + Write-Host "The correct version of antctl has been installed" } else { - Write-Host "The correct version of safenode-manager has not been installed" - Write-Host "We expected version $env:NODE_MANAGER_VERSION" + Write-Host "The correct version of antctl has not been installed" + Write-Host "We expected version $env:ANTCTL_VERSION" Write-Host "The downloaded binary has $versionNumber" exit 1 } @@ -215,7 +215,7 @@ jobs: run: | cargo run -- client --version $CLIENT_VERSION cargo run -- node --version $NODE_VERSION - cargo run -- node-manager --version $NODE_MANAGER_VERSION + cargo run -- antctl --version $ANTCTL_VERSION - name: Check if binaries are available in new shell session shell: bash run: | @@ -228,9 +228,9 @@ jobs: # locations. source ~/.config/autonomi/env - [[ -f "$HOME/.local/bin/autonomi" ]] || { echo "autonomi not in expected location"; exit 1; } - [[ -f "$HOME/.local/bin/safenode" ]] || { echo "safenode not in expected location"; exit 1; } - [[ -f "$HOME/.local/bin/safenode-manager" ]] || { echo "safenode-manager not in expected location"; exit 1; } + [[ -f "$HOME/.local/bin/ant" ]] || { echo "ant not in expected location"; exit 1; } + [[ -f "$HOME/.local/bin/antnode" ]] || { echo "antnode not in expected location"; exit 1; } + [[ -f "$HOME/.local/bin/antctl" ]] || { echo "antctl not in expected location"; exit 1; } version=$(autonomi --version | awk '{ print $2 }') if [[ "$version" == "$CLIENT_VERSION" ]]; then @@ -242,22 +242,22 @@ jobs: exit 1 fi - version=$(safenode --version | head -n 1 | awk '{print $3}' | sed 's/^v//') + version=$(antnode --version | head -n 1 | awk '{print $3}' | sed 's/^v//') if [[ "$version" == "$NODE_VERSION" ]]; then - echo "The correct version of safenode has been installed" + echo "The correct version of antnode has been installed" else - echo "The correct version of safenode has not been installed" + echo "The correct version of antnode has not been installed" echo "We expected $NODE_VERSION" echo "The downloaded binary has $version" exit 1 fi version=$(safenode-manager --version | head -n 1 | awk '{print $4}' | sed 's/^v//') - if [[ "$version" == "$NODE_MANAGER_VERSION" ]]; then - echo "The correct version of safenode-manager has been installed" + if [[ "$version" == "$ANTCTL_VERSION" ]]; then + echo "The correct version of antctl has been installed" else - echo "The correct version of safenode-manager has not been installed" - echo "We expected $NODE_MANAGER_VERSION" + echo "The correct version of antctl has not been installed" + echo "We expected $ANTCTL_VERSION" echo "The downloaded binary has $version" exit 1 fi @@ -277,42 +277,42 @@ jobs: run: | cargo run -- client --version $CLIENT_VERSION cargo run -- node --version $NODE_VERSION - cargo run -- node-manager --version $NODE_MANAGER_VERSION + cargo run -- antctl --version $ANTCTL_VERSION - name: Check if binaries are available in new shell session run: | # As with the Ubuntu test, we need to source the env file to get the binaries on PATH. source "/Users/runner/Library/Application Support/autonomi/env" - [[ -f "$HOME/.local/bin/autonomi" ]] || { echo "autonomi not in expected location"; exit 1; } - [[ -f "$HOME/.local/bin/safenode" ]] || { echo "safenode not in expected location"; exit 1; } - [[ -f "$HOME/.local/bin/safenode-manager" ]] || { echo "safenode-manager not in expected location"; exit 1; } + [[ -f "$HOME/.local/bin/ant" ]] || { echo "ant not in expected location"; exit 1; } + [[ -f "$HOME/.local/bin/antnode" ]] || { echo "antnode not in expected location"; exit 1; } + [[ -f "$HOME/.local/bin/antctl" ]] || { echo "antctl not in expected location"; exit 1; } - version=$(autonomi --version | awk '{ print $2 }') + version=$(ant --version | awk '{ print $2 }') if [[ "$version" == "$CLIENT_VERSION" ]]; then - echo "The correct version of autonomi has been installed" + echo "The correct version of ant has been installed" else - echo "The correct version of autonomi has not been installed" + echo "The correct version of ant has not been installed" echo "We expected $CLIENT_VERSION" echo "The downloaded binary has $version" exit 1 fi - version=$(safenode --version | head -n 1 | awk '{print $3}' | sed 's/^v//') + version=$(antnode --version | head -n 1 | awk '{print $3}' | sed 's/^v//') if [[ "$version" == "$NODE_VERSION" ]]; then - echo "The correct version of safenode has been installed" + echo "The correct version of antnode has been installed" else - echo "The correct version of safenode has not been installed" + echo "The correct version of antnode has not been installed" echo "We expected $NODE_VERSION" echo "The downloaded binary has $version" exit 1 fi - version=$(safenode-manager --version | head -n 1 | awk '{print $4}' | sed 's/^v//') - if [[ "$version" == "$NODE_MANAGER_VERSION" ]]; then - echo "The correct version of safenode-manager has been installed" + version=$(antctl --version | head -n 1 | awk '{print $4}' | sed 's/^v//') + if [[ "$version" == "$ANTCTL_VERSION" ]]; then + echo "The correct version of antctl has been installed" else - echo "The correct version of safenode-manager has not been installed" - echo "We expected $NODE_MANAGER_VERSION" + echo "The correct version of antctl has not been installed" + echo "We expected $ANTCTL_VERSION" echo "The downloaded binary has $version" exit 1 fi diff --git a/Cargo.toml b/Cargo.toml index 19872ac..2c1412a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,16 +1,17 @@ [package] -name = "safeup" +name = "antup" authors = ["MaidSafe Developers "] -description = "CLI for installing components for accessing the Safe Network" +description = "CLI for installing components for accessing the Autonomi network" license = "GPL-3.0" version = "0.8.1" edition = "2021" [[bin]] -name = "safeup" +name = "antup" path = "src/main.rs" [dependencies] +ant-releases = "0.4.0" clap = { version = "4.1.6", features = ["derive"] } chrono = "0.4.26" color-eyre = "0.6.2" @@ -24,7 +25,6 @@ semver = "1.0.4" serde = "1.0" serde_derive = "1.0" serde_json = "1.0" -sn-releases = "0.3.1" tempfile = "3.8.1" textwrap = "0.16.0" tokio = { version = "1.26", features = ["full"] } @@ -37,4 +37,4 @@ assert_fs = "~1.0" assert_matches = "1.5.0" async-trait = "0.1" mockall = "0.11.3" -predicates = "2.0" +predicates = "2.0" \ No newline at end of file diff --git a/install.ps1 b/install.ps1 index bdc210b..ceeb0d8 100644 --- a/install.ps1 +++ b/install.ps1 @@ -2,36 +2,36 @@ $ErrorActionPreference = "Stop" Write-Host "**************************************" Write-Host "* *" -Write-Host "* Installing safeup *" +Write-Host "* Installing antup *" Write-Host "* *" Write-Host "**************************************" $response = Invoke-WebRequest ` - -Uri "https://api.github.com/repos/maidsafe/safeup/releases/latest" ` + -Uri "https://api.github.com/repos/maidsafe/antup/releases/latest" ` -UseBasicParsing $json = $response | ConvertFrom-Json $version = $json.tag_name.TrimStart('v') -Write-Host "Latest version of safeup is $version" -$asset = $json.assets | Where-Object { $_.name -match "safeup-$version-x86_64-pc-windows-msvc.zip" } +Write-Host "Latest version of antup is $version" +$asset = $json.assets | Where-Object { $_.name -match "antup-$version-x86_64-pc-windows-msvc.zip" } $downloadUrl = $asset.browser_download_url -$archivePath = Join-Path $env:TEMP "safeup.zip" +$archivePath = Join-Path $env:TEMP "antup.zip" Invoke-WebRequest -Uri $downloadUrl -OutFile $archivePath -$autonomiPath = Join-Path $env:USERPROFILE "autonomi" -New-Item -ItemType Directory -Force -Path $autonomiPath -Expand-Archive -Path $archivePath -DestinationPath $autonomiPath -Force +$antPath = Join-Path $env:USERPROFILE "ant" +New-Item -ItemType Directory -Force -Path $antPath +Expand-Archive -Path $archivePath -DestinationPath $antPath -Force Remove-Item $archivePath -$safeupExePath = Join-Path $autonomiPath "safeup.exe" +$antExePath = Join-Path $antPath "ant.exe" $currentPath = [Environment]::GetEnvironmentVariable("PATH", [EnvironmentVariableTarget]::User) -if ($currentPath -notlike "*$autonomiPath*") { - $newPath = $currentPath + ";" + $autonomiPath +if ($currentPath -notlike "*$antPath*") { + $newPath = $currentPath + ";" + $antPath [Environment]::SetEnvironmentVariable("PATH", $newPath, [EnvironmentVariableTarget]::User) - Write-Host "Added $autonomiPath to user PATH" + Write-Host "Added $antPath to user PATH" } else { - Write-Host "Path $autonomiPath is already in user PATH" + Write-Host "Path $antPath is already in user PATH" } -Write-Host "You may need to start a new session for safeup to become available." -Write-Host "When safeup is available, please run 'safeup --help' to see how to install network components." \ No newline at end of file +Write-Host "You may need to start a new session for antup to become available." +Write-Host "When antup is available, please run 'antup --help' to see how to install network components." diff --git a/install.sh b/install.sh index 7f563e3..1feacab 100755 --- a/install.sh +++ b/install.sh @@ -31,7 +31,7 @@ fi function print_banner() { echo "**************************************" echo "* *" - echo "* Installing safeup *" + echo "* Installing antup *" echo "* *" echo "**************************************" } @@ -73,20 +73,20 @@ function detect_arch() { armv7*) arch_triple="armv7-unknown-$os-musleabihf" ;; *) echo "Architecture $arch not supported"; exit 1 ;; esac - echo "Will retrieve safeup for $arch_triple architecture" + echo "Will retrieve antup for $arch_triple architecture" } function get_latest_version() { - release_data=$(curl --silent "https://api.github.com/repos/maidsafe/safeup/releases/latest") + release_data=$(curl --silent "https://api.github.com/repos/maidsafe/antup/releases/latest") version=$(echo "$release_data" | awk -F': ' '/"tag_name":/ {print $2}' | \ sed 's/"//g' | sed 's/,//g' | sed 's/v//g') download_url=$(echo "$release_data" | \ awk -F': ' '/"browser_download_url":/ {print $2 $3}' | \ - grep "safeup-$version-$arch_triple.tar.gz" | sed 's/"//g' | sed 's/,//g') - echo "Latest version of safeup is $version" + grep "antup-$version-$arch_triple.tar.gz" | sed 's/"//g' | sed 's/,//g') + echo "Latest version of antup is $version" } -function install_safeup() { +function install_antup() { if [[ $running_as_root -eq 1 ]]; then target_dir="/usr/local/bin" else @@ -107,30 +107,30 @@ EOF fi temp_dir=$(mktemp -d) - curl -L "$download_url" -o "$temp_dir/safeup.tar.gz" - tar -xzf "$temp_dir/safeup.tar.gz" -C "$temp_dir" - mv "$temp_dir/safeup" "$target_dir/safeup" - chmod +x "$target_dir/safeup" + curl -L "$download_url" -o "$temp_dir/antup.tar.gz" + tar -xzf "$temp_dir/antup.tar.gz" -C "$temp_dir" + mv "$temp_dir/antup" "$target_dir/antup" + chmod +x "$target_dir/antup" rm -rf "$temp_dir" - echo "safeup installed to $target_dir/safeup" + echo "antup installed to $target_dir/antup" } function post_install() { if [[ $install_client -eq 1 ]]; then - echo "Now running safeup to install the safe client..." - $target_dir/safeup client + echo "Now running antup to install the safe client..." + $target_dir/antup client fi if [[ $install_node -eq 1 ]]; then - echo "Now running safeup to install safenode..." - $target_dir/safeup node + echo "Now running antup to install safenode..." + $target_dir/antup node fi if [[ $running_as_root -eq 1 ]]; then - echo "Please run 'safeup --help' to see how to install network components." + echo "Please run 'antup --help' to see how to install network components." else printf "\n" - echo "The safeup binary has been installed, but it's not available in this session." + echo "The antup binary has been installed, but it's not available in this session." echo "You must either run 'source ~/.config/autonomi/env' in this session, or start a new session." - echo "When safeup is available, please run 'safeup --help' to see how to install network components." + echo "When antup is available, please run 'antup --help' to see how to install network components." fi } @@ -138,5 +138,5 @@ print_banner detect_os detect_arch get_latest_version -install_safeup +install_antup post_install \ No newline at end of file diff --git a/src/cmd.rs b/src/cmd.rs index 526207a..5267fd0 100644 --- a/src/cmd.rs +++ b/src/cmd.rs @@ -8,11 +8,11 @@ use crate::install::{AssetType, Settings}; use crate::update::{perform_update_assessment, UpdateAssessmentResult}; +use ant_releases::AntReleaseRepoActions; use color_eyre::{eyre::eyre, Result}; use lazy_static::lazy_static; use prettytable::{Cell, Row, Table}; use semver::Version; -use sn_releases::SafeReleaseRepoActions; use std::collections::HashMap; use std::env::consts::{ARCH, OS}; use std::path::PathBuf; @@ -28,11 +28,11 @@ lazy_static! { ); m.insert( AssetType::Node, - "https://sn-node.s3.eu-west-2.amazonaws.com", + "https://antnode.s3.eu-west-2.amazonaws.com", ); m.insert( - AssetType::NodeManager, - "https://sn-node-manager.s3.eu-west-2.amazonaws.com", + AssetType::AntCtl, + "https://antctl.s3.eu-west-2.amazonaws.com", ); m }; @@ -74,7 +74,7 @@ pub(crate) async fn process_update_cmd() -> Result<()> { let autonomi_config_dir_path = get_autonomi_config_dir_path()?; let settings_file_path = autonomi_config_dir_path.join("safeup.json"); let settings = Settings::read(&settings_file_path)?; - let release_repo = ::default_config(); + let release_repo = ::default_config(); for asset_type in AssetType::variants() { println!("Retrieving latest version for {asset_type}..."); @@ -151,7 +151,7 @@ async fn do_install_binary( version: Option, ) -> Result<()> { let platform = get_platform()?; - let release_repo = ::default_config(); + let release_repo = ::default_config(); let (installed_version, bin_path) = crate::install::install_bin( asset_type.clone(), release_repo, @@ -166,16 +166,16 @@ async fn do_install_binary( let mut settings = Settings::read(&settings_file_path)?; match asset_type { AssetType::Client => { - settings.autonomi_path = Some(bin_path); - settings.autonomi_version = Some(installed_version); + settings.ant_path = Some(bin_path); + settings.ant_version = Some(installed_version); } AssetType::Node => { - settings.safenode_path = Some(bin_path); - settings.safenode_version = Some(installed_version); + settings.antnode_path = Some(bin_path); + settings.antnode_version = Some(installed_version); } - AssetType::NodeManager => { - settings.safenode_manager_path = Some(bin_path); - settings.safenode_manager_version = Some(installed_version); + AssetType::AntCtl => { + settings.antctl_path = Some(bin_path); + settings.antctl_version = Some(installed_version); } } settings.save(&settings_file_path)?; diff --git a/src/install.rs b/src/install.rs index b8f68a4..8f6c53e 100644 --- a/src/install.rs +++ b/src/install.rs @@ -6,6 +6,7 @@ // KIND, either express or implied. Please review the Licences for the specific language governing // permissions and limitations relating to use of the SAFE Network Software. +use ant_releases::{get_running_platform, AntReleaseRepoActions, ArchiveType, ReleaseType}; #[cfg(windows)] use color_eyre::{eyre::eyre, Help, Result}; #[cfg(unix)] @@ -17,7 +18,6 @@ use semver::Version; use serde::de::Visitor; use serde::{Deserializer, Serializer}; use serde_derive::{Deserialize, Serialize}; -use sn_releases::{get_running_platform, ArchiveType, ReleaseType, SafeReleaseRepoActions}; use std::env::consts::OS; use std::fmt; use std::fs::{File, OpenOptions}; @@ -53,19 +53,19 @@ const SET_PATH_FILE_CONTENT: &str = indoc! {r#" pub enum AssetType { Client, Node, - NodeManager, + AntCtl, } impl AssetType { pub fn variants() -> Vec { - vec![AssetType::Client, AssetType::Node, AssetType::NodeManager] + vec![AssetType::Client, AssetType::Node, AssetType::AntCtl] } pub fn get_release_type(&self) -> ReleaseType { match self { - AssetType::Client => ReleaseType::Autonomi, - AssetType::Node => ReleaseType::Safenode, - AssetType::NodeManager => ReleaseType::SafenodeManager, + AssetType::Client => ReleaseType::Ant, + AssetType::Node => ReleaseType::AntNode, + AssetType::AntCtl => ReleaseType::AntCtl, } } } @@ -75,31 +75,31 @@ impl std::fmt::Display for AssetType { match *self { AssetType::Client => write!(f, "autonomi"), AssetType::Node => write!(f, "safenode"), - AssetType::NodeManager => write!(f, "safenode-manager"), + AssetType::AntCtl => write!(f, "safenode-manager"), } } } #[derive(Clone, Debug, Serialize, Deserialize)] pub struct Settings { - pub autonomi_path: Option, + pub ant_path: Option, #[serde( serialize_with = "serialize_version", deserialize_with = "deserialize_version" )] - pub autonomi_version: Option, - pub safenode_path: Option, + pub ant_version: Option, + pub antnode_path: Option, #[serde( serialize_with = "serialize_version", deserialize_with = "deserialize_version" )] - pub safenode_version: Option, - pub safenode_manager_path: Option, + pub antnode_version: Option, + pub antctl_path: Option, #[serde( serialize_with = "serialize_version", deserialize_with = "deserialize_version" )] - pub safenode_manager_version: Option, + pub antctl_version: Option, } fn serialize_version(version: &Option, serializer: S) -> Result @@ -145,7 +145,7 @@ impl<'de> Visitor<'de> for VersionOptionVisitor { struct VersionVisitor; -impl<'de> Visitor<'de> for VersionVisitor { +impl Visitor<'_> for VersionVisitor { type Value = Version; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -166,21 +166,21 @@ impl Settings { let mut contents = String::new(); file.read_to_string(&mut contents)?; serde_json::from_str(&contents).unwrap_or_else(|_| Settings { - autonomi_path: None, - autonomi_version: None, - safenode_path: None, - safenode_version: None, - safenode_manager_path: None, - safenode_manager_version: None, + ant_path: None, + ant_version: None, + antnode_path: None, + antnode_version: None, + antctl_path: None, + antctl_version: None, }) } else { Settings { - autonomi_path: None, - autonomi_version: None, - safenode_path: None, - safenode_version: None, - safenode_manager_path: None, - safenode_manager_version: None, + ant_path: None, + ant_version: None, + antnode_path: None, + antnode_version: None, + antctl_path: None, + antctl_version: None, } }; Ok(settings) @@ -189,25 +189,25 @@ impl Settings { pub fn get_install_details(&self, asset_type: &AssetType) -> Option<(PathBuf, Version)> { match asset_type { AssetType::Client => { - if self.autonomi_path.is_some() { - let path = self.autonomi_path.as_ref().unwrap(); - let version = self.autonomi_version.as_ref().unwrap(); + if self.ant_path.is_some() { + let path = self.ant_path.as_ref().unwrap(); + let version = self.ant_version.as_ref().unwrap(); return Some((path.clone(), version.clone())); } None } AssetType::Node => { - if self.safenode_path.is_some() { - let path = self.safenode_path.as_ref().unwrap(); - let version = self.safenode_version.as_ref().unwrap(); + if self.antnode_path.is_some() { + let path = self.antnode_path.as_ref().unwrap(); + let version = self.antnode_version.as_ref().unwrap(); return Some((path.clone(), version.clone())); } None } - AssetType::NodeManager => { - if self.safenode_manager_path.is_some() { - let path = self.safenode_manager_path.as_ref().unwrap(); - let version = self.safenode_manager_version.as_ref().unwrap(); + AssetType::AntCtl => { + if self.antctl_path.is_some() { + let path = self.antctl_path.as_ref().unwrap(); + let version = self.antctl_version.as_ref().unwrap(); return Some((path.clone(), version.clone())); } None @@ -283,7 +283,7 @@ pub fn check_prerequisites() -> Result<()> { /// A tuple of the version number and full path of the installed binary. pub async fn install_bin( asset_type: AssetType, - release_repo: Box, + release_repo: Box, platform: &str, dest_dir_path: PathBuf, version: Option, @@ -418,9 +418,9 @@ pub async fn configure_shell_profile( fn get_bin_name(asset_type: &AssetType) -> String { let mut bin_name = match asset_type { - AssetType::Client => "autonomi".to_string(), - AssetType::Node => "safenode".to_string(), - AssetType::NodeManager => "safenode-manager".to_string(), + AssetType::Client => "ant".to_string(), + AssetType::Node => "antnode".to_string(), + AssetType::AntCtl => "antctl".to_string(), }; if OS == "windows" { bin_name.push_str(".exe"); @@ -441,6 +441,10 @@ mod test { use super::{configure_shell_profile, install_bin, AssetType, Settings, SET_PATH_FILE_CONTENT}; #[cfg(windows)] use super::{install_bin, AssetType, Settings}; + use ant_releases::{ + AntReleaseRepoActions, ArchiveType, Platform, ProgressCallback, ReleaseType, + Result as AntReleaseResult, + }; use assert_fs::prelude::*; use async_trait::async_trait; use color_eyre::Result; @@ -448,10 +452,6 @@ mod test { use mockall::predicate::*; use mockall::Sequence; use semver::Version; - use sn_releases::{ - ArchiveType, Platform, ProgressCallback, ReleaseType, Result as SnReleaseResult, - SafeReleaseRepoActions, - }; #[cfg(unix)] use std::os::unix::fs::PermissionsExt; use std::path::{Path, PathBuf}; @@ -459,19 +459,19 @@ mod test { /// These may seem pointless, but they are useful for when the tests run on different /// platforms. #[cfg(unix)] - const AUTONOMI_BIN_NAME: &str = "autonomi"; + const ANT_BIN_NAME: &str = "ant"; #[cfg(windows)] - const AUTONOMI_BIN_NAME: &str = "autonomi.exe"; + const ANT_BIN_NAME: &str = "ant.exe"; #[cfg(unix)] const PLATFORM: &str = "x86_64-unknown-linux-musl"; #[cfg(windows)] const PLATFORM: &str = "x86_64-pc-windows-msvc"; mock! { - pub SafeReleaseRepository {} + pub AntReleaseRepository {} #[async_trait] - impl SafeReleaseRepoActions for SafeReleaseRepository { - async fn get_latest_version(&self, release_type: &ReleaseType) -> SnReleaseResult; + impl AntReleaseRepoActions for AntReleaseRepository { + async fn get_latest_version(&self, release_type: &ReleaseType) -> AntReleaseResult; async fn download_release_from_s3( &self, release_type: &ReleaseType, @@ -480,15 +480,15 @@ mod test { archive_type: &ArchiveType, download_dir: &Path, callback: &ProgressCallback - ) -> SnReleaseResult; + ) -> AntReleaseResult; async fn download_release( &self, url: &str, dest_dir_path: &Path, callback: &ProgressCallback, - ) -> SnReleaseResult; - async fn download_winsw(&self, dest_path: &Path, callback: &ProgressCallback) -> SnReleaseResult<()>; - fn extract_release_archive(&self, archive_path: &Path, extract_dir: &Path) -> SnReleaseResult; + ) -> AntReleaseResult; + async fn download_winsw(&self, dest_path: &Path, callback: &ProgressCallback) -> AntReleaseResult<()>; + fn extract_release_archive(&self, archive_path: &Path, extract_dir: &Path) -> AntReleaseResult; } } @@ -500,12 +500,12 @@ mod test { let temp_dir = assert_fs::TempDir::new()?; let install_dir = temp_dir.child("install"); - let installed_autonomi = install_dir.child("autonomi"); + let installed_ant = install_dir.child("ant"); // By creating this file we are 'pretending' that it was extracted to the specified // location. It's done so we can assert that the file is made executable. - installed_autonomi.write_binary(b"fake autonomi bin")?; + installed_ant.write_binary(b"fake ant bin")?; - let mut mock_release_repo = MockSafeReleaseRepository::new(); + let mut mock_release_repo = MockAntReleaseRepository::new(); let mut seq = Sequence::new(); mock_release_repo .expect_get_latest_version() @@ -516,7 +516,7 @@ mod test { mock_release_repo .expect_download_release_from_s3() .with( - eq(&ReleaseType::Autonomi), + eq(&ReleaseType::Ant), eq(latest_version.clone()), always(), // Varies per platform eq(&ArchiveType::TarGz), @@ -557,15 +557,12 @@ mod test { .await?; assert_eq!(version, Version::new(0, 86, 55)); - assert_eq!(bin_path, installed_autonomi.to_path_buf()); + assert_eq!(bin_path, installed_ant.to_path_buf()); #[cfg(unix)] { - let extracted_autonomi_metadata = std::fs::metadata(installed_autonomi.path())?; - assert_eq!( - (extracted_autonomi_metadata.permissions().mode() & 0o777), - 0o755 - ); + let extracted_ant_metadata = std::fs::metadata(installed_ant.path())?; + assert_eq!((extracted_ant_metadata.permissions().mode() & 0o777), 0o755); } Ok(()) @@ -580,12 +577,12 @@ mod test { let temp_dir = assert_fs::TempDir::new()?; let install_dir = temp_dir.child("install/using/many/paths"); - let installed_autonomi = install_dir.child("autonomi"); + let installed_ant = install_dir.child("ant"); // By creating this file we are 'pretending' that it was extracted to the specified // location. It's done so we can assert that the file is made executable. - installed_autonomi.write_binary(b"fake autonomi bin")?; + installed_ant.write_binary(b"fake ant bin")?; - let mut mock_release_repo = MockSafeReleaseRepository::new(); + let mut mock_release_repo = MockAntReleaseRepository::new(); let mut seq = Sequence::new(); mock_release_repo .expect_get_latest_version() @@ -596,7 +593,7 @@ mod test { mock_release_repo .expect_download_release_from_s3() .with( - eq(&ReleaseType::Autonomi), + eq(&ReleaseType::Ant), eq(latest_version.clone()), always(), // Varies per platform eq(&ArchiveType::TarGz), @@ -637,7 +634,7 @@ mod test { .await?; assert_eq!(version, Version::new(0, 86, 55)); - assert_eq!(bin_path, installed_autonomi.to_path_buf()); + assert_eq!(bin_path, installed_ant.to_path_buf()); Ok(()) } @@ -649,17 +646,17 @@ mod test { let temp_dir = assert_fs::TempDir::new()?; let install_dir = temp_dir.child("install"); - let installed_autonomi = install_dir.child("autonomi"); + let installed_ant = install_dir.child("autonomi"); // By creating this file we are 'pretending' that it was extracted to the specified // location. It's done so we can assert that the file is made executable. - installed_autonomi.write_binary(b"fake autonomi bin")?; + installed_ant.write_binary(b"fake autonomi bin")?; - let mut mock_release_repo = MockSafeReleaseRepository::new(); + let mut mock_release_repo = MockAntReleaseRepository::new(); let mut seq = Sequence::new(); mock_release_repo .expect_download_release_from_s3() .with( - eq(&ReleaseType::Autonomi), + eq(&ReleaseType::Ant), eq(specific_version.clone()), always(), // Varies per platform eq(&ArchiveType::TarGz), @@ -700,7 +697,7 @@ mod test { .await?; assert_eq!(version, specific_version); - assert_eq!(bin_path, installed_autonomi.to_path_buf()); + assert_eq!(bin_path, installed_ant.to_path_buf()); Ok(()) } @@ -780,8 +777,8 @@ mod test { #[tokio::test] async fn save_should_write_new_settings_when_settings_file_does_not_exist() -> Result<()> { let tmp_data_path = assert_fs::TempDir::new()?; - let settings_file = tmp_data_path.child("safeup.json"); - let safe_bin_file = tmp_data_path.child(AUTONOMI_BIN_NAME); + let settings_file = tmp_data_path.child("antup.json"); + let safe_bin_file = tmp_data_path.child(ANT_BIN_NAME); safe_bin_file.write_binary(b"fake safe code")?; let safenode_bin_file = tmp_data_path.child("safenode"); safenode_bin_file.write_binary(b"fake safenode code")?; @@ -791,33 +788,27 @@ mod test { testnet_bin_file.write_binary(b"fake testnet code")?; let settings = Settings { - autonomi_path: Some(safe_bin_file.to_path_buf()), - autonomi_version: Some(Version::new(0, 75, 1)), - safenode_path: Some(safenode_bin_file.to_path_buf()), - safenode_version: Some(Version::new(0, 75, 2)), - safenode_manager_path: Some(safenode_manager_bin_file.to_path_buf()), - safenode_manager_version: Some(Version::new(0, 1, 8)), + ant_path: Some(safe_bin_file.to_path_buf()), + ant_version: Some(Version::new(0, 75, 1)), + antnode_path: Some(safenode_bin_file.to_path_buf()), + antnode_version: Some(Version::new(0, 75, 2)), + antctl_path: Some(safenode_manager_bin_file.to_path_buf()), + antctl_version: Some(Version::new(0, 1, 8)), }; settings.save(&settings_file.to_path_buf())?; settings_file.assert(predicates::path::is_file()); let settings = Settings::read(&settings_file.to_path_buf())?; - assert_eq!(settings.autonomi_path, Some(safe_bin_file.to_path_buf())); - assert_eq!(settings.autonomi_version, Some(Version::new(0, 75, 1))); + assert_eq!(settings.ant_path, Some(safe_bin_file.to_path_buf())); + assert_eq!(settings.ant_version, Some(Version::new(0, 75, 1))); + assert_eq!(settings.antnode_path, Some(safenode_bin_file.to_path_buf())); + assert_eq!(settings.antnode_version, Some(Version::new(0, 75, 2))); assert_eq!( - settings.safenode_path, - Some(safenode_bin_file.to_path_buf()) - ); - assert_eq!(settings.safenode_version, Some(Version::new(0, 75, 2))); - assert_eq!( - settings.safenode_manager_path, + settings.antctl_path, Some(safenode_manager_bin_file.to_path_buf()) ); - assert_eq!( - settings.safenode_manager_version, - Some(Version::new(0, 1, 8)) - ); + assert_eq!(settings.antctl_version, Some(Version::new(0, 1, 8))); Ok(()) } @@ -828,9 +819,9 @@ mod test { PathBuf::from("some") .join("parent") .join("dirs") - .join("safeup.json"), + .join("antup.json"), ); - let safe_bin_file = tmp_data_path.child(AUTONOMI_BIN_NAME); + let safe_bin_file = tmp_data_path.child(ANT_BIN_NAME); safe_bin_file.write_binary(b"fake safe code")?; let safenode_bin_file = tmp_data_path.child("safenode"); safenode_bin_file.write_binary(b"fake safenode code")?; @@ -840,33 +831,27 @@ mod test { testnet_bin_file.write_binary(b"fake testnet code")?; let settings = Settings { - autonomi_path: Some(safe_bin_file.to_path_buf()), - autonomi_version: Some(Version::new(0, 75, 1)), - safenode_path: Some(safenode_bin_file.to_path_buf()), - safenode_version: Some(Version::new(0, 75, 2)), - safenode_manager_path: Some(safenode_manager_bin_file.to_path_buf()), - safenode_manager_version: Some(Version::new(0, 1, 8)), + ant_path: Some(safe_bin_file.to_path_buf()), + ant_version: Some(Version::new(0, 75, 1)), + antnode_path: Some(safenode_bin_file.to_path_buf()), + antnode_version: Some(Version::new(0, 75, 2)), + antctl_path: Some(safenode_manager_bin_file.to_path_buf()), + antctl_version: Some(Version::new(0, 1, 8)), }; settings.save(&settings_file.to_path_buf())?; settings_file.assert(predicates::path::is_file()); let settings = Settings::read(&settings_file.to_path_buf())?; - assert_eq!(settings.autonomi_path, Some(safe_bin_file.to_path_buf())); - assert_eq!(settings.autonomi_version, Some(Version::new(0, 75, 1))); - assert_eq!( - settings.safenode_path, - Some(safenode_bin_file.to_path_buf()) - ); - assert_eq!(settings.safenode_version, Some(Version::new(0, 75, 2))); + assert_eq!(settings.ant_path, Some(safe_bin_file.to_path_buf())); + assert_eq!(settings.ant_version, Some(Version::new(0, 75, 1))); + assert_eq!(settings.antnode_path, Some(safenode_bin_file.to_path_buf())); + assert_eq!(settings.antnode_version, Some(Version::new(0, 75, 2))); assert_eq!( - settings.safenode_manager_path, + settings.antctl_path, Some(safenode_manager_bin_file.to_path_buf()) ); - assert_eq!( - settings.safenode_manager_version, - Some(Version::new(0, 1, 8)) - ); + assert_eq!(settings.antctl_version, Some(Version::new(0, 1, 8))); Ok(()) } } diff --git a/src/main.rs b/src/main.rs index 9e2579a..5416c2e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -29,7 +29,7 @@ struct Cli { #[derive(Subcommand)] enum Commands { - /// Install the autonomi client binary. + /// Install the ant client binary. /// /// The location is platform specific: /// - Linux/macOS: $HOME/.local/bin @@ -53,7 +53,7 @@ enum Commands { #[arg(short = 'v', long)] version: Option, }, - /// Install the safenode binary. + /// Install the antnode binary. /// /// The location is platform specific: /// - Linux/macOS: $HOME/.local/bin @@ -77,7 +77,7 @@ enum Commands { #[arg(short = 'v', long)] version: Option, }, - /// Install the safenode-manager binary. + /// Install the antctl binary. /// /// The location is platform specific: /// - Linux/macOS: $HOME/.local/bin @@ -85,8 +85,8 @@ enum Commands { /// /// On Linux/macOS, the Bash shell profile will be modified to add $HOME/.local/bin to the PATH /// variable. On Windows, the user Path variable will be modified to add C:\Users\\autonomi. - #[clap(verbatim_doc_comment)] - NodeManager { + #[clap(verbatim_doc_comment, name = "antctl")] + AntCtl { /// Override the default installation path. /// /// Any directories that don't exist will be created. @@ -120,7 +120,7 @@ async fn main() -> Result<()> { }) => { println!("**************************************"); println!("* *"); - println!("* Installing autonomi *"); + println!("* Installing ant *"); println!("* *"); println!("**************************************"); install::check_prerequisites()?; @@ -133,30 +133,24 @@ async fn main() -> Result<()> { }) => { println!("**************************************"); println!("* *"); - println!("* Installing safenode *"); + println!("* Installing antnode *"); println!("* *"); println!("**************************************"); install::check_prerequisites()?; process_install_cmd(AssetType::Node, path, version, no_modify_shell_profile).await } - Some(Commands::NodeManager { + Some(Commands::AntCtl { path, no_modify_shell_profile, version, }) => { println!("**************************************"); println!("* *"); - println!("* Installing safenode-manager *"); + println!("* Installing antctl *"); println!("* *"); println!("**************************************"); install::check_prerequisites()?; - process_install_cmd( - AssetType::NodeManager, - path, - version, - no_modify_shell_profile, - ) - .await + process_install_cmd(AssetType::AntCtl, path, version, no_modify_shell_profile).await } Some(Commands::Update {}) => { println!("**************************************"); diff --git a/src/update.rs b/src/update.rs index 1e705c0..498d3e9 100644 --- a/src/update.rs +++ b/src/update.rs @@ -51,39 +51,39 @@ mod test { #[test] fn perform_upgrade_assessment_should_indicate_no_previous_installation() -> Result<()> { let settings = Settings { - autonomi_path: None, - autonomi_version: None, - safenode_path: Some(PathBuf::from("/home/chris/.local/bin/safenode")), - safenode_version: Some(Version::new(0, 83, 13)), - safenode_manager_path: Some(PathBuf::from("/home/chris/.local/bin/safenode-manager")), - safenode_manager_version: Some(Version::new(0, 1, 8)), + ant_path: None, + ant_version: None, + antnode_path: Some(PathBuf::from("/home/chris/.local/bin/safenode")), + antnode_version: Some(Version::new(0, 83, 13)), + antctl_path: Some(PathBuf::from("/home/chris/.local/bin/safenode-manager")), + antctl_version: Some(Version::new(0, 1, 8)), }; let decision = perform_update_assessment(&AssetType::Client, &Version::new(0, 78, 26), &settings)?; assert_matches!(decision, UpdateAssessmentResult::NoPreviousInstallation); let settings = Settings { - autonomi_path: Some(PathBuf::from("/home/user/.local/autonomi")), - autonomi_version: Some(Version::new(0, 78, 26)), - safenode_path: None, - safenode_version: None, - safenode_manager_path: Some(PathBuf::from("/home/chris/.local/bin/safenode-manager")), - safenode_manager_version: Some(Version::new(0, 1, 8)), + ant_path: Some(PathBuf::from("/home/user/.local/autonomi")), + ant_version: Some(Version::new(0, 78, 26)), + antnode_path: None, + antnode_version: None, + antctl_path: Some(PathBuf::from("/home/chris/.local/bin/safenode-manager")), + antctl_version: Some(Version::new(0, 1, 8)), }; let decision = perform_update_assessment(&AssetType::Node, &Version::new(0, 83, 13), &settings)?; assert_matches!(decision, UpdateAssessmentResult::NoPreviousInstallation); let settings = Settings { - autonomi_path: Some(PathBuf::from("/home/user/.local/autonomi")), - autonomi_version: Some(Version::new(0, 78, 26)), - safenode_path: Some(PathBuf::from("/home/chris/.local/bin/safenode")), - safenode_version: Some(Version::new(0, 83, 13)), - safenode_manager_path: None, - safenode_manager_version: None, + ant_path: Some(PathBuf::from("/home/user/.local/autonomi")), + ant_version: Some(Version::new(0, 78, 26)), + antnode_path: Some(PathBuf::from("/home/chris/.local/bin/safenode")), + antnode_version: Some(Version::new(0, 83, 13)), + antctl_path: None, + antctl_version: None, }; let decision = - perform_update_assessment(&AssetType::NodeManager, &Version::new(0, 1, 8), &settings)?; + perform_update_assessment(&AssetType::AntCtl, &Version::new(0, 1, 8), &settings)?; assert_matches!(decision, UpdateAssessmentResult::NoPreviousInstallation); Ok(()) @@ -92,12 +92,12 @@ mod test { #[test] fn perform_upgrade_assessment_should_indicate_we_are_at_latest_version() -> Result<()> { let settings = Settings { - autonomi_path: Some(PathBuf::from("/home/user/.local/autonomi")), - autonomi_version: Some(Version::new(0, 78, 26)), - safenode_path: Some(PathBuf::from("/home/chris/.local/bin/safenode")), - safenode_version: Some(Version::new(0, 83, 13)), - safenode_manager_path: Some(PathBuf::from("/home/chris/.local/bin/safenode-manager")), - safenode_manager_version: Some(Version::new(0, 1, 8)), + ant_path: Some(PathBuf::from("/home/user/.local/autonomi")), + ant_version: Some(Version::new(0, 78, 26)), + antnode_path: Some(PathBuf::from("/home/chris/.local/bin/safenode")), + antnode_version: Some(Version::new(0, 83, 13)), + antctl_path: Some(PathBuf::from("/home/chris/.local/bin/safenode-manager")), + antctl_version: Some(Version::new(0, 1, 8)), }; let decision = @@ -109,7 +109,7 @@ mod test { assert_matches!(decision, UpdateAssessmentResult::AtLatestVersion); let decision = - perform_update_assessment(&AssetType::NodeManager, &Version::new(0, 1, 8), &settings)?; + perform_update_assessment(&AssetType::AntCtl, &Version::new(0, 1, 8), &settings)?; assert_matches!(decision, UpdateAssessmentResult::AtLatestVersion); Ok(()) @@ -119,12 +119,12 @@ mod test { fn perform_upgrade_assessment_latest_version_is_less_than_current_should_return_error( ) -> Result<()> { let settings = Settings { - autonomi_path: Some(PathBuf::from("/home/user/.local/autonomi")), - autonomi_version: Some(Version::new(0, 78, 26)), - safenode_path: Some(PathBuf::from("/home/chris/.local/bin/safenode")), - safenode_version: Some(Version::new(0, 83, 13)), - safenode_manager_path: Some(PathBuf::from("/home/chris/.local/bin/safenode-manager")), - safenode_manager_version: Some(Version::new(0, 1, 8)), + ant_path: Some(PathBuf::from("/home/user/.local/autonomi")), + ant_version: Some(Version::new(0, 78, 26)), + antnode_path: Some(PathBuf::from("/home/chris/.local/bin/safenode")), + antnode_version: Some(Version::new(0, 83, 13)), + antctl_path: Some(PathBuf::from("/home/chris/.local/bin/safenode-manager")), + antctl_version: Some(Version::new(0, 1, 8)), }; let result = @@ -148,7 +148,7 @@ mod test { } let result = - perform_update_assessment(&AssetType::NodeManager, &Version::new(0, 1, 7), &settings); + perform_update_assessment(&AssetType::AntCtl, &Version::new(0, 1, 7), &settings); match result { Ok(_) => return Err(eyre!("this test should return an error")), Err(e) => assert_eq!( @@ -164,12 +164,12 @@ mod test { fn perform_upgrade_assessment_should_perform_update_when_latest_patch_version_is_greater( ) -> Result<()> { let settings = Settings { - autonomi_path: Some(PathBuf::from("/home/user/.local/autonomi")), - autonomi_version: Some(Version::new(0, 78, 26)), - safenode_path: Some(PathBuf::from("/home/chris/.local/bin/safenode")), - safenode_version: Some(Version::new(0, 83, 13)), - safenode_manager_path: Some(PathBuf::from("/home/chris/.local/bin/safenode-manager")), - safenode_manager_version: Some(Version::new(0, 1, 7)), + ant_path: Some(PathBuf::from("/home/user/.local/autonomi")), + ant_version: Some(Version::new(0, 78, 26)), + antnode_path: Some(PathBuf::from("/home/chris/.local/bin/safenode")), + antnode_version: Some(Version::new(0, 83, 13)), + antctl_path: Some(PathBuf::from("/home/chris/.local/bin/safenode-manager")), + antctl_version: Some(Version::new(0, 1, 7)), }; let decision = @@ -181,7 +181,7 @@ mod test { assert_matches!(decision, UpdateAssessmentResult::PerformUpdate(_)); let decision = - perform_update_assessment(&AssetType::NodeManager, &Version::new(0, 1, 8), &settings)?; + perform_update_assessment(&AssetType::AntCtl, &Version::new(0, 1, 8), &settings)?; assert_matches!(decision, UpdateAssessmentResult::PerformUpdate(_)); Ok(()) @@ -191,12 +191,12 @@ mod test { fn perform_upgrade_assessment_should_perform_update_when_latest_minor_version_is_greater( ) -> Result<()> { let settings = Settings { - autonomi_path: Some(PathBuf::from("/home/user/.local/autonomi")), - autonomi_version: Some(Version::new(0, 78, 26)), - safenode_path: Some(PathBuf::from("/home/chris/.local/bin/safenode")), - safenode_version: Some(Version::new(0, 83, 13)), - safenode_manager_path: Some(PathBuf::from("/home/chris/.local/bin/safenode-manager")), - safenode_manager_version: Some(Version::new(0, 1, 7)), + ant_path: Some(PathBuf::from("/home/user/.local/autonomi")), + ant_version: Some(Version::new(0, 78, 26)), + antnode_path: Some(PathBuf::from("/home/chris/.local/bin/safenode")), + antnode_version: Some(Version::new(0, 83, 13)), + antctl_path: Some(PathBuf::from("/home/chris/.local/bin/safenode-manager")), + antctl_version: Some(Version::new(0, 1, 7)), }; let decision = @@ -208,7 +208,7 @@ mod test { assert_matches!(decision, UpdateAssessmentResult::PerformUpdate(_)); let decision = - perform_update_assessment(&AssetType::NodeManager, &Version::new(0, 2, 0), &settings)?; + perform_update_assessment(&AssetType::AntCtl, &Version::new(0, 2, 0), &settings)?; assert_matches!(decision, UpdateAssessmentResult::PerformUpdate(_)); Ok(()) @@ -218,12 +218,12 @@ mod test { fn perform_upgrade_assessment_should_perform_update_when_latest_major_version_is_greater( ) -> Result<()> { let settings = Settings { - autonomi_path: Some(PathBuf::from("/home/user/.local/autonomi")), - autonomi_version: Some(Version::new(0, 78, 26)), - safenode_path: Some(PathBuf::from("/home/chris/.local/bin/safenode")), - safenode_version: Some(Version::new(0, 83, 13)), - safenode_manager_path: Some(PathBuf::from("/home/chris/.local/bin/safenode-manager")), - safenode_manager_version: Some(Version::new(0, 1, 7)), + ant_path: Some(PathBuf::from("/home/user/.local/autonomi")), + ant_version: Some(Version::new(0, 78, 26)), + antnode_path: Some(PathBuf::from("/home/chris/.local/bin/safenode")), + antnode_version: Some(Version::new(0, 83, 13)), + antctl_path: Some(PathBuf::from("/home/chris/.local/bin/safenode-manager")), + antctl_version: Some(Version::new(0, 1, 7)), }; let decision = @@ -235,7 +235,7 @@ mod test { assert_matches!(decision, UpdateAssessmentResult::PerformUpdate(_)); let decision = - perform_update_assessment(&AssetType::NodeManager, &Version::new(1, 0, 0), &settings)?; + perform_update_assessment(&AssetType::AntCtl, &Version::new(1, 0, 0), &settings)?; assert_matches!(decision, UpdateAssessmentResult::PerformUpdate(_)); Ok(())