From aa7bc7464500dd83abc991ac142e94d6dc32e32c Mon Sep 17 00:00:00 2001
From: poka <poka@p2p.legal>
Date: Sat, 27 Aug 2022 00:31:19 +0200
Subject: [PATCH] add .env to git repository with default value

---
 .env                                 |  1 +
 .gitignore                           |  1 -
 integration_test/gecko_complete.dart | 13 ++++++-------
 integration_test/launch_test.sh      |  3 +++
 integration_test/tests_utility.dart  |  2 +-
 5 files changed, 11 insertions(+), 9 deletions(-)
 create mode 100644 .env

diff --git a/.env b/.env
new file mode 100644
index 00000000..797c39fb
--- /dev/null
+++ b/.env
@@ -0,0 +1 @@
+ip_address=127.0.0.1
diff --git a/.gitignore b/.gitignore
index b021e4ec..e903697f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -56,5 +56,4 @@ AppDir/
 appimage-builder-cache/
 AppImageBuilder.yml
 android/app/build.gradle
-.env
 integration_test/duniter/data/chains/
\ No newline at end of file
diff --git a/integration_test/gecko_complete.dart b/integration_test/gecko_complete.dart
index 07e43c08..7c7c3a71 100644
--- a/integration_test/gecko_complete.dart
+++ b/integration_test/gecko_complete.dart
@@ -18,16 +18,16 @@ void main() {
     // Change Duniter endpoint to local
     await changeNode(tester);
 
-    // Delete all existing chests
+    // Delete all existing chests is exists
     await deleteAllWallets(tester);
 
-    // Restore a chest
+    // Restore the test chest
     await restoreChest(tester);
 
     // Execute a transaction to test2
     await payTest2(tester);
 
-    // Certify test5 account with 3 account to become member
+    // Certify test5 account with 3 accounts to become member
     await certifyTest5(tester);
   });
 }
@@ -47,7 +47,6 @@ Future changeNode(WidgetTester tester) async {
   await goBack(tester);
 }
 
-// Customs actions
 Future deleteAllWallets(WidgetTester tester) async {
   if (await isPresent(tester, 'Rechercher')) {
     await goKey(tester, keyDrawerMenu);
@@ -133,7 +132,6 @@ Future payTest2(WidgetTester tester) async {
   await goKey(tester, keyPay);
   await enterText(tester, keyAmountField, '12.14');
   await goKey(tester, keyConfirmPayment);
-  // await sleep(tester);
   await spawnBlock(tester, keyCloseTransactionScreen);
 
   await waitFor(tester, 'validé !', timeout: const Duration(seconds: 1));
@@ -150,8 +148,6 @@ Future addDerivation(WidgetTester tester) async {
 
 Future certifyTest5(WidgetTester tester) async {
   // Create identity with Test1 account
-  // await spawnBlock(tester, keyViewActivity, 5);
-  // await sleep(tester);
   await goKey(tester, keyCertify);
   await goKey(tester, keyConfirm);
   await spawnBlock(tester, keyViewActivity, duration: 500);
@@ -171,12 +167,15 @@ Future certifyTest5(WidgetTester tester) async {
   await waitFor(tester, 'validé !', timeout: const Duration(seconds: 1));
   await goKey(tester, keyCloseTransactionScreen);
   await waitFor(tester, 'Identité confirmée');
+
+  // Set wallet 2 as default wallet
   await goBack(tester);
   await goKey(tester,
       keyOpenWallet('5E4i8vcNjnrDp21Sbnp32WHm2gz8YP3GGFwmdpfg5bHd8Whb'));
   await goKey(tester, keySetDefaultWallet);
   await waitFor(tester, 'Ce portefeuille est celui par defaut');
 
+  // Search Wallet 5 again
   await goKey(tester, keyAppBarSearch);
   final addressToSearch = (await Clipboard.getData('text/plain'))!.text;
   final endAddress = addressToSearch!.substring(addressToSearch.length - 6);
diff --git a/integration_test/launch_test.sh b/integration_test/launch_test.sh
index aa72d853..c4a4b870 100755
--- a/integration_test/launch_test.sh
+++ b/integration_test/launch_test.sh
@@ -21,6 +21,9 @@ cd ../..
 # Start integration test
 flutter test integration_test/$testName.dart
 
+# Reset .env
+echo "ip_address=127.0.0.1" > .env
+
 # Stop Duniter
 cd integration_test/duniter
 docker-compose down
diff --git a/integration_test/tests_utility.dart b/integration_test/tests_utility.dart
index e3d31a5a..260f3912 100644
--- a/integration_test/tests_utility.dart
+++ b/integration_test/tests_utility.dart
@@ -4,7 +4,7 @@ import 'package:gecko/globals.dart';
 import 'package:gecko/providers/substrate_sdk.dart';
 import 'package:provider/provider.dart';
 
-// CUSTOM METHODS
+// CUSTOM FUNCTIONS
 
 Future sleep(WidgetTester tester, [int time = 1000]) async {
   await Future.delayed(Duration(milliseconds: time));
-- 
GitLab