From 41c2ce8a821da2a8c5ee9baa0ef4ee528870c16a Mon Sep 17 00:00:00 2001 From: HaidarJbeily7 Date: Fri, 16 Aug 2024 14:31:20 +0300 Subject: [PATCH 1/3] FIX: Add XST based pools support --- processing.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/processing.py b/processing.py index d7604bf..f124612 100644 --- a/processing.py +++ b/processing.py @@ -17,6 +17,7 @@ VAL_ID = "0x0200040000000000000000000000000000000000000000000000000000000000" PSWAP_ID = "0x0200050000000000000000000000000000000000000000000000000000000000" XSTUSD_ID = "0x0200080000000000000000000000000000000000000000000000000000000000" +XST_ID = "0x0200090000000000000000000000000000000000000000000000000000000000" KXOR_ID = "0x02000e0000000000000000000000000000000000000000000000000000000000" ETH_ID="0x0200070000000000000000000000000000000000000000000000000000000000" TECH_ACCOUNT = ( @@ -73,7 +74,9 @@ def is_eth_kxor_pair(input_asset_type, output_asset_type): return (input_asset_type == KXOR_ID or output_asset_type == KXOR_ID) \ and (input_asset_type == ETH_ID or output_asset_type == ETH_ID) - +def is_xst_based_pair(input_asset_type, output_asset_type): + return input_asset_type == XST_ID or output_asset_type == XST_ID + def set_max_amount(value, current_value): if current_value is None or value > current_value: return value @@ -145,7 +148,8 @@ def process_swap_transaction(timestamp, extrinsicEvents, ex_dict, prices): if ((dex_id == 0 and input_asset_type != XOR_ID and output_asset_type != XOR_ID) \ or (dex_id == 1 and input_asset_type != XSTUSD_ID and output_asset_type != XSTUSD_ID)) \ - and (not is_eth_kxor_pair(input_asset_type, output_asset_type)): + and (not is_eth_kxor_pair(input_asset_type, output_asset_type)) \ + and (not is_xst_based_pair(input_asset_type, output_asset_type)): assert len(intermediate_amounts) > 0 , ex_dict return Swap( From fdec1bc8b4b28df271d9cca1a4ada998c5947c94 Mon Sep 17 00:00:00 2001 From: f33r0 <95526886+f33r0@users.noreply.github.com> Date: Fri, 16 Aug 2024 14:35:14 +0300 Subject: [PATCH 2/3] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1146820..0db14f1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,7 +4,7 @@ def pipeline = new org.docker.AppPipeline(steps: this, dockerImageName: 'sora2/pricing-server', dockerRegistryCred: 'bot-sora2-rw', secretScannerExclusion: '.*docker-compose.yml', - dockerImageTags: ['master':'latest'], + dockerImageTags: ['fix/xst-based-tokens':'test-16082024'], deepSecretScannerExclusion: ["web.py", "alembic.ini"], gitUpdateSubmodule: true) pipeline.runPipeline() From a9c1af81baf23dd25de635dc7d1bd152d8e38614 Mon Sep 17 00:00:00 2001 From: f33r0 <95526886+f33r0@users.noreply.github.com> Date: Mon, 19 Aug 2024 09:47:31 +0300 Subject: [PATCH 3/3] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0db14f1..1146820 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,7 +4,7 @@ def pipeline = new org.docker.AppPipeline(steps: this, dockerImageName: 'sora2/pricing-server', dockerRegistryCred: 'bot-sora2-rw', secretScannerExclusion: '.*docker-compose.yml', - dockerImageTags: ['fix/xst-based-tokens':'test-16082024'], + dockerImageTags: ['master':'latest'], deepSecretScannerExclusion: ["web.py", "alembic.ini"], gitUpdateSubmodule: true) pipeline.runPipeline()