fix: actualize currendUdIndex before computeUnclainedUds
This commit is contained in:
parent
09c869e67c
commit
f7fd90ed78
|
@ -202,7 +202,7 @@
|
||||||
"smithCantMigrateIdentity": "You can't migrate this identity while you're member of smith web",
|
"smithCantMigrateIdentity": "You can't migrate this identity while you're member of smith web",
|
||||||
"received": "Received",
|
"received": "Received",
|
||||||
"sent": "Sent",
|
"sent": "Sent",
|
||||||
"createIdentity": "Create a new \nidentity",
|
"createIdentity": "Create a new\nidentity",
|
||||||
"memberAccountOf": "Account of {}",
|
"memberAccountOf": "Account of {}",
|
||||||
"pasteAddress": "Paste address from\nclipboard",
|
"pasteAddress": "Paste address from\nclipboard",
|
||||||
"historyStart": "Beginning of history",
|
"historyStart": "Beginning of history",
|
||||||
|
|
|
@ -203,7 +203,7 @@
|
||||||
"smithCantMigrateIdentity": "You can't migrate this identity while you're member of smith web",
|
"smithCantMigrateIdentity": "You can't migrate this identity while you're member of smith web",
|
||||||
"received": "Received",
|
"received": "Received",
|
||||||
"sent": "Sent",
|
"sent": "Sent",
|
||||||
"createIdentity": "Create a new \nidentity",
|
"createIdentity": "Create a new\nidentity",
|
||||||
"memberAccountOf": "Account of {}",
|
"memberAccountOf": "Account of {}",
|
||||||
"pasteAddress": "Paste address from\nclipboard",
|
"pasteAddress": "Paste address from\nclipboard",
|
||||||
"historyStart": "Beginning of history",
|
"historyStart": "Beginning of history",
|
||||||
|
|
|
@ -3,7 +3,7 @@ version: "3.5"
|
||||||
services:
|
services:
|
||||||
duniter-v2s-gecko-tests:
|
duniter-v2s-gecko-tests:
|
||||||
container_name: 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
|
command: --sealing=manual
|
||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:9615:9615"
|
- "127.0.0.1:9615:9615"
|
||||||
|
|
|
@ -25,7 +25,7 @@ void main() async {
|
||||||
await tapKey(keyConfirmSearch);
|
await tapKey(keyConfirmSearch);
|
||||||
await waitFor(test5.shortAddress());
|
await waitFor(test5.shortAddress());
|
||||||
await tapKey(keySearchResult(test5.address));
|
await tapKey(keySearchResult(test5.address));
|
||||||
await waitFor('certify'.tr());
|
await waitFor('createIdentity'.tr());
|
||||||
await waitFor('mustWaitXBeforeCertify'.tr().substring(0, 6), reverse: true);
|
await waitFor('mustWaitXBeforeCertify'.tr().substring(0, 6), reverse: true);
|
||||||
await waitFor('canRenewCertInX'.tr().substring(0, 8), 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/globals.dart';
|
||||||
import 'package:gecko/models/chest_data.dart';
|
import 'package:gecko/models/chest_data.dart';
|
||||||
import 'package:gecko/models/wallet_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/home.dart';
|
||||||
import 'package:gecko/providers/my_wallets.dart';
|
import 'package:gecko/providers/my_wallets.dart';
|
||||||
import 'package:gecko/providers/wallet_options.dart';
|
import 'package:gecko/providers/wallet_options.dart';
|
||||||
|
@ -220,6 +221,7 @@ class SubstrateSdk with ChangeNotifier {
|
||||||
await _getStorage('universalDividend.pastReevals()');
|
await _getStorage('universalDividend.pastReevals()');
|
||||||
|
|
||||||
// Compute amount of claimable UDs
|
// Compute amount of claimable UDs
|
||||||
|
currentUdIndex = await getCurrentUdIndex();
|
||||||
final int unclaimedUds = _computeUnclaimUds(
|
final int unclaimedUds = _computeUnclaimUds(
|
||||||
idtyData?['data']?['firstEligibleUd'] ?? 0, pastReevals);
|
idtyData?['data']?['firstEligibleUd'] ?? 0, pastReevals);
|
||||||
|
|
||||||
|
@ -265,6 +267,9 @@ class SubstrateSdk with ChangeNotifier {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// log.d(
|
||||||
|
// "debug computeUnclaimUds: ${pastReevals.reversed} --- $firstEligibleUd --- $currentUdIndex");
|
||||||
|
|
||||||
return totalAmount;
|
return totalAmount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -584,10 +589,14 @@ class SubstrateSdk with ChangeNotifier {
|
||||||
}
|
}
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
});
|
});
|
||||||
currentUdIndex =
|
currentUdIndex = await getCurrentUdIndex();
|
||||||
int.parse(await _getStorage('universalDividend.currentUdIndex()'));
|
|
||||||
await getBalanceRatio();
|
await getBalanceRatio();
|
||||||
|
|
||||||
|
// Currency parameters
|
||||||
|
await initCurrencyParameters();
|
||||||
|
// Indexer Blockchain start
|
||||||
|
getBlockStart();
|
||||||
|
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
homeProvider.changeMessage(
|
homeProvider.changeMessage(
|
||||||
"wellConnectedToNode"
|
"wellConnectedToNode"
|
||||||
|
@ -618,6 +627,10 @@ class SubstrateSdk with ChangeNotifier {
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<int> getCurrentUdIndex() async {
|
||||||
|
return int.parse(await _getStorage('universalDividend.currentUdIndex()'));
|
||||||
|
}
|
||||||
|
|
||||||
NetworkParams getDuniterCustomEndpoint() {
|
NetworkParams getDuniterCustomEndpoint() {
|
||||||
final nodeParams = NetworkParams();
|
final nodeParams = NetworkParams();
|
||||||
nodeParams.name = currencyName;
|
nodeParams.name = currencyName;
|
||||||
|
@ -935,6 +948,9 @@ class SubstrateSdk with ChangeNotifier {
|
||||||
|
|
||||||
// log.d('debug: ${currencyParameters['minCertForMembership']}');
|
// log.d('debug: ${currencyParameters['minCertForMembership']}');
|
||||||
|
|
||||||
|
log.d(
|
||||||
|
"debug toCert: ${toCerts[0]} --- ${currencyParameters['minCertForMembership']!} --- $toIdtyStatus");
|
||||||
|
|
||||||
if (toIdtyStatus == 'noid') {
|
if (toIdtyStatus == 'noid') {
|
||||||
txInfo = TxInfoData(
|
txInfo = TxInfoData(
|
||||||
'identity',
|
'identity',
|
||||||
|
|
|
@ -95,10 +95,6 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||||
var connectivityResult = await (Connectivity().checkConnectivity());
|
var connectivityResult = await (Connectivity().checkConnectivity());
|
||||||
if (connectivityResult != ConnectivityResult.none) {
|
if (connectivityResult != ConnectivityResult.none) {
|
||||||
await sub.connectNode(context);
|
await sub.connectNode(context);
|
||||||
// Currency parameters
|
|
||||||
await sub.initCurrencyParameters();
|
|
||||||
// Indexer Blockchain start
|
|
||||||
getBlockStart();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue