mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-11-29 12:06:35 -05:00
feat(gui, tauri): Accept --testnet flag, default to mainnet (#106)
This PR tackles #92 - Add the `tauri-plugin-cli` (only on desktop) - Check in the frontend if the `--testnet` flag is set. If it's set we pass `testnet=true` to the `initialize_context` command on invokation - We add the `vite-plugin-top-level-await` to allow top level await in all browsers - Remove the `bitcoin_confirmation_target` from settings for simplicity
This commit is contained in:
parent
9e94dca7aa
commit
83f831ccac
23 changed files with 311 additions and 53 deletions
|
|
@ -283,17 +283,27 @@ impl Database for SqliteDatabase {
|
|||
|
||||
let result = rows
|
||||
.iter()
|
||||
.map(|row| {
|
||||
let swap_id = Uuid::from_str(&row.swap_id)?;
|
||||
.filter_map(|row| {
|
||||
let swap_id = match Uuid::from_str(&row.swap_id) {
|
||||
Ok(id) => id,
|
||||
Err(e) => {
|
||||
tracing::error!(swap_id = %row.swap_id, error = ?e, "Failed to parse UUID");
|
||||
return None;
|
||||
}
|
||||
};
|
||||
let state = match serde_json::from_str::<Swap>(&row.state) {
|
||||
Ok(a) => Ok(State::from(a)),
|
||||
Err(e) => Err(e),
|
||||
}?;
|
||||
Ok((swap_id, state))
|
||||
})
|
||||
.collect::<Result<Vec<(Uuid, State)>>>();
|
||||
Ok(a) => State::from(a),
|
||||
Err(e) => {
|
||||
tracing::error!(swap_id = %swap_id, error = ?e, "Failed to deserialize state");
|
||||
return None;
|
||||
}
|
||||
};
|
||||
|
||||
result
|
||||
Some((swap_id, state))
|
||||
})
|
||||
.collect::<Vec<(Uuid, State)>>();
|
||||
|
||||
Ok(result)
|
||||
}
|
||||
|
||||
async fn get_states(&self, swap_id: Uuid) -> Result<Vec<State>> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue