From 65c93eaee69fe4da316ffe85e68433adc65d2e37 Mon Sep 17 00:00:00 2001 From: tecnovert Date: Mon, 18 Dec 2023 23:45:55 +0200 Subject: [PATCH] coins: Update valid Firo swap types. --- basicswap/basicswap.py | 4 ++-- basicswap/chainparams.py | 4 +++- basicswap/templates/offer_new_1.html | 4 ++-- tests/basicswap/test_run.py | 6 ++++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/basicswap/basicswap.py b/basicswap/basicswap.py index 9bdc021..934ae40 100644 --- a/basicswap/basicswap.py +++ b/basicswap/basicswap.py @@ -256,9 +256,9 @@ class BasicSwap(BaseApp): self._is_locked = None # TODO: Set dynamically - self.scriptless_coins = (Coins.XMR, Coins.PART_ANON) + self.scriptless_coins = (Coins.XMR, Coins.PART_ANON, Coins.FIRO) self.adaptor_swap_only_coins = self.scriptless_coins + (Coins.PART_BLIND, ) - self.coins_without_segwit = (Coins.PIVX, Coins.DASH, Coins.FIRO, Coins.NMC) + self.coins_without_segwit = (Coins.PIVX, Coins.DASH, Coins.NMC) # TODO: Adjust ranges self.min_delay_event = self.settings.get('min_delay_event', 10) diff --git a/basicswap/chainparams.py b/basicswap/chainparams.py index 04bde1b..99d7e69 100644 --- a/basicswap/chainparams.py +++ b/basicswap/chainparams.py @@ -219,6 +219,7 @@ chainparams = { 'message_magic': 'DarkNet Signed Message:\n', 'blocks_target': 60 * 1, 'decimal_places': 8, + 'has_cltv': True, 'has_csv': False, 'has_segwit': False, 'use_ticker_as_name': True, @@ -296,7 +297,8 @@ chainparams = { 'message_magic': 'Zcoin Signed Message:\n', 'blocks_target': 60 * 10, 'decimal_places': 8, - 'has_csv': True, + 'has_cltv': False, + 'has_csv': False, 'has_segwit': False, 'mainnet': { 'rpcport': 8888, diff --git a/basicswap/templates/offer_new_1.html b/basicswap/templates/offer_new_1.html index 28ee58b..8b9cca2 100644 --- a/basicswap/templates/offer_new_1.html +++ b/basicswap/templates/offer_new_1.html @@ -575,8 +575,8 @@ function lookup_rates_table() { function set_swap_type_enabled(coin_from, coin_to, swap_type) { - const adaptor_sig_only_coins = ['6' /* XMR */, '8' /* PART_ANON */, '7' /* PART_BLIND */]; - const secret_hash_only_coins = ['11' /* PIVX */, '12' /* DASH */, '13' /* FIRO */]; + const adaptor_sig_only_coins = ['6' /* XMR */, '8' /* PART_ANON */, '7' /* PART_BLIND */, '13' /* FIRO */]; + const secret_hash_only_coins = ['11' /* PIVX */, '12' /* DASH */]; let make_hidden = false; if (adaptor_sig_only_coins.includes(coin_from) || adaptor_sig_only_coins.includes(coin_to)) { swap_type.disabled = true; diff --git a/tests/basicswap/test_run.py b/tests/basicswap/test_run.py index 3c5b4ab..4925802 100644 --- a/tests/basicswap/test_run.py +++ b/tests/basicswap/test_run.py @@ -191,15 +191,17 @@ class Test(BaseTest): (Coins.BTC, Coins.XMR, SwapTypes.XMR_SWAP), (Coins.XMR, Coins.BTC, SwapTypes.XMR_SWAP), (Coins.BTC, Coins.FIRO, SwapTypes.XMR_SWAP), - (Coins.FIRO, Coins.BTC, SwapTypes.SELLER_FIRST), - (Coins.BTC, Coins.FIRO, SwapTypes.SELLER_FIRST), (Coins.FIRO, Coins.BTC, SwapTypes.XMR_SWAP), + (Coins.PIVX, Coins.BTC, SwapTypes.SELLER_FIRST), + (Coins.BTC, Coins.PIVX, SwapTypes.SELLER_FIRST), ] should_fail = [ (Coins.BTC, Coins.XMR, SwapTypes.SELLER_FIRST), (Coins.XMR, Coins.PART_ANON, SwapTypes.XMR_SWAP), (Coins.FIRO, Coins.PART_ANON, SwapTypes.XMR_SWAP), (Coins.PART_ANON, Coins.FIRO, SwapTypes.XMR_SWAP), + (Coins.FIRO, Coins.BTC, SwapTypes.SELLER_FIRST), + (Coins.BTC, Coins.FIRO, SwapTypes.SELLER_FIRST), ] for case in should_pass: