Skip to content

Commit

Permalink
Merge pull request #597 from zancas/remove_do_list_transactions
Browse files Browse the repository at this point in the history
Remove do list transactions
  • Loading branch information
AloeareV authored Oct 17, 2023
2 parents dfa7552 + 9e1a806 commit 070878c
Show file tree
Hide file tree
Showing 7 changed files with 505 additions and 451 deletions.
2 changes: 1 addition & 1 deletion zingoconfig/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ impl ZingoConfig {
pub fn wallet_path_exists(&self) -> bool {
self.get_wallet_path().exists()
}
#[deprecated(since = "1.3.2", note = "this function was renamed for clarity")]
#[deprecated(note = "this method was renamed 'wallet_path_exists' for clarity")]
pub fn wallet_exists(&self) -> bool {
self.wallet_path_exists()
}
Expand Down
5 changes: 3 additions & 2 deletions zingolib/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Deprecated
- LightClient::do_list_transactions

### Added

- lightclient pub fn get_wallet_file_location
- lightclient pub fn get_wallet_dir_location

### Changed

### Deprecated

### Removed
2 changes: 2 additions & 0 deletions zingolib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
deprecations = ["lightclient-deprecated"]
lightclient-deprecated = []
default = ["embed_params"]
embed_params = []

Expand Down
13 changes: 9 additions & 4 deletions zingolib/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,9 @@ impl Command for SeedCommand {
}
}

#[cfg(feature = "lightclient-deprecated")]
struct TransactionsCommand {}
#[cfg(feature = "lightclient-deprecated")]
impl Command for TransactionsCommand {
fn help(&self) -> &'static str {
indoc! {r#"
Expand Down Expand Up @@ -1479,7 +1481,8 @@ impl Command for QuitCommand {
}

pub fn get_commands() -> HashMap<&'static str, Box<dyn Command>> {
let entries: [(&'static str, Box<dyn Command>); 37] = [
#[allow(unused_mut)]
let mut entries: Vec<(&'static str, Box<dyn Command>)> = vec![
(("version"), Box::new(GetVersionCommand {})),
("sync", Box::new(SyncCommand {})),
("syncstatus", Box::new(SyncStatusCommand {})),
Expand Down Expand Up @@ -1512,7 +1515,6 @@ pub fn get_commands() -> HashMap<&'static str, Box<dyn Command>> {
("shield", Box::new(ShieldCommand {})),
("save", Box::new(SaveCommand {})),
("quit", Box::new(QuitCommand {})),
("list", Box::new(TransactionsCommand {})),
("notes", Box::new(NotesCommand {})),
("new", Box::new(NewAddressCommand {})),
("defaultfee", Box::new(DefaultFeeCommand {})),
Expand All @@ -1521,8 +1523,11 @@ pub fn get_commands() -> HashMap<&'static str, Box<dyn Command>> {
("wallet_kind", Box::new(WalletKindCommand {})),
("delete", Box::new(DeleteCommand {})),
];

HashMap::from(entries)
#[cfg(feature = "lightclient-deprecated")]
{
entries.push(("list", Box::new(TransactionsCommand {})));
}
entries.into_iter().collect()
}

pub fn do_user_command(cmd: &str, args: &[&str], lightclient: &LightClient) -> String {
Expand Down
Loading

0 comments on commit 070878c

Please sign in to comment.