Do a bunch of cleanups

This commit is contained in:
Tobin C. Harding 2020-10-22 13:30:07 +11:00
parent 0f17ec076c
commit ad006fae6a
7 changed files with 33 additions and 31 deletions

View file

@ -9,7 +9,7 @@ pub mod network;
pub const ONE_BTC: u64 = 100_000_000;
const REFUND_TIMELOCK: u32 = 10; // FIXME: What should this be?
const REFUND_TIMELOCK: u32 = 10; // Relative timelock, this is number of blocks. TODO: What should it be?
const PUNISH_TIMELOCK: u32 = 20; // FIXME: What should this be?
pub type Never = std::convert::Infallible;
@ -17,7 +17,7 @@ pub type Never = std::convert::Infallible;
/// Commands sent from Bob to the main task.
#[derive(Clone, Copy, Debug)]
pub enum Cmd {
VerifyAmounts(SwapParams),
VerifyAmounts(SwapAmounts),
}
/// Responses send from the main task back to Bob.
@ -27,9 +27,9 @@ pub enum Rsp {
Abort,
}
/// XMR/BTC swap parameters.
/// XMR/BTC swap amounts.
#[derive(Copy, Clone, Debug, Serialize, Deserialize)]
pub struct SwapParams {
pub struct SwapAmounts {
/// Amount of BTC to swap.
#[serde(with = "::bitcoin::util::amount::serde::as_sat")]
pub btc: ::bitcoin::Amount,
@ -38,7 +38,7 @@ pub struct SwapParams {
pub xmr: xmr_btc::monero::Amount,
}
impl Display for SwapParams {
impl Display for SwapAmounts {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,