Skip to content
Snippets Groups Projects
Commit f7fd90ed authored by poka's avatar poka
Browse files

fix: actualize currendUdIndex before computeUnclainedUds

parent 09c869e6
No related branches found
No related tags found
No related merge requests found
Pipeline #19143 waiting for manual action
......@@ -3,7 +3,7 @@ version: "3.5"
services:
duniter-v2s-gecko-tests:
container_name: duniter-v2s-gecko-tests
image: duniter/duniter-v2s:debug-latest
image: duniter/duniter-v2s:debug-sha-4d5e08be
command: --sealing=manual
ports:
- "127.0.0.1:9615:9615"
......
......@@ -25,7 +25,7 @@ void main() async {
await tapKey(keyConfirmSearch);
await waitFor(test5.shortAddress());
await tapKey(keySearchResult(test5.address));
await waitFor('certify'.tr());
await waitFor('createIdentity'.tr());
await waitFor('mustWaitXBeforeCertify'.tr().substring(0, 6), reverse: true);
await waitFor('canRenewCertInX'.tr().substring(0, 8), reverse: true);
......
......@@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
import 'package:gecko/globals.dart';
import 'package:gecko/models/chest_data.dart';
import 'package:gecko/models/wallet_data.dart';
import 'package:gecko/providers/duniter_indexer.dart';
import 'package:gecko/providers/home.dart';
import 'package:gecko/providers/my_wallets.dart';
import 'package:gecko/providers/wallet_options.dart';
......@@ -220,6 +221,7 @@ class SubstrateSdk with ChangeNotifier {
await _getStorage('universalDividend.pastReevals()');
// Compute amount of claimable UDs
currentUdIndex = await getCurrentUdIndex();
final int unclaimedUds = _computeUnclaimUds(
idtyData?['data']?['firstEligibleUd'] ?? 0, pastReevals);
......@@ -265,6 +267,9 @@ class SubstrateSdk with ChangeNotifier {
}
}
// log.d(
// "debug computeUnclaimUds: ${pastReevals.reversed} --- $firstEligibleUd --- $currentUdIndex");
return totalAmount;
}
......@@ -584,10 +589,14 @@ class SubstrateSdk with ChangeNotifier {
}
notifyListeners();
});
currentUdIndex =
int.parse(await _getStorage('universalDividend.currentUdIndex()'));
currentUdIndex = await getCurrentUdIndex();
await getBalanceRatio();
// Currency parameters
await initCurrencyParameters();
// Indexer Blockchain start
getBlockStart();
notifyListeners();
homeProvider.changeMessage(
"wellConnectedToNode"
......@@ -618,6 +627,10 @@ class SubstrateSdk with ChangeNotifier {
return node;
}
Future<int> getCurrentUdIndex() async {
return int.parse(await _getStorage('universalDividend.currentUdIndex()'));
}
NetworkParams getDuniterCustomEndpoint() {
final nodeParams = NetworkParams();
nodeParams.name = currencyName;
......@@ -935,6 +948,9 @@ class SubstrateSdk with ChangeNotifier {
// log.d('debug: ${currencyParameters['minCertForMembership']}');
log.d(
"debug toCert: ${toCerts[0]} --- ${currencyParameters['minCertForMembership']!} --- $toIdtyStatus");
if (toIdtyStatus == 'noid') {
txInfo = TxInfoData(
'identity',
......
......@@ -95,10 +95,6 @@ class _HomeScreenState extends State<HomeScreen> {
var connectivityResult = await (Connectivity().checkConnectivity());
if (connectivityResult != ConnectivityResult.none) {
await sub.connectNode(context);
// Currency parameters
await sub.initCurrencyParameters();
// Indexer Blockchain start
getBlockStart();
}
}
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment