Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a4c8bee
add cooperative redeem key export to asb-controller, add XmrCooperati…
Einliterflasche Sep 11, 2025
7bd6659
remove state XmrCooperativelyRedeemable, go to BtcRedeemed instead
Einliterflasche Sep 11, 2025
748d561
fix: make logs in terminal colored again
Einliterflasche Sep 12, 2025
c1513de
fix: gui won't start on testnet
Einliterflasche Sep 12, 2025
c5581a0
fix: gui quirks with monero seed selection
Einliterflasche Sep 13, 2025
a96d4be
add migration to bring S_a_monero into later states, use it to verify…
Einliterflasche Sep 13, 2025
1a219e5
improve gui code
Einliterflasche Sep 13, 2025
5ee314a
add gui for manual cooperative redeem (untested)
Einliterflasche Sep 13, 2025
5f20b8d
add justfile command for running swap controller
Einliterflasche Sep 13, 2025
4775dec
fix: don't show second BTC after bitcoin balance
Einliterflasche Sep 13, 2025
969f748
add asb rpc server to test context, integration test for manual coope…
Einliterflasche Sep 13, 2025
cf1f760
add integration test for malicious cooperative redeem check
Einliterflasche Sep 14, 2025
943fce3
fix: code smells
Einliterflasche Sep 14, 2025
08242ec
improve gui code, use alert to show outcome
Einliterflasche Sep 14, 2025
9ed60ac
disable attempt button while attempt is in progress
Einliterflasche Sep 14, 2025
0b31cd8
use template string
Einliterflasche Sep 14, 2025
0e8c0c1
problem: asb not registering with rendezvous points on stagenet (conn…
Einliterflasche Sep 14, 2025
9066065
fix integration tests, resume swap from tauri_command after
Einliterflasche Sep 17, 2025
c79877b
Merge branch 'master' into feat/manual-cooperative-redeem
Einliterflasche Sep 18, 2025
9945bb2
fix tauri missing libwinpthread-1.dll
Einliterflasche Sep 19, 2025
d08cdb9
satisfy clippy
Einliterflasche Sep 25, 2025
5b16ee1
Merge branch 'master' into feat/manual-cooperative-redeem
Einliterflasche Sep 27, 2025
1997f18
fix test compilation errors
Einliterflasche Sep 27, 2025
67e8db3
fix tests
Einliterflasche Sep 27, 2025
45bee3d
add asb command manual-recovery export-cooperative-redeem-key --swap-…
Einliterflasche Oct 13, 2025
fa23dfa
fix logic bug
Einliterflasche Oct 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ jobs:
test_name: alice_empty_balance_after_started_btc_early_refund
- package: swap
test_name: alice_broken_wallet_rpc_after_started_btc_early_refund
- package: swap
test_name: manual_cooperative_redeem
- package: swap
test_name: manual_cooperative_redeem_malicious_key.rs
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Test Name Incorrectly Includes File Extension

The test_name manual_cooperative_redeem_malicious_key.rs in the CI workflow incorrectly includes the .rs file extension. Test names typically reference the test function, not the filename, and this inconsistency may prevent the CI from running the test.

Fix in Cursor Fix in Web


runs-on: ubuntu-22.04
if: github.event_name == 'push' || !github.event.pull_request.draft
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@
"rust-analyzer.cargo.extraEnv": {
"CARGO_TARGET_DIR": "target-check"
}
}
}
25 changes: 14 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ bdk_electrum = { version = "0.23.0", default-features = false }
bdk_wallet = "2.0.0"
bitcoin = { version = "0.32", features = ["rand", "serde"] }

# Crypto
curve25519-dalek = { package = "curve25519-dalek-ng", version = "4" }

# Monero
monero-oxide = { git = "https://github.com/monero-oxide/monero-oxide", default-features = false, features = ["std"] }

swap-serde = { path = "./swap-serde" }

anyhow = "1"
backoff = { version = "0.4", features = ["futures", "tokio"] }
futures = { version = "0.3", default-features = false, features = ["std"] }
Expand Down
10 changes: 9 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,17 @@ swap:
cargo build -p swap-asb --bin asb && cd swap && cargo build --bin=swap

# Run the asb on testnet
asb-testnet:
asb:
ASB_DEV_ADDR_OUTPUT_PATH="$(pwd)/src-gui/.env.development" cargo run -p swap-asb --bin asb -- --trace --testnet start --rpc-bind-port 9944 --rpc-bind-host 0.0.0.0

# Run the asb on mainnet (only use for testing)
asb-mainnet:
cargo run -p swap-asb --bin asb -- --trace start --rpc-bind-port 9944 --rpc-bind-host 0.0.0.0

# Run the asb controller connecting to your already running asb
asb-controller:
cargo run -p swap-controller --bin asb-controller -- --url http://127.0.0.1:9944

# Updates our submodules (currently only Monero C++ codebase)
update_submodules:
cd monero-sys && git submodule update --init --recursive --force
Expand Down
1 change: 0 additions & 1 deletion monero-rpc-pool/src/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ use tokio::{
};

use tokio_rustls::rustls::{
self,
client::danger::{HandshakeSignatureValid, ServerCertVerified, ServerCertVerifier},
pki_types::{CertificateDer, ServerName, UnixTime},
DigitallySignedStruct, Error as TlsError, SignatureScheme,
Expand Down
2 changes: 1 addition & 1 deletion monero-seed/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ curve25519-dalek = { version = "4", default-features = false, features = ["alloc

[dev-dependencies]
hex = { version = "0.4", default-features = false, features = ["std"] }
monero-oxide = { git = "https://github.com/monero-oxide/monero-oxide", default-features = false, features = ["std"] }
monero-oxide = { workspace = true }

[features]
std = [
Expand Down
2 changes: 1 addition & 1 deletion monero-seed/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use zeroize::Zeroizing;

use curve25519_dalek::scalar::Scalar;

use monero_primitives::keccak256;
use monero_oxide::primitives::keccak256;

use crate::*;

Expand Down
22 changes: 11 additions & 11 deletions monero-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ fn main() {
.display()
.to_string();
config.define("CMAKE_TOOLCHAIN_FILE", toolchain_file.clone());
println!("cargo:warning=Using toolchain file: {}", toolchain_file);
println!("cargo:debug=Using toolchain file: {}", toolchain_file);

let depends_lib_dir = contrib_depends_dir.join(format!("{}/lib", target));

Expand Down Expand Up @@ -414,7 +414,7 @@ fn compile_dependencies(
"aarch64-apple-ios-sim" => "aarch64-apple-iossimulator".to_string(),
_ => target,
};
println!("cargo:warning=Building for target: {}", target);
println!("cargo:debug=Building for target: {}", target);

match target.as_str() {
"x86_64-apple-darwin"
Expand All @@ -431,7 +431,7 @@ fn compile_dependencies(
}

println!(
"cargo:warning=Running make HOST={} in contrib/depends",
"cargo:debug=Running make HOST={} in contrib/depends",
target
);

Expand Down Expand Up @@ -496,14 +496,14 @@ fn execute_child_with_pipe(
// Spawn threads to handle stdout and stderr
let stdout_handle = thread::spawn(move || {
let reader = BufReader::new(stdout);
for line in reader.lines().flatten() {
for line in reader.lines().map_while(Result::ok) {
println!("cargo:debug={}{}", &prefix_clone, line);
}
});

let stderr_handle = thread::spawn(move || {
let reader = BufReader::new(stderr);
for line in reader.lines().flatten() {
for line in reader.lines().map_while(Result::ok) {
println!("cargo:debug={}{}", &prefix, line);
}
});
Expand All @@ -528,7 +528,7 @@ fn apply_patches() -> Result<(), Box<dyn std::error::Error>> {

for embedded in EMBEDDED_PATCHES {
println!(
"cargo:warning=Processing embedded patch: {} ({})",
"cargo:debug=Processing embedded patch: {} ({})",
embedded.name, embedded.description
);

Expand All @@ -541,14 +541,14 @@ fn apply_patches() -> Result<(), Box<dyn std::error::Error>> {
}

println!(
"cargo:warning=Found {} file(s) in patch {}",
"cargo:debug=Found {} file(s) in patch {}",
file_patches.len(),
embedded.name
);

// Apply each file patch individually
for (file_path, patch_content) in file_patches {
println!("cargo:warning=Applying patch to file: {}", file_path);
println!("cargo:debug=Applying patch to file: {}", file_path);

// Parse the individual file patch
let patch = diffy::Patch::from_str(&patch_content)
Expand All @@ -566,7 +566,7 @@ fn apply_patches() -> Result<(), Box<dyn std::error::Error>> {
// Check if patch is already applied by trying to reverse it
if diffy::apply(&current, &patch.reverse()).is_ok() {
println!(
"cargo:warning=Patch for {} already applied – skipping",
"cargo:debug=Patch for {} already applied – skipping",
file_path
);
continue;
Expand All @@ -578,11 +578,11 @@ fn apply_patches() -> Result<(), Box<dyn std::error::Error>> {
fs::write(&target_path, patched)
.map_err(|e| format!("Failed to write {}: {}", file_path, e))?;

println!("cargo:warning=Successfully applied patch to: {}", file_path);
println!("cargo:debug=Successfully applied patch to: {}", file_path);
}

println!(
"cargo:warning=Successfully applied all file patches for: {} ({})",
"cargo:debug=Successfully applied all file patches for: {} ({})",
embedded.name, embedded.description
);
}
Expand Down
12 changes: 10 additions & 2 deletions monero-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@ pub struct Daemon {
pub ssl: bool,
}

impl TryFrom<String> for Daemon {
impl<'a> TryFrom<&'a str> for Daemon {
type Error = anyhow::Error;

fn try_from(address: String) -> Result<Self, Self::Error> {
fn try_from(address: &'a str) -> Result<Self, Self::Error> {
let url = Url::parse(&address).context("Failed to parse daemon URL")?;

let hostname = url
Expand All @@ -177,6 +177,14 @@ impl TryFrom<String> for Daemon {
}
}

impl<'a> TryFrom<&'a String> for Daemon {
type Error = anyhow::Error;

fn try_from(value: &'a String) -> std::result::Result<Self, Self::Error> {
Daemon::try_from(value.as_str())
}
}

impl Daemon {
/// Try to convert the daemon configuration to a URL
pub fn to_url_string(&self) -> String {
Expand Down
5 changes: 1 addition & 4 deletions monero-sys/tests/sign_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ async fn test_sign_message() {
.init();

let temp_dir = tempfile::tempdir().unwrap();
let daemon = Daemon {
address: PLACEHOLDER_NODE.into(),
ssl: false,
};
let daemon = Daemon::try_from(PLACEHOLDER_NODE).unwrap();

let wallet_name = "test_signing_wallet";
let wallet_path = temp_dir.path().join(wallet_name).display().to_string();
Expand Down
5 changes: 1 addition & 4 deletions monero-sys/tests/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ async fn main() {
.init();

let temp_dir = tempfile::tempdir().unwrap();
let daemon = Daemon {
address: STAGENET_REMOTE_NODE.into(),
ssl: true,
};
let daemon = Daemon::try_from(STAGENET_REMOTE_NODE).unwrap();

let wallet_name = "recovered_wallet";
let wallet_path = temp_dir.path().join(wallet_name).display().to_string();
Expand Down
5 changes: 1 addition & 4 deletions monero-sys/tests/special_paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ async fn test_wallet_with_special_paths() {
"path-with-hyphen",
];

let daemon = Daemon {
address: "https://moneronode.org:18081".into(),
ssl: true,
};
let daemon = Daemon::try_from("https://moneronode.org:18081").unwrap();

let futures = special_paths
.into_iter()
Expand Down
5 changes: 1 addition & 4 deletions monero-sys/tests/wallet_closing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ async fn main() {
.init();

let temp_dir = tempfile::tempdir().unwrap();
let daemon = Daemon {
address: STAGENET_REMOTE_NODE.into(),
ssl: true,
};
let daemon = Daemon::try_from(STAGENET_REMOTE_NODE).unwrap();

{
let wallet = WalletHandle::open_or_create(
Expand Down
2 changes: 1 addition & 1 deletion src-gui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@tauri-apps/api": "^2.8.0",
"@tauri-apps/plugin-cli": "^2.4.0",
"@tauri-apps/plugin-clipboard-manager": "^2.3.0",
"@tauri-apps/plugin-dialog": "^2.0.0",
"@tauri-apps/plugin-dialog": "2.4.0",
"@tauri-apps/plugin-opener": "^2.5.0",
"@tauri-apps/plugin-process": "^2.3.0",
"@tauri-apps/plugin-shell": "^2.3.0",
Expand Down
Loading