|
|
|
@ -171,7 +171,7 @@ where
|
|
|
|
|
}
|
|
|
|
|
RawCommand::Cancel {
|
|
|
|
|
swap_id: SwapId { swap_id },
|
|
|
|
|
force,
|
|
|
|
|
graceful: force,
|
|
|
|
|
bitcoin,
|
|
|
|
|
} => {
|
|
|
|
|
let (bitcoin_electrum_rpc_url, bitcoin_target_block) =
|
|
|
|
@ -184,7 +184,7 @@ where
|
|
|
|
|
data_dir: data::data_dir_from(data, is_testnet)?,
|
|
|
|
|
cmd: Command::Cancel {
|
|
|
|
|
swap_id,
|
|
|
|
|
force,
|
|
|
|
|
graceful: force,
|
|
|
|
|
bitcoin_electrum_rpc_url,
|
|
|
|
|
bitcoin_target_block,
|
|
|
|
|
},
|
|
|
|
@ -192,7 +192,7 @@ where
|
|
|
|
|
}
|
|
|
|
|
RawCommand::Refund {
|
|
|
|
|
swap_id: SwapId { swap_id },
|
|
|
|
|
force,
|
|
|
|
|
graceful: force,
|
|
|
|
|
bitcoin,
|
|
|
|
|
} => {
|
|
|
|
|
let (bitcoin_electrum_rpc_url, bitcoin_target_block) =
|
|
|
|
@ -205,7 +205,7 @@ where
|
|
|
|
|
data_dir: data::data_dir_from(data, is_testnet)?,
|
|
|
|
|
cmd: Command::Refund {
|
|
|
|
|
swap_id,
|
|
|
|
|
force,
|
|
|
|
|
graceful: force,
|
|
|
|
|
bitcoin_electrum_rpc_url,
|
|
|
|
|
bitcoin_target_block,
|
|
|
|
|
},
|
|
|
|
@ -261,13 +261,13 @@ pub enum Command {
|
|
|
|
|
},
|
|
|
|
|
Cancel {
|
|
|
|
|
swap_id: Uuid,
|
|
|
|
|
force: bool,
|
|
|
|
|
graceful: bool,
|
|
|
|
|
bitcoin_electrum_rpc_url: Url,
|
|
|
|
|
bitcoin_target_block: usize,
|
|
|
|
|
},
|
|
|
|
|
Refund {
|
|
|
|
|
swap_id: Uuid,
|
|
|
|
|
force: bool,
|
|
|
|
|
graceful: bool,
|
|
|
|
|
bitcoin_electrum_rpc_url: Url,
|
|
|
|
|
bitcoin_target_block: usize,
|
|
|
|
|
},
|
|
|
|
@ -376,24 +376,24 @@ enum RawCommand {
|
|
|
|
|
#[structopt(flatten)]
|
|
|
|
|
tor: Tor,
|
|
|
|
|
},
|
|
|
|
|
/// Try to cancel an ongoing swap (expert users only)
|
|
|
|
|
/// Force submission of the cancel transaction overriding the protocol state machine and blockheight checks (expert users only)
|
|
|
|
|
Cancel {
|
|
|
|
|
#[structopt(flatten)]
|
|
|
|
|
swap_id: SwapId,
|
|
|
|
|
|
|
|
|
|
#[structopt(short, long)]
|
|
|
|
|
force: bool,
|
|
|
|
|
#[structopt(short, long, help = "Performs checks to see whether it is appropriate to refund before submitting the cancel transaction")]
|
|
|
|
|
graceful: bool,
|
|
|
|
|
|
|
|
|
|
#[structopt(flatten)]
|
|
|
|
|
bitcoin: Bitcoin,
|
|
|
|
|
},
|
|
|
|
|
/// Try to cancel a swap and refund the BTC (expert users only)
|
|
|
|
|
/// Force submission of the cancel transaction overriding the protocol state machine and blockheight checks (expert users only)
|
|
|
|
|
Refund {
|
|
|
|
|
#[structopt(flatten)]
|
|
|
|
|
swap_id: SwapId,
|
|
|
|
|
|
|
|
|
|
#[structopt(short, long)]
|
|
|
|
|
force: bool,
|
|
|
|
|
#[structopt(short, long, help = "Performs checks to see whether it is appropriate to refund before submitting the refund transaction")]
|
|
|
|
|
graceful: bool,
|
|
|
|
|
|
|
|
|
|
#[structopt(flatten)]
|
|
|
|
|
bitcoin: Bitcoin,
|
|
|
|
@ -1173,7 +1173,7 @@ mod tests {
|
|
|
|
|
data_dir: data_dir_path_cli().join(TESTNET),
|
|
|
|
|
cmd: Command::Cancel {
|
|
|
|
|
swap_id: Uuid::from_str(SWAP_ID).unwrap(),
|
|
|
|
|
force: false,
|
|
|
|
|
graceful: false,
|
|
|
|
|
bitcoin_electrum_rpc_url: Url::from_str(DEFAULT_ELECTRUM_RPC_URL_TESTNET)
|
|
|
|
|
.unwrap(),
|
|
|
|
|
bitcoin_target_block: DEFAULT_BITCOIN_CONFIRMATION_TARGET_TESTNET,
|
|
|
|
@ -1189,7 +1189,7 @@ mod tests {
|
|
|
|
|
data_dir: data_dir_path_cli().join(MAINNET),
|
|
|
|
|
cmd: Command::Cancel {
|
|
|
|
|
swap_id: Uuid::from_str(SWAP_ID).unwrap(),
|
|
|
|
|
force: false,
|
|
|
|
|
graceful: false,
|
|
|
|
|
bitcoin_electrum_rpc_url: Url::from_str(DEFAULT_ELECTRUM_RPC_URL).unwrap(),
|
|
|
|
|
bitcoin_target_block: DEFAULT_BITCOIN_CONFIRMATION_TARGET,
|
|
|
|
|
},
|
|
|
|
@ -1204,7 +1204,7 @@ mod tests {
|
|
|
|
|
data_dir: data_dir_path_cli().join(TESTNET),
|
|
|
|
|
cmd: Command::Refund {
|
|
|
|
|
swap_id: Uuid::from_str(SWAP_ID).unwrap(),
|
|
|
|
|
force: false,
|
|
|
|
|
graceful: false,
|
|
|
|
|
bitcoin_electrum_rpc_url: Url::from_str(DEFAULT_ELECTRUM_RPC_URL_TESTNET)
|
|
|
|
|
.unwrap(),
|
|
|
|
|
bitcoin_target_block: DEFAULT_BITCOIN_CONFIRMATION_TARGET_TESTNET,
|
|
|
|
@ -1220,7 +1220,7 @@ mod tests {
|
|
|
|
|
data_dir: data_dir_path_cli().join(MAINNET),
|
|
|
|
|
cmd: Command::Refund {
|
|
|
|
|
swap_id: Uuid::from_str(SWAP_ID).unwrap(),
|
|
|
|
|
force: false,
|
|
|
|
|
graceful: false,
|
|
|
|
|
bitcoin_electrum_rpc_url: Url::from_str(DEFAULT_ELECTRUM_RPC_URL).unwrap(),
|
|
|
|
|
bitcoin_target_block: DEFAULT_BITCOIN_CONFIRMATION_TARGET,
|
|
|
|
|
},
|
|
|
|
|