801: Update monero wallet rpc r=rishflab a=rishflab

 #794

Co-authored-by: bors[bot] <26634292+bors[bot]@users.noreply.github.com>
Co-authored-by: rishflab <rishflab@hotmail.com>
This commit is contained in:
bors[bot] 2021-10-07 01:30:51 +00:00 committed by GitHub
commit 7be6655d73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 4 deletions

View File

@ -20,6 +20,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
The sqlite database filed is named `sqlite` and is found in the data directory.
You can print the data directory using the `config` subcommand.
The schema can be found here [here](swap/migrations/20210903050345_create_swaps_table.sql).
- Upgraded monero-wallet-rpc to use version v0.17.2.3.
This resolved a bug for a user where the redeemed monero transaction was not being accepted by the v0.17.2.0.
#### Database migration guide

View File

@ -18,17 +18,17 @@ use tokio_util::io::StreamReader;
compile_error!("unsupported operating system");
#[cfg(target_os = "macos")]
const DOWNLOAD_URL: &str = "http://downloads.getmonero.org/cli/monero-mac-x64-v0.17.2.0.tar.bz2";
const DOWNLOAD_URL: &str = "http://downloads.getmonero.org/cli/monero-mac-x64-v0.17.2.3.tar.bz2";
#[cfg(all(target_os = "linux", target_arch = "x86_64"))]
const DOWNLOAD_URL: &str = "https://downloads.getmonero.org/cli/monero-linux-x64-v0.17.2.0.tar.bz2";
const DOWNLOAD_URL: &str = "https://downloads.getmonero.org/cli/monero-linux-x64-v0.17.2.3.tar.bz2";
#[cfg(all(target_os = "linux", target_arch = "arm"))]
const DOWNLOAD_URL: &str =
"https://downloads.getmonero.org/cli/monero-linux-armv7-v0.17.2.0.tar.bz2";
"https://downloads.getmonero.org/cli/monero-linux-armv7-v0.17.2.3.tar.bz2";
#[cfg(target_os = "windows")]
const DOWNLOAD_URL: &str = "https://downloads.getmonero.org/cli/monero-win-x64-v0.17.2.0.zip";
const DOWNLOAD_URL: &str = "https://downloads.getmonero.org/cli/monero-win-x64-v0.17.2.3.zip";
#[cfg(any(target_os = "macos", target_os = "linux"))]
const PACKED_FILE: &str = "monero-wallet-rpc";
@ -72,6 +72,23 @@ impl WalletRpc {
remove_file(monero_wallet_rpc.archive_path()).await?;
}
// If the monero-wallet-rpc exists, identify it's version and delete it if the
// version is not the v0.17.2.3-release. Unfortunately monero does no
// provide per file checksums which would of been a better solution.
if monero_wallet_rpc.exec_path().exists() {
let output = Command::new(monero_wallet_rpc.exec_path())
.env("LANG", "en_AU.UTF-8")
.stdout(Stdio::piped())
.kill_on_drop(true)
.arg("--version")
.output()
.await?;
let version_string = String::from_utf8_lossy(&output.stdout);
if !version_string.contains("v0.17.2.3-release") {
remove_file(monero_wallet_rpc.exec_path()).await?;
}
}
if !monero_wallet_rpc.exec_path().exists() {
let mut options = OpenOptions::new();
let mut file = options