fix revocation payload

This commit is contained in:
poka 2022-09-08 20:15:19 +02:00
parent e752de474d
commit 3825bf0488
2 changed files with 8 additions and 5 deletions

View File

@ -1,6 +1,5 @@
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:gecko/globals.dart';
import 'package:gecko/models/widgets_keys.dart';
import 'package:integration_test/integration_test.dart';
import 'general_actions.dart';
@ -10,7 +9,7 @@ void main() async {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
await dotenv.load();
testWidgets('Certifications state', (testerLoc) async {
testWidgets('Identity revocation', (testerLoc) async {
tester = testerLoc;
// Connect local node and import test chest in background
await bkFastStart();
@ -19,13 +18,13 @@ void main() async {
await firstOpenChest();
// Revoke test3
await spawnBlock(number: 5);
await spawnBlock();
await tapKey(keyOpenWallet(test3.address));
await tapKey(keyManageMembership);
await tapKey(keyRevokeIdty);
await tapKey(keyConfirm);
spawnBlock(duration: 2000);
await waitFor('validé !', timeout: const Duration(seconds: 1));
await waitFor('validé !', timeout: const Duration(seconds: 4));
await tapKey(keyCloseTransactionScreen, duration: 0);
await waitFor('Membre validé !', reverse: true);
}, timeout: testTimeout());

View File

@ -851,8 +851,9 @@ newKeySig: $newKeySig""");
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 + idtyIndexBytes + genesisHash);
Uint8List.fromList(prefix + genesisHash + idtyIndexBytes);
final revocationSig = await _signMessage(messageToSign, address, password);
final txInfo = TxInfoData(
@ -861,6 +862,9 @@ newKeySig: $newKeySig""");
sender,
);
log.d('''DEBUGG: messageToSign: $messageToSign
revocationSig: $revocationSig''');
final txOptions = [idtyIndex, address, revocationSig];
return await _executeCall(txInfo, txOptions, password);
}