improve migration text infos

This commit is contained in:
poka 2022-09-11 07:53:34 +02:00
parent 164fc16ed8
commit 776a0f8c75
7 changed files with 25 additions and 11 deletions

View File

@ -178,7 +178,7 @@
"youAreOffline": "You are offline...",
"importG1v1": "Import old G1v1 account",
"selectDestWallet": "Select a target wallet:",
"youMustWaitBeforeCashoutThisAccount": "You have to wait {} minutes\nbefore migrate this account",
"youMustWaitBeforeCashoutThisAccount": "You have to wait a few moment before migrate this account",
"thisAccountIsEmpty": "This account is empty",
"youCannotMigrateIdentityToExistingIdentity": "You cannot migrate an identity\nto an account that already has an identity",
"importOldAccount": "Import your old account",

View File

@ -178,7 +178,7 @@
"youAreOffline": "You are offline...",
"importG1v1": "Import old G1v1 account",
"selectDestWallet": "Select a target wallet:",
"youMustWaitBeforeCashoutThisAccount": "You have to wait {} minutes\nbefore migrate this account",
"youMustWaitBeforeCashoutThisAccount": "You have to wait a few moment before migrate this account",
"thisAccountIsEmpty": "This account is empty",
"youCannotMigrateIdentityToExistingIdentity": "You cannot migrate an identity\nto an account that already has an identity",
"importOldAccount": "Import your old account",

View File

@ -179,7 +179,7 @@
"youAreOffline": "Vous êtes hors ligne...",
"importG1v1": "Importer un ancien compte G1v1",
"selectDestWallet": "Sélectionnez un portefeuille cible:",
"youMustWaitBeforeCashoutThisAccount": "Vous devez attendre {} minutes\navant de pouvoir migrer ce compte",
"youMustWaitBeforeCashoutThisAccount": "Vous devez attendre quelques minutes avant de pouvoir migrer ce compte",
"thisAccountIsEmpty": "Ce compte est vide",
"youCannotMigrateIdentityToExistingIdentity": "Vous ne pouvez pas migrer une identité\nvers un compte disposant déjà d'une identité",
"importOldAccount": "Importer son ancien compte",

View File

@ -46,8 +46,22 @@ void main() async {
// Check test1 cannot be revoked
await goBack();
await tapKey(keyOpenWallet(test1.address));
await tapKey(keyAddDerivation);
await tapKey(keyOpenWallet(test1.address), duration: 500);
await tapKey(keyManageMembership, duration: 1000);
await waitFor('Vous ne pouvez pas révoquer cette identité');
// // Try migrate test1 identity to test6 address
// await tapKey(keyMigrateIdentity);
// await tapKey(keySelectWallet);
// await tapKey(keySelectThisWallet(test6.address), selectLast: true);
// await spawnBlock(number: 100);
// await waitFor('Vous devez attendre', reverse: true);
// await waitForButtonEnabled(keyConfirm);
// await tapKey(keyConfirm, duration: 500);
// await spawnBlock(duration: 2000);
// await waitFor('validé !');
// await tapKey(keyCloseTransactionScreen, duration: 0);
// await sleep(5000);
}, timeout: testTimeout());
}

View File

@ -135,9 +135,11 @@ Future<void> waitFor(String text,
Finder finder = exactMatch ? find.text(text) : find.textContaining(text);
log.d('INTEGRATION TEST: Wait for: $text');
final String searchType = reverse ? 'reversed text' : 'text';
do {
if (DateTime.now().isAfter(end)) {
throw Exception('Timed out waiting for text $text');
throw Exception('Timed out waiting for $searchType : "$text"');
}
await tester.pumpAndSettle();

View File

@ -879,8 +879,6 @@ newKeySig: $newKeySig""");
final genesisHashString = await getGenesisHash();
final genesisHash = HEX.decode(genesisHashString.substring(2)) as Uint8List;
final idtyIndexBytes = _int32bytes(idtyIndex);
// final pubkey = await addressToPubkey(address);
// final pubkeyHexa = '0x${HEX.encode(pubkey)}';
final messageToSign =
Uint8List.fromList(prefix + genesisHash + idtyIndexBytes);
final revocationSig =
@ -893,10 +891,6 @@ newKeySig: $newKeySig""");
sender,
);
log.d('''DEBUGG: messageToSign: $messageToSign
revocationSig: $revocationSig
revocationSigTyped: $revocationSigTyped''');
final txOptions = [idtyIndex, address, revocationSigTyped];
return await _executeCall(txInfo, txOptions, password);
}

View File

@ -6,6 +6,7 @@ import 'package:flutter_markdown/flutter_markdown.dart';
import 'package:gecko/globals.dart';
import 'package:flutter/material.dart';
import 'package:gecko/models/wallet_data.dart';
import 'package:gecko/models/widgets_keys.dart';
import 'package:gecko/providers/duniter_indexer.dart';
import 'package:gecko/providers/my_wallets.dart';
import 'package:gecko/providers/substrate_sdk.dart';
@ -163,12 +164,14 @@ class MigrateIdentityScreen extends StatelessWidget {
Text('selectDestWallet'.tr()),
const SizedBox(height: 5),
DropdownButtonHideUnderline(
key: keySelectWallet,
child: DropdownButton(
// alignment: AlignmentDirectional.topStart,
value: selectedWallet,
icon: const Icon(Icons.keyboard_arrow_down),
items: walletsList.map((wallet) {
return DropdownMenuItem(
key: keySelectThisWallet(wallet.address!),
value: wallet,
child: Text(
wallet.name!,
@ -187,6 +190,7 @@ class MigrateIdentityScreen extends StatelessWidget {
width: 380 * ratio,
height: 60 * ratio,
child: ElevatedButton(
key: keyConfirm,
style: ElevatedButton.styleFrom(
foregroundColor: Colors.white, elevation: 4,
backgroundColor: orangeC, // foreground