Add option to specify backup path (#228)

* feat: add backup_path to backup method

* Re-generate bindings with flutter_rust_bridge`@ 2.0.0-dev.35

* Rebased on main

* Update backup path description

---------

Co-authored-by: ok300 <106775972+ok300@users.noreply.github.com>
This commit is contained in:
yse
2024-05-27 21:01:49 +02:00
committed by GitHub
parent 6ef5701660
commit 2fcefee45e
21 changed files with 366 additions and 58 deletions

View File

@@ -43,7 +43,10 @@ pub(crate) enum Command {
/// Empties the encrypted transaction cache
EmptyCache,
/// Backs up the current pending swaps
Backup,
Backup {
#[arg(short, long)]
backup_path: Option<String>,
},
/// Retrieve a list of backups
Restore {
#[arg(short, long)]
@@ -159,8 +162,8 @@ pub(crate) async fn handle_command(
sdk.empty_wallet_cache()?;
command_result!("Cache emptied successfully")
}
Command::Backup => {
sdk.backup()?;
Command::Backup { backup_path } => {
sdk.backup(BackupRequest { backup_path })?;
command_result!("Backup created successfully!")
}
Command::Restore { backup_path } => {