mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2024-11-17 15:26:14 +00:00
Make durations more readable by using extension methods from time
This commit is contained in:
parent
ecff1d1cbe
commit
d560e69203
@ -1,5 +1,6 @@
|
||||
use crate::bitcoin::{CancelTimelock, PunishTimelock};
|
||||
use std::time::Duration;
|
||||
use time::NumericalStdDurationShort;
|
||||
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct ExecutionParams {
|
||||
@ -27,9 +28,9 @@ pub struct Regtest;
|
||||
impl GetExecutionParams for Mainnet {
|
||||
fn get_execution_params() -> ExecutionParams {
|
||||
ExecutionParams {
|
||||
bob_time_to_act: Duration::from_secs(10 * 60),
|
||||
bob_time_to_act: 10.minutes(),
|
||||
bitcoin_finality_confirmations: 3,
|
||||
bitcoin_avg_block_time: Duration::from_secs(10 * 60),
|
||||
bitcoin_avg_block_time: 10.minutes(),
|
||||
monero_finality_confirmations: 15,
|
||||
bitcoin_cancel_timelock: CancelTimelock::new(72),
|
||||
bitcoin_punish_timelock: PunishTimelock::new(72),
|
||||
@ -40,9 +41,9 @@ impl GetExecutionParams for Mainnet {
|
||||
impl GetExecutionParams for Testnet {
|
||||
fn get_execution_params() -> ExecutionParams {
|
||||
ExecutionParams {
|
||||
bob_time_to_act: Duration::from_secs(60 * 60),
|
||||
bob_time_to_act: 60.minutes(),
|
||||
bitcoin_finality_confirmations: 1,
|
||||
bitcoin_avg_block_time: Duration::from_secs(5 * 60),
|
||||
bitcoin_avg_block_time: 5.minutes(),
|
||||
monero_finality_confirmations: 10,
|
||||
bitcoin_cancel_timelock: CancelTimelock::new(12),
|
||||
bitcoin_punish_timelock: PunishTimelock::new(6),
|
||||
@ -53,9 +54,9 @@ impl GetExecutionParams for Testnet {
|
||||
impl GetExecutionParams for Regtest {
|
||||
fn get_execution_params() -> ExecutionParams {
|
||||
ExecutionParams {
|
||||
bob_time_to_act: Duration::from_secs(30),
|
||||
bob_time_to_act: 30.seconds(),
|
||||
bitcoin_finality_confirmations: 1,
|
||||
bitcoin_avg_block_time: Duration::from_secs(5),
|
||||
bitcoin_avg_block_time: 5.seconds(),
|
||||
monero_finality_confirmations: 10,
|
||||
bitcoin_cancel_timelock: CancelTimelock::new(100),
|
||||
bitcoin_punish_timelock: PunishTimelock::new(50),
|
||||
|
Loading…
Reference in New Issue
Block a user