Take wallet names by reference

We are always passing constants here. Make that more ergonomic.
This commit is contained in:
Thomas Eizinger 2021-04-16 12:05:12 +10:00
parent 22bdc08c83
commit dc840e1562
No known key found for this signature in database
GPG Key ID: 651AC83A6C6C8B96
3 changed files with 6 additions and 10 deletions

View File

@ -56,7 +56,7 @@ impl<'c> Monero {
/// miner wallet container name is: `miner`
pub async fn new(
cli: &'c Cli,
additional_wallets: Vec<String>,
additional_wallets: Vec<&'static str>,
) -> Result<(Self, Vec<Container<'c, Cli, image::Monero>>)> {
let prefix = format!("{}_", random_prefix());
let monerod_name = format!("{}{}", prefix, MONEROD_DAEMON_CONTAINER_NAME);

View File

@ -17,9 +17,7 @@ async fn fund_transfer_and_check_tx_key() {
let send_to_bob = 5_000_000_000;
let tc = Cli::default();
let (monero, _containers) = Monero::new(&tc, vec!["alice".to_string(), "bob".to_string()])
.await
.unwrap();
let (monero, _containers) = Monero::new(&tc, vec!["alice", "bob"]).await.unwrap();
let alice_wallet = monero.wallet("alice").unwrap();
let bob_wallet = monero.wallet("bob").unwrap();

View File

@ -195,12 +195,10 @@ async fn init_monero_container(
Monero,
Vec<Container<'_, Cli, monero_harness::image::Monero>>,
) {
let (monero, monerods) = Monero::new(&cli, vec![
MONERO_WALLET_NAME_ALICE.to_owned(),
MONERO_WALLET_NAME_BOB.to_owned(),
])
.await
.unwrap();
let (monero, monerods) =
Monero::new(&cli, vec![MONERO_WALLET_NAME_ALICE, MONERO_WALLET_NAME_BOB])
.await
.unwrap();
(monero, monerods)
}