Skip to content

Commit 41ed212

Browse files
committed
rename restorewallet to recoverwallet
1 parent c51d449 commit 41ed212

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

client/src/bin/space-cli.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ enum Commands {
7878
/// Generate a new wallet
7979
#[command(name = "createwallet")]
8080
CreateWallet,
81-
/// Restore wallet from mnemonic phrase
82-
#[command(name = "restorewallet")]
83-
RestoreWallet,
81+
/// Recover wallet from mnemonic phrase
82+
#[command(name = "recoverwallet")]
83+
RecoverWallet,
8484
/// Load a wallet
8585
#[command(name = "loadwallet")]
8686
LoadWallet,
@@ -590,12 +590,12 @@ async fn handle_commands(cli: &SpaceCli, command: Commands) -> Result<(), Client
590590
println!("This is the ONLY time it will be shown:");
591591
println!("{}", &response);
592592
}
593-
Commands::RestoreWallet => {
593+
Commands::RecoverWallet => {
594594
print!("Enter mnemonic phrase: ");
595595
io::stdout().flush().unwrap();
596596
let mut mnemonic = String::new();
597597
io::stdin().read_line(&mut mnemonic).unwrap();
598-
cli.client.wallet_restore(&cli.wallet, mnemonic).await?;
598+
cli.client.wallet_recover(&cli.wallet, mnemonic).await?;
599599
}
600600
Commands::LoadWallet => {
601601
cli.client.wallet_load(&cli.wallet).await?;

client/src/rpc.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@ pub trait Rpc {
232232
#[method(name = "walletcreate")]
233233
async fn wallet_create(&self, name: &str) -> Result<String, ErrorObjectOwned>;
234234

235-
#[method(name = "walletrestore")]
236-
async fn wallet_restore(&self, name: &str, mnemonic: String) -> Result<(), ErrorObjectOwned>;
235+
#[method(name = "walletrecover")]
236+
async fn wallet_recover(&self, name: &str, mnemonic: String) -> Result<(), ErrorObjectOwned>;
237237

238238
#[method(name = "walletsendrequest")]
239239
async fn wallet_send_request(
@@ -505,7 +505,7 @@ impl WalletManager {
505505
Ok(mnemonic.to_string())
506506
}
507507

508-
pub async fn restore_wallet(&self, client: &reqwest::Client, name: &str, mnemonic: &str) -> anyhow::Result<()> {
508+
pub async fn recover_wallet(&self, client: &reqwest::Client, name: &str, mnemonic: &str) -> anyhow::Result<()> {
509509
let start_block = self.get_wallet_start_block(client).await?;
510510
self.setup_new_wallet(name.to_string(), mnemonic.to_string(), start_block)?;
511511
self.load_wallet(name).await?;
@@ -927,9 +927,9 @@ impl RpcServer for RpcServerImpl {
927927
})
928928
}
929929

930-
async fn wallet_restore(&self, name: &str, mnemonic: String) -> Result<(), ErrorObjectOwned> {
930+
async fn wallet_recover(&self, name: &str, mnemonic: String) -> Result<(), ErrorObjectOwned> {
931931
self.wallet_manager
932-
.restore_wallet(&self.client, name, &mnemonic)
932+
.recover_wallet(&self.client, name, &mnemonic)
933933
.await
934934
.map_err(|error| {
935935
ErrorObjectOwned::owned(RPC_WALLET_NOT_LOADED, error.to_string(), None::<String>)

0 commit comments

Comments
 (0)