Remove `param` from names

Did not add any value, more readable with just bitcoin and monero.
pull/490/head
Daniel Karzel 3 years ago
parent 657ac1e2e4
commit 4e1f3f82bd
No known key found for this signature in database
GPG Key ID: 30C3FC2E438ADB6E

@ -21,7 +21,7 @@ use std::sync::Arc;
use std::time::Duration;
use structopt::StructOpt;
use swap::bitcoin::TxLock;
use swap::cli::command::{Arguments, BitcoinParams, Command, MoneroParams};
use swap::cli::command::{Arguments, Bitcoin, Command, Monero};
use swap::database::Database;
use swap::env::{Config, GetConfig};
use swap::network::quote::BidQuote;
@ -45,13 +45,13 @@ async fn main() -> Result<()> {
Command::BuyXmr {
alice_peer_id,
alice_multiaddr,
bitcoin_params:
BitcoinParams {
bitcoin:
Bitcoin {
electrum_rpc_url,
bitcoin_target_block,
},
monero_params:
MoneroParams {
monero:
Monero {
receive_monero_address,
monero_daemon_host,
},
@ -152,13 +152,13 @@ async fn main() -> Result<()> {
Command::Resume {
swap_id,
alice_multiaddr,
bitcoin_params:
BitcoinParams {
bitcoin:
Bitcoin {
electrum_rpc_url,
bitcoin_target_block,
},
monero_params:
MoneroParams {
monero:
Monero {
receive_monero_address,
monero_daemon_host,
},
@ -223,8 +223,8 @@ async fn main() -> Result<()> {
Command::Cancel {
swap_id,
force,
bitcoin_params:
BitcoinParams {
bitcoin:
Bitcoin {
electrum_rpc_url,
bitcoin_target_block,
},
@ -260,8 +260,8 @@ async fn main() -> Result<()> {
Command::Refund {
swap_id,
force,
bitcoin_params:
BitcoinParams {
bitcoin:
Bitcoin {
electrum_rpc_url,
bitcoin_target_block,
},

@ -43,10 +43,10 @@ pub enum Command {
alice_multiaddr: Multiaddr,
#[structopt(flatten)]
bitcoin_params: BitcoinParams,
bitcoin: Bitcoin,
#[structopt(flatten)]
monero_params: MoneroParams,
monero: Monero,
#[structopt(long = "tor-socks5-port", help = "Your local Tor socks5 proxy port", default_value = DEFAULT_TOR_SOCKS5_PORT)]
tor_socks5_port: u16,
@ -65,10 +65,10 @@ pub enum Command {
alice_multiaddr: Multiaddr,
#[structopt(flatten)]
bitcoin_params: BitcoinParams,
bitcoin: Bitcoin,
#[structopt(flatten)]
monero_params: MoneroParams,
monero: Monero,
#[structopt(long = "tor-socks5-port", help = "Your local Tor socks5 proxy port", default_value = DEFAULT_TOR_SOCKS5_PORT)]
tor_socks5_port: u16,
@ -85,7 +85,7 @@ pub enum Command {
force: bool,
#[structopt(flatten)]
bitcoin_params: BitcoinParams,
bitcoin: Bitcoin,
},
/// Try to cancel a swap and refund my BTC (expert users only)
Refund {
@ -99,12 +99,12 @@ pub enum Command {
force: bool,
#[structopt(flatten)]
bitcoin_params: BitcoinParams,
bitcoin: Bitcoin,
},
}
#[derive(structopt::StructOpt, Debug)]
pub struct MoneroParams {
pub struct Monero {
#[structopt(long = "receive-address",
help = "Provide the monero address where you would like to receive monero",
parse(try_from_str = parse_monero_address)
@ -120,7 +120,7 @@ pub struct MoneroParams {
}
#[derive(structopt::StructOpt, Debug)]
pub struct BitcoinParams {
pub struct Bitcoin {
#[structopt(long = "electrum-rpc",
help = "Provide the Bitcoin Electrum RPC URL",
default_value = DEFAULT_ELECTRUM_RPC_URL

Loading…
Cancel
Save