From fd578dd530d6162f267e878621b13f8f6cdf087c Mon Sep 17 00:00:00 2001
From: Matthew Fosse <matt@fosse.co>
Date: Mon, 9 Sep 2024 14:04:49 -0700
Subject: [PATCH] script updates, swap params on createLitecoinWalletService

---
 .github/workflows/pr_test_build_android.yml | 3 +--
 .github/workflows/pr_test_build_linux.yml   | 2 +-
 lib/di.dart                                 | 2 +-
 scripts/android/build_mwebd.sh              | 4 +++-
 scripts/ios/build_mwebd.sh                  | 4 +++-
 5 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/pr_test_build_android.yml b/.github/workflows/pr_test_build_android.yml
index 6daeb84ee..3cc67e53a 100644
--- a/.github/workflows/pr_test_build_android.yml
+++ b/.github/workflows/pr_test_build_android.yml
@@ -109,9 +109,8 @@ jobs:
           # paths are reset after each step, so we need to set them again:
           export PATH=$PATH:/usr/local/go/bin
           export PATH=$PATH:~/go/bin
-          # build mwebd:
           cd /opt/android/cake_wallet/scripts/android/
-          ./build_mwebd.sh
+          ./build_mwebd.sh --dont-install
 
       - name: Generate KeyStore
         run: |
diff --git a/.github/workflows/pr_test_build_linux.yml b/.github/workflows/pr_test_build_linux.yml
index 116dc3c95..f00584345 100644
--- a/.github/workflows/pr_test_build_linux.yml
+++ b/.github/workflows/pr_test_build_linux.yml
@@ -106,7 +106,7 @@ jobs:
           export PATH=$PATH:~/go/bin
           # build mwebd:
           cd /opt/android/cake_wallet/scripts/android/
-          ./build_mwebd.sh
+          ./build_mwebd.sh --dont-install
 
       - name: Generate localization
         run: |
diff --git a/lib/di.dart b/lib/di.dart
index 9c3c5bcb2..30727f33c 100644
--- a/lib/di.dart
+++ b/lib/di.dart
@@ -1000,8 +1000,8 @@ Future<void> setup({
         return bitcoin!.createLitecoinWalletService(
           _walletInfoSource,
           _unspentCoinsInfoSource,
-          getIt.get<SettingsStore>().mwebAlwaysScan,
           SettingsStoreBase.walletPasswordDirectInput,
+          getIt.get<SettingsStore>().mwebAlwaysScan,
         );
       case WalletType.ethereum:
         return ethereum!.createEthereumWalletService(
diff --git a/scripts/android/build_mwebd.sh b/scripts/android/build_mwebd.sh
index 1e4f51be9..90dbc4c20 100755
--- a/scripts/android/build_mwebd.sh
+++ b/scripts/android/build_mwebd.sh
@@ -1,4 +1,6 @@
-if [[ "$1" == "--install" ]]; then
+if [[ "$1" == "--dont-install" ]]; then
+  echo "Skipping Go installation as per --dont-install flag"
+else
   # install go > 1.23:
   wget https://go.dev/dl/go1.23.1.linux-amd64.tar.gz
   sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.23.1.linux-amd64.tar.gz
diff --git a/scripts/ios/build_mwebd.sh b/scripts/ios/build_mwebd.sh
index b0d67115e..f0fa64605 100755
--- a/scripts/ios/build_mwebd.sh
+++ b/scripts/ios/build_mwebd.sh
@@ -1,5 +1,7 @@
 #!/bin/bash
-if [[ "$1" == "--install" ]]; then
+if [[ "$1" == "--dont-install" ]]; then
+  echo "Skipping Go installation as per --dont-install flag"
+else
   # install go > 1.23:
   brew install go
   export PATH=$PATH:~/go/bin