Skip to content

Commit

Permalink
testing-utils: Fix dead_code lints
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhail Zabaluev committed Sep 14, 2021
1 parent 63dd573 commit 4c29f7b
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
Expand Up @@ -161,7 +161,7 @@ impl Settings {
}]);

self.legacy_wallets
.insert(template.alias().clone(), template.clone());
.insert(template.alias().to_string(), template.clone());
self.block0.initial.push(legacy_fragment);
}
}
Expand Down
Expand Up @@ -24,7 +24,11 @@ impl ExternalWalletTemplate {
&self.value
}

pub fn address(&self) -> String {
self.address.clone()
pub fn address(&self) -> &str {
&self.address
}

pub fn alias(&self) -> &str {
&self.alias
}
}
Expand Up @@ -25,15 +25,19 @@ impl LegacyWalletTemplate {
}
}

pub fn alias(&self) -> &WalletAlias {
pub fn alias(&self) -> &str {
&self.alias
}

pub fn value(&self) -> &Value {
&self.value
}

pub fn address(&self) -> String {
self.address.clone()
pub fn address(&self) -> &str {
&self.address
}

pub fn mnemonics(&self) -> &str {
&self.mnemonics
}
}
1 change: 1 addition & 0 deletions testing/jormungandr-testing-utils/src/wallet/delegation.rs
Expand Up @@ -18,6 +18,7 @@ pub struct Wallet {
/// this is the root seed of the wallet, everytime we will require
/// the wallet to update we will update the rng, we keep the `seed`
/// so we may reproduce the steps of the wallet
#[allow(dead_code)]
seed: [u8; 32],

rng: ChaChaRng,
Expand Down
8 changes: 2 additions & 6 deletions testing/jormungandr-testing-utils/src/wallet/utxo.rs
Expand Up @@ -5,7 +5,7 @@ use jormungandr_lib::{
hash::Hash,
key::{self, Identifier},
},
interfaces::{Address, UTxOInfo},
interfaces::Address,
};
use rand_chacha::ChaChaRng;
use rand_core::{CryptoRng, RngCore, SeedableRng};
Expand All @@ -17,17 +17,14 @@ pub struct Wallet {
/// this is the root seed of the wallet, everytime we will require
/// the wallet to update we will update the rng, we keep the `seed`
/// so we may reproduce the steps of the wallet
#[allow(dead_code)]
seed: [u8; 32],

rng: ChaChaRng,

/// the spending key
signing_keys: Vec<SpendingKey>,

/// utxos with the index in the `signing_keys` so we can later
/// sign the witness for the next transaction,
utxos: Vec<(usize, UTxOInfo)>,

discrimination: Discrimination,
}

Expand All @@ -43,7 +40,6 @@ impl Wallet {
signing_keys: Vec::new(),
seed,
rng: ChaChaRng::from_seed(seed),
utxos: Vec::new(),
discrimination,
};
wallet.generate_new_signing_key();
Expand Down

0 comments on commit 4c29f7b

Please sign in to comment.