diff --git a/integration_test/duniter/data/gecko_data.json b/integration_test/duniter/data/gecko_data.json index 088753c..ebe8138 100644 --- a/integration_test/duniter/data/gecko_data.json +++ b/integration_test/duniter/data/gecko_data.json @@ -1,5 +1,5 @@ { - "initial_monetary_mass": 60100, + "initial_monetary_mass": 80100, "identities": { "test1": { "index": 0, @@ -61,11 +61,21 @@ }, "owner_pubkey": "6FgzG8NwatTWHo7rM7sPP6P4Q95R2ZQNqYiHCs38RT21" }, - "testCesium1": { + "test6": { "index": 5, "balance": 10000, "membership_expire_on": 1705509948, "next_cert_issuable_on": 1668347505, + "certs_received": { + "test1": 1727758466 + }, + "owner_pubkey": "FZ8URw5rPqpWegWnufpcBDkg6tMpc2JmNZVCuPA9g3nq" + }, + "testCesium1": { + "index": 6, + "balance": 10000, + "membership_expire_on": 1705509948, + "next_cert_issuable_on": 1668347505, "certs_received": { "test1": 1727758466, "test2": 1727758466, @@ -73,5 +83,8 @@ }, "owner_pubkey": "DCovzCEnQm9GUWe6mr8u42JR1JAuoj3HbQUGdCkfTzSr" } + }, + "wallets": { + "BPKBoTrrLD1XWmpZdRsfDnDT1M6PBBvgzPxAKNdutVV2": 10000 } } diff --git a/lib/globals.dart b/lib/globals.dart index 3ca2db8..3cb7d5f 100644 --- a/lib/globals.dart +++ b/lib/globals.dart @@ -30,7 +30,7 @@ const cesiumPod = "https://g1.data.le-sou.org"; // String cesiumPod = "https://g1.data.e-is.pro"; const datapodEndpoint = 'gdev-datapod.p2p.legal'; -// const v2sDatapod = 'http://10.0.2.2:8080'; +// const datapodEndpoint = '10.0.2.2:8080'; // Contexts late BuildContext homeContext; diff --git a/lib/providers/wallet_options.dart b/lib/providers/wallet_options.dart index de84886..ebb1fd2 100644 --- a/lib/providers/wallet_options.dart +++ b/lib/providers/wallet_options.dart @@ -67,11 +67,14 @@ class WalletOptionsProvider with ChangeNotifier { password: myWalletProvider.pinCode); } - await walletBox.delete(wallet.key); + await walletBox.delete(wallet.address); if (wallet.imageCustomPath != null) { final avatarFile = File(wallet.imageCustomPath!); - await avatarFile.delete(); + if (await avatarFile.exists()) { + await avatarFile.delete(); + } } + datapod.deleteProfile(address: wallet.address); await sub.deleteAccounts([wallet.address]); diff --git a/lib/screens/home.dart b/lib/screens/home.dart index 318be44..9cbac10 100644 --- a/lib/screens/home.dart +++ b/lib/screens/home.dart @@ -82,8 +82,10 @@ class _HomeScreenState extends State { 'wss://$validIndexerEndpoint/v1/graphql', ); + const headerWebsocket = + datapodEndpoint == '10.0.2.2:8080' ? 'ws' : 'wss'; final wsLinkDatapod = WebSocketLink( - 'wss://$datapodEndpoint/v1/graphql', + '$headerWebsocket://$datapodEndpoint/v1/graphql', ); duniterIndexer.indexerClient = GraphQLClient( diff --git a/lib/screens/myWallets/custom_derivations.dart b/lib/screens/myWallets/custom_derivations.dart index a2e9ef9..76e2885 100644 --- a/lib/screens/myWallets/custom_derivations.dart +++ b/lib/screens/myWallets/custom_derivations.dart @@ -122,7 +122,7 @@ class _CustomDerivationState extends State { ); } - if (myWalletProvider.pinCode != '') return; + if (myWalletProvider.pinCode == '') return; String newDerivationName = '${'wallet'.tr()} ${myWalletProvider.listWallets.last.number! + 2}'; if (dropdownValue == 'root') { diff --git a/lib/widgets/history_query.dart b/lib/widgets/history_query.dart index 2b0812c..b300687 100644 --- a/lib/widgets/history_query.dart +++ b/lib/widgets/history_query.dart @@ -63,22 +63,45 @@ class HistoryQuery extends StatelessWidget { } final List transactions = result.data?["transaction"]; + // Get transaction in progress if exist + String? transactionId; + for (final entry in sub.transactionStatus.entries) { + if (entry.value.from == address) { + transactionId = entry.key; + break; + } + } + if (result.hasException) { log.e('Error Indexer: ${result.exception}'); return Column(children: [ - ScaledSizedBox(height: 50), - Text( - "noNetworkNoHistory".tr(), - textAlign: TextAlign.center, - style: scaledTextStyle(fontSize: 18), + Column( + children: [ + if (transactionId != null) + TransactionInProgressTule( + address: address, transactionId: transactionId), + ScaledSizedBox(height: 50), + Text( + "noNetworkNoHistory".tr(), + textAlign: TextAlign.center, + style: scaledTextStyle(fontSize: 18), + ), + ], ) ]); } else if (transactions.isEmpty) { return Column(children: [ - ScaledSizedBox(height: 50), - Text( - "noDataToDisplay".tr(), - style: scaledTextStyle(fontSize: 18), + Column( + children: [ + if (transactionId != null) + TransactionInProgressTule( + address: address, transactionId: transactionId), + ScaledSizedBox(height: 50), + Text( + "noDataToDisplay".tr(), + style: scaledTextStyle(fontSize: 18), + ), + ], ) ]); } @@ -96,15 +119,6 @@ class HistoryQuery extends StatelessWidget { offset: transactions.length, ); - // Get transaction in progress if exist - String? transactionId; - for (final entry in sub.transactionStatus.entries) { - if (entry.value.from == address) { - transactionId = entry.key; - break; - } - } - // Build history list return NotificationListener( child: Builder( diff --git a/lib/widgets/transaction_in_progress_tile.dart b/lib/widgets/transaction_in_progress_tile.dart index 4331f84..ae48724 100644 --- a/lib/widgets/transaction_in_progress_tile.dart +++ b/lib/widgets/transaction_in_progress_tile.dart @@ -40,6 +40,7 @@ class _TransactionInProgressTuleState extends State { txContent = sub.transactionStatus[widget.transactionId]!; subscription = stream.listen((result) { + if (result.data?['account_by_pk'] == null) return; if (result.hasException) { log.e(result.exception); isVisible = true; @@ -128,7 +129,7 @@ class _TransactionInProgressTuleState extends State { statusIcon, ScaledSizedBox(width: 10), ScaledSizedBox( - width: 160, + width: 170, child: Text( humanStatus, style: scaledTextStyle(