From f20c1f8546ee06e995f11681253fcb2ea674546e Mon Sep 17 00:00:00 2001 From: Francois <11577022+takenagain@users.noreply.github.com> Date: Thu, 7 Nov 2024 17:53:13 +0200 Subject: [PATCH 1/3] switch TSIA to legacy activation request format --- app_build/build_config.json | 23 ++++++++------ lib/mm2/mm2_api/mm2_api.dart | 20 +------------ lib/mm2/mm2_api/rpc/enable/enable_req.dart | 13 +++----- .../mm2_api/rpc/enable/enable_req_status.dart | 30 ------------------- 4 files changed, 19 insertions(+), 67 deletions(-) delete mode 100644 lib/mm2/mm2_api/rpc/enable/enable_req_status.dart diff --git a/app_build/build_config.json b/app_build/build_config.json index dce2b1d9f0..0e162830a2 100644 --- a/app_build/build_config.json +++ b/app_build/build_config.json @@ -1,6 +1,6 @@ { "api": { - "api_commit_hash": "b021d34", + "api_commit_hash": "171f5f6", "branch": "remaining-sia-swapops", "fetch_at_build_enabled": true, "source_urls": [ @@ -10,29 +10,35 @@ "web": { "matching_keyword": "wasm", "valid_zip_sha256_checksums": [ - "cea9d2df6cba6af4de2b2583ed90ce7a6b1eb7658e2792778404bd4f192a76a3" + "f3dda3a77ca9da50ca924e82e7455decf0862a50b57d1b8bada7281eb7d2ce70" ], "path": "web/src/mm2" }, "ios": { "matching_keyword": "ios-aarch64", - "valid_zip_sha256_checksums": ["3c8cad2bb1e58d3fc12a4a3d44d1d21499652b7aadb4ea5dadf583f695a1af05"], + "valid_zip_sha256_checksums": [ + "0ad0ada35f41756bde4d3de479f5fe3f261559faba11430308da9d35e0f776e8" + ], "path": "ios" }, "macos": { "matching_keyword": "mac-arm64", - "valid_zip_sha256_checksums": ["e67f76ed5f3284c279b377f79e8288796c123ff4055168d15b0d17f5576352d7"], + "valid_zip_sha256_checksums": [ + "db9d84bf61e7355cad6ea1af09db48b86a21c99bef874d7276931265684ff03d" + ], "path": "macos" }, "windows": { "matching_keyword": "win-x86-64", - "valid_zip_sha256_checksums": ["46298c52939a5220f719e1fb855cb3eff45de1b6ff6e72c9518279ac15160ae3"], + "valid_zip_sha256_checksums": [ + "ea5d0e59ac7a940b54d37a9e16cc900be550ecc5131092c8fbea1ae03cb2f9f1" + ], "path": "windows/runner/exe" }, "linux": { "matching_keyword": "linux-x86-64", "valid_zip_sha256_checksums": [ - "eadf1e240d06004791cad99fff36b2ee939538d1349e7e0cc7b27d3339fa92e6" + "e89098bc317404975f9459a261e2a996f95d3a55fe50cb96c5e7fbb01b6cfbe5" ], "path": "linux/mm2" } @@ -41,7 +47,7 @@ }, "coins": { "update_commit_on_build": true, - "bundled_coins_repo_commit": "5e49096c30ece1fd0092e34261278be7632bc09e", + "bundled_coins_repo_commit": "dc9ace1cceed5da4a402d001b67fc28bbcd92bb8", "coins_repo_api_url": "https://api.github.com/repos/KomodoPlatform/coins", "coins_repo_content_url": "https://raw.githubusercontent.com/KomodoPlatform/coins", "coins_repo_branch": "master", @@ -51,5 +57,4 @@ "assets/coin_icons/png/": "icons" } } -} - +} \ No newline at end of file diff --git a/lib/mm2/mm2_api/mm2_api.dart b/lib/mm2/mm2_api/mm2_api.dart index f24091a47a..52c770b860 100644 --- a/lib/mm2/mm2_api/mm2_api.dart +++ b/lib/mm2/mm2_api/mm2_api.dart @@ -13,7 +13,6 @@ import 'package:web_dex/mm2/mm2_api/rpc/convert_address/convert_address_request. import 'package:web_dex/mm2/mm2_api/rpc/disable_coin/disable_coin_req.dart'; import 'package:web_dex/mm2/mm2_api/rpc/electrum/electrum_req.dart'; import 'package:web_dex/mm2/mm2_api/rpc/enable/enable_req.dart'; -import 'package:web_dex/mm2/mm2_api/rpc/enable/enable_req_status.dart'; import 'package:web_dex/mm2/mm2_api/rpc/enable_tendermint/enable_tendermint_token.dart'; import 'package:web_dex/mm2/mm2_api/rpc/enable_tendermint/enable_tendermint_with_assets.dart'; import 'package:web_dex/mm2/mm2_api/rpc/get_enabled_coins/get_enabled_coins_req.dart'; @@ -152,25 +151,8 @@ class Mm2Api { Future _enableSiaCoins(List requests) async { try { - // final requestToString = - // jsonEncode(requests.map((e) => e.toJson()).toList()); - // log('SIA COIN ACTIVATION REQUESTS: \n$requestToString\n'); final dynamic response = await _call(requests); - log( - response, - path: 'api => _enableSiaCoins => _call', - ); - - final coinTasks = jsonDecode(response) as List; - final taskId = coinTasks[0]["result"]["task_id"]; - - final statusReq = EnableSiaStatusRequest(taskId: taskId); - String status = "InProgress"; - while (status == "InProgress") { - final statusResp = jsonDecode(await _call(statusReq)); - status = statusResp["result"]["status"] as String; - await Future.delayed(const Duration(milliseconds: 100), () => "2"); - } + log( response, path: 'api => _enableSiaCoins'); } catch (e, s) { log( 'Error enabling Sia coins: ${e.toString()}', diff --git a/lib/mm2/mm2_api/rpc/enable/enable_req.dart b/lib/mm2/mm2_api/rpc/enable/enable_req.dart index 242a39ba28..f819a09c75 100644 --- a/lib/mm2/mm2_api/rpc/enable/enable_req.dart +++ b/lib/mm2/mm2_api/rpc/enable/enable_req.dart @@ -135,21 +135,16 @@ class EnableSiaRequest implements BaseRequest { late String userpass; @override - final String method = 'enable_sia'; + final String method = 'enable'; @override Map toJson() { return { 'userpass': userpass, - 'mmrpc': '2.0', 'method': method, - 'params': { - 'ticker': ticker, - 'activation_params': { - 'tx_history': true, - 'client_conf': httpConf.toJson(), - }, - }, + 'tx_history': true, + 'coin': ticker, + 'client_conf': httpConf.toJson(), }; } } diff --git a/lib/mm2/mm2_api/rpc/enable/enable_req_status.dart b/lib/mm2/mm2_api/rpc/enable/enable_req_status.dart deleted file mode 100644 index b4096f3612..0000000000 --- a/lib/mm2/mm2_api/rpc/enable/enable_req_status.dart +++ /dev/null @@ -1,30 +0,0 @@ -import 'package:web_dex/mm2/mm2_api/rpc/base.dart'; - -class EnableSiaStatusRequest implements BaseRequest { - EnableSiaStatusRequest({ - required this.taskId, - this.forgetIfFinished = false, - }); - - final int taskId; - final bool forgetIfFinished; - - @override - late String userpass; - - @override - final String method = 'task::enable_sia::status'; - - @override - Map toJson() { - return { - 'userpass': userpass, - 'mmrpc': '2.0', - 'method': method, - 'params': { - 'task_id': taskId, - 'forget_if_finished': forgetIfFinished, - }, - }; - } -} From 4cd965280cc8cad2b12a20bd8d4ca014ef93ea6e Mon Sep 17 00:00:00 2001 From: Francois Date: Thu, 7 Nov 2024 18:41:07 +0200 Subject: [PATCH 2/3] revert changes to index.html --- web/index.html | 35 +++++++++-------------------------- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/web/index.html b/web/index.html index 4b3bcc36ea..7aa020ed53 100644 --- a/web/index.html +++ b/web/index.html @@ -1,29 +1,12 @@ -Komodo Wallet | Non-Custodial Multi-Coin Wallet & DEX
Komodo Wallet is starting... Please wait.
\ No newline at end of file +If you are seeing this message in your browser, it means that the build steps have not been run. Please run `flutter +clean && flutter pub get` and then try again. If issues persist, please ensure you are using the latest Flutter SDK and +have set up your environment correctly as per our docs. \ No newline at end of file From 1abb77892a4e3232e469fa7d58d8efa2b116ab3b Mon Sep 17 00:00:00 2001 From: Francois <11577022+takenagain@users.noreply.github.com> Date: Mon, 11 Nov 2024 09:21:23 +0200 Subject: [PATCH 3/3] ci: switch ui&unit tests to hosted runners --- .github/workflows/ui-tests-on-pr.yml | 4 ++-- .github/workflows/unit-tests-on-pr.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ui-tests-on-pr.yml b/.github/workflows/ui-tests-on-pr.yml index f5f4536da4..f048890b4f 100644 --- a/.github/workflows/ui-tests-on-pr.yml +++ b/.github/workflows/ui-tests-on-pr.yml @@ -18,10 +18,10 @@ jobs: ] include: - name: web-app-linux - os: [self-hosted, Linux] + os: ubuntu-latest - name: web-app-macos - os: [self-hosted, macos] + os: macos-latest steps: diff --git a/.github/workflows/unit-tests-on-pr.yml b/.github/workflows/unit-tests-on-pr.yml index b31ae0a9ac..dcbe8b99fe 100644 --- a/.github/workflows/unit-tests-on-pr.yml +++ b/.github/workflows/unit-tests-on-pr.yml @@ -6,7 +6,7 @@ on: jobs: build_and_preview: - runs-on: [self-hosted, Linux] + runs-on: ubuntu-latest timeout-minutes: 15 steps: