mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-08-24 22:19:37 -04:00
fix: Issues with 1.1.0-rc (#328)
* bump(rust): Toolchain to 1.82 * bump(tauri): Bump some Tauri peer-dependencies * fix(gui): Prefer maker with known version, bump MIN_ASB_VERSION to 1.1.0-rc.3 * amend: CHANGELOG.md
This commit is contained in:
parent
0c4de7e4cd
commit
e66881d6eb
12 changed files with 411 additions and 538 deletions
2
.github/workflows/build-release-binaries.yml
vendored
2
.github/workflows/build-release-binaries.yml
vendored
|
@ -66,7 +66,7 @@ jobs:
|
||||||
|
|
||||||
- uses: dtolnay/rust-toolchain@master
|
- uses: dtolnay/rust-toolchain@master
|
||||||
with:
|
with:
|
||||||
toolchain: "1.81"
|
toolchain: "1.82"
|
||||||
|
|
||||||
- name: Cross Build ${{ matrix.target }} ${{ matrix.bin }} binary
|
- name: Cross Build ${{ matrix.target }} ${{ matrix.bin }} binary
|
||||||
if: matrix.target == 'armv7-unknown-linux-gnueabihf'
|
if: matrix.target == 'armv7-unknown-linux-gnueabihf'
|
||||||
|
|
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
|
@ -19,7 +19,7 @@ jobs:
|
||||||
|
|
||||||
- uses: dtolnay/rust-toolchain@master
|
- uses: dtolnay/rust-toolchain@master
|
||||||
with:
|
with:
|
||||||
toolchain: "1.81"
|
toolchain: "1.82"
|
||||||
components: clippy,rustfmt
|
components: clippy,rustfmt
|
||||||
|
|
||||||
- uses: Swatinem/rust-cache@v2.7.3
|
- uses: Swatinem/rust-cache@v2.7.3
|
||||||
|
@ -127,7 +127,7 @@ jobs:
|
||||||
|
|
||||||
- uses: dtolnay/rust-toolchain@master
|
- uses: dtolnay/rust-toolchain@master
|
||||||
with:
|
with:
|
||||||
toolchain: "1.81"
|
toolchain: "1.82"
|
||||||
targets: armv7-unknown-linux-gnueabihf
|
targets: armv7-unknown-linux-gnueabihf
|
||||||
|
|
||||||
- name: Install dependencies required by Tauri v2 (ubuntu only)
|
- name: Install dependencies required by Tauri v2 (ubuntu only)
|
||||||
|
|
2
.github/workflows/draft-new-release.yml
vendored
2
.github/workflows/draft-new-release.yml
vendored
|
@ -53,7 +53,7 @@ jobs:
|
||||||
id: make-commit
|
id: make-commit
|
||||||
env:
|
env:
|
||||||
DPRINT_VERSION: "0.39.1"
|
DPRINT_VERSION: "0.39.1"
|
||||||
RUST_TOOLCHAIN: "1.81"
|
RUST_TOOLCHAIN: "1.82"
|
||||||
run: |
|
run: |
|
||||||
rustup component add rustfmt --toolchain "$RUST_TOOLCHAIN-x86_64-unknown-linux-gnu"
|
rustup component add rustfmt --toolchain "$RUST_TOOLCHAIN-x86_64-unknown-linux-gnu"
|
||||||
curl -fsSL https://dprint.dev/install.sh | sh -s $DPRINT_VERSION
|
curl -fsSL https://dprint.dev/install.sh | sh -s $DPRINT_VERSION
|
||||||
|
|
|
@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
- GUI: Discourage swapping with makers running `< 1.1.0-rc.3` because the bdk upgrade introduced a breaking change.
|
||||||
|
- GUI: Fix an issue where the auto updater would incorrectly throw an error
|
||||||
|
|
||||||
## [1.1.0-rc.3] - 2025-05-18
|
## [1.1.0-rc.3] - 2025-05-18
|
||||||
|
|
||||||
- Breaking Change(Makers): Please complete all pending swaps, then upgrade as soon as possible. Takers might not be able to taker your offers until you upgrade your asb instance.
|
- Breaking Change(Makers): Please complete all pending swaps, then upgrade as soon as possible. Takers might not be able to taker your offers until you upgrade your asb instance.
|
||||||
|
|
851
Cargo.lock
generated
851
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,5 @@
|
||||||
[toolchain]
|
[toolchain]
|
||||||
# also update this in the readme, changelog, and github actions
|
# also update this in the readme, changelog, and github actions
|
||||||
channel = "1.81"
|
channel = "1.82"
|
||||||
components = ["clippy"]
|
components = ["clippy"]
|
||||||
targets = ["armv7-unknown-linux-gnueabihf"]
|
targets = ["armv7-unknown-linux-gnueabihf"]
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
"@tauri-apps/api": "^2.0.0",
|
"@tauri-apps/api": "^2.0.0",
|
||||||
"@tauri-apps/plugin-cli": "^2.0.0",
|
"@tauri-apps/plugin-cli": "^2.0.0",
|
||||||
"@tauri-apps/plugin-clipboard-manager": "^2.0.0",
|
"@tauri-apps/plugin-clipboard-manager": "^2.0.0",
|
||||||
"@tauri-apps/plugin-opener": "^2.2.5",
|
"@tauri-apps/plugin-opener": "^2.0.0",
|
||||||
"@tauri-apps/plugin-process": "^2.0.0",
|
"@tauri-apps/plugin-process": "^2.0.0",
|
||||||
"@tauri-apps/plugin-shell": "^2.0.0",
|
"@tauri-apps/plugin-shell": "^2.0.0",
|
||||||
"@tauri-apps/plugin-store": "^2.0.0",
|
"@tauri-apps/plugin-store": "^2.0.0",
|
||||||
|
|
|
@ -7,9 +7,9 @@ import {
|
||||||
SatsAmount,
|
SatsAmount,
|
||||||
} from "renderer/components/other/Units";
|
} from "renderer/components/other/Units";
|
||||||
import { getMarkup, satsToBtc, secondsToDays } from "utils/conversionUtils";
|
import { getMarkup, satsToBtc, secondsToDays } from "utils/conversionUtils";
|
||||||
import { isMakerOutdated } from 'utils/multiAddrUtils';
|
import { isMakerOutdated, isMakerVersionOutdated } from 'utils/multiAddrUtils';
|
||||||
import WarningIcon from '@material-ui/icons/Warning';
|
import WarningIcon from '@material-ui/icons/Warning';
|
||||||
import { useAppSelector } from "store/hooks";
|
import { useAppSelector, useMakerVersion } from "store/hooks";
|
||||||
import IdentIcon from "renderer/components/icons/IdentIcon";
|
import IdentIcon from "renderer/components/icons/IdentIcon";
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
|
|
|
@ -3,7 +3,8 @@ import { Multiaddr } from "multiaddr";
|
||||||
import semver from "semver";
|
import semver from "semver";
|
||||||
import { isTestnet } from "store/config";
|
import { isTestnet } from "store/config";
|
||||||
|
|
||||||
const MIN_ASB_VERSION = "1.0.0-alpha.1"
|
// const MIN_ASB_VERSION = "1.0.0-alpha.1" // First version to support new libp2p protocol
|
||||||
|
const MIN_ASB_VERSION = "1.1.0-rc.3" // First version with support for bdk > 1.0
|
||||||
|
|
||||||
export function providerToConcatenatedMultiAddr(provider: Maker) {
|
export function providerToConcatenatedMultiAddr(provider: Maker) {
|
||||||
return new Multiaddr(provider.multiAddr)
|
return new Multiaddr(provider.multiAddr)
|
||||||
|
@ -17,13 +18,19 @@ export function isMakerOnCorrectNetwork(
|
||||||
return provider.testnet === isTestnet();
|
return provider.testnet === isTestnet();
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isMakerOutdated(provider: ExtendedMakerStatus): boolean {
|
export function isMakerOutdated(maker: ExtendedMakerStatus): boolean {
|
||||||
if (provider.version != null) {
|
if (maker.version != null) {
|
||||||
if (semver.satisfies(provider.version, `>=${MIN_ASB_VERSION}`))
|
if (isMakerVersionOutdated(maker.version))
|
||||||
return false;
|
return true;
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
// Do not mark a maker as outdated if it doesn't have a version
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function isMakerVersionOutdated(version: string): boolean {
|
||||||
|
// This checks if the version is less than the minimum version
|
||||||
|
// we use .compare(...) instead of .satisfies(...) because satisfies(...)
|
||||||
|
// does not work with pre-release versions
|
||||||
|
return semver.compare(version, MIN_ASB_VERSION) === -1;
|
||||||
|
}
|
|
@ -1,31 +1,29 @@
|
||||||
import { ExtendedMakerStatus } from "models/apiModel";
|
import { ExtendedMakerStatus } from "models/apiModel";
|
||||||
import { isMakerOnCorrectNetwork, isMakerOutdated } from "./multiAddrUtils";
|
import { isMakerOnCorrectNetwork, isMakerOutdated } from "./multiAddrUtils";
|
||||||
|
import _ from 'lodash';
|
||||||
|
|
||||||
export function sortMakerList(list: ExtendedMakerStatus[]) {
|
export function sortMakerList(list: ExtendedMakerStatus[]) {
|
||||||
return list
|
return _(list)
|
||||||
// Filter out makers that are on the wrong network (testnet / mainnet)
|
// Filter out makers that are on the wrong network (testnet / mainnet)
|
||||||
.filter(isMakerOnCorrectNetwork)
|
.filter(isMakerOnCorrectNetwork)
|
||||||
.concat()
|
|
||||||
// Sort by criteria
|
// Sort by criteria
|
||||||
.sort((firstEl, secondEl) => {
|
.orderBy(
|
||||||
// If either provider is outdated, prioritize the one that isn't
|
[
|
||||||
if (isMakerOutdated(firstEl) && !isMakerOutdated(secondEl)) return 1;
|
// Prefer makers that have a 'version' attribute
|
||||||
if (!isMakerOutdated(firstEl) && isMakerOutdated(secondEl)) return -1;
|
// If we don't have a version, we cannot clarify if it's outdated or not
|
||||||
|
m => (m.version ? 0 : 1),
|
||||||
// If neither of them have a relevancy score or they are the same, sort by price
|
// Prefer makers that are not outdated
|
||||||
if (firstEl.relevancy == secondEl.relevancy) {
|
m => (isMakerOutdated(m) ? 1 : 0),
|
||||||
return firstEl.price - secondEl.price;
|
// Prefer makers that have a relevancy score
|
||||||
}
|
m => (m.relevancy == null ? 1 : 0),
|
||||||
|
// Prefer makers with a higher relevancy score
|
||||||
// If only one of the two doesn't have a relevancy score, prioritize the one that does
|
m => -(m.relevancy ?? 0),
|
||||||
if (firstEl.relevancy == null) return 1;
|
// Prefer makers with a lower price
|
||||||
if (secondEl.relevancy == null) return -1;
|
m => m.price
|
||||||
|
],
|
||||||
// Otherwise, sort by relevancy score
|
['asc', 'asc', 'asc', 'asc', 'asc']
|
||||||
return secondEl.relevancy - firstEl.relevancy;
|
|
||||||
})
|
|
||||||
// Remove duplicate makers
|
|
||||||
.filter((provider, index, self) =>
|
|
||||||
index === self.findIndex((p) => p.peerId === provider.peerId)
|
|
||||||
)
|
)
|
||||||
|
// Remove duplicate makers
|
||||||
|
.uniqBy(m => m.peerId)
|
||||||
|
.value();
|
||||||
}
|
}
|
|
@ -850,10 +850,10 @@
|
||||||
dependencies:
|
dependencies:
|
||||||
"@tauri-apps/api" "^2.0.0"
|
"@tauri-apps/api" "^2.0.0"
|
||||||
|
|
||||||
"@tauri-apps/plugin-opener@^2.2.5":
|
"@tauri-apps/plugin-opener@^2.0.0":
|
||||||
version "2.2.5"
|
version "2.2.6"
|
||||||
resolved "https://registry.yarnpkg.com/@tauri-apps/plugin-opener/-/plugin-opener-2.2.5.tgz#928b917d28d3e8b5bafb90f5f91fb0ed20c27fd4"
|
resolved "https://registry.yarnpkg.com/@tauri-apps/plugin-opener/-/plugin-opener-2.2.6.tgz#a4dc328541708d40e3bb969231974353a4ad6983"
|
||||||
integrity sha512-hHsJ9RPWpZvZEPVFaL+d25gABMUMOf/A6ESXnvf/ii9guTukj58WXsAE/SOysXRIhej7kseRCxnOnIMpSCdUsQ==
|
integrity sha512-bSdkuP71ZQRepPOn8BOEdBKYJQvl6+jb160QtJX/i2H9BF6ZySY/kYljh76N2Ne5fJMQRge7rlKoStYQY5Jq1w==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@tauri-apps/api" "^2.0.0"
|
"@tauri-apps/api" "^2.0.0"
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ name = "unstoppableswap_gui_rs_lib"
|
||||||
crate-type = [ "lib", "cdylib", "staticlib" ]
|
crate-type = [ "lib", "cdylib", "staticlib" ]
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
tauri-build = { version = "2.0", features = [ "config-json5" ] }
|
tauri-build = { version = "^2.0.0", features = [ "config-json5" ] }
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1"
|
anyhow = "1"
|
||||||
|
@ -23,11 +23,11 @@ swap = { path = "../swap", features = [ "tauri" ] }
|
||||||
sysinfo = "=0.32.1"
|
sysinfo = "=0.32.1"
|
||||||
tauri = { version = "^2.0.0", features = [ "config-json5" ] }
|
tauri = { version = "^2.0.0", features = [ "config-json5" ] }
|
||||||
tauri-plugin-clipboard-manager = "^2.0.0"
|
tauri-plugin-clipboard-manager = "^2.0.0"
|
||||||
tauri-plugin-opener = "2.2.5"
|
tauri-plugin-opener = "^2.0.0"
|
||||||
tauri-plugin-process = "^2.0.0"
|
tauri-plugin-process = "^2.0.0"
|
||||||
tauri-plugin-shell = "^2.0.0"
|
tauri-plugin-shell = "^2.0.0"
|
||||||
tauri-plugin-store = "^2.0.0"
|
tauri-plugin-store = "^2.0.0"
|
||||||
tauri-plugin-updater = "^2.1.0"
|
tauri-plugin-updater = "^2.0.0"
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
uuid = "1.16.0"
|
uuid = "1.16.0"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue