add test: identity revocation
This commit is contained in:
parent
8663186a4a
commit
23b6858a60
|
@ -0,0 +1,32 @@
|
||||||
|
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';
|
||||||
|
import 'tests_utility.dart';
|
||||||
|
|
||||||
|
void main() async {
|
||||||
|
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
|
||||||
|
await dotenv.load();
|
||||||
|
|
||||||
|
testWidgets('Certifications state', (testerLoc) async {
|
||||||
|
tester = testerLoc;
|
||||||
|
// Connect local node and import test chest in background
|
||||||
|
await bkFastStart();
|
||||||
|
|
||||||
|
// Open chest
|
||||||
|
await firstOpenChest();
|
||||||
|
|
||||||
|
// Revoke test3
|
||||||
|
await spawnBlock(number: 5);
|
||||||
|
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 tapKey(keyCloseTransactionScreen, duration: 0);
|
||||||
|
await waitFor('Membre validé !', reverse: true);
|
||||||
|
}, timeout: testTimeout());
|
||||||
|
}
|
|
@ -844,13 +844,13 @@ newKeySig: $newKeySig""");
|
||||||
final idtyIndex = await _getIdentityIndexOf(address);
|
final idtyIndex = await _getIdentityIndexOf(address);
|
||||||
final sender = await _setSender(address);
|
final sender = await _setSender(address);
|
||||||
|
|
||||||
final prefix = '?'.codeUnits;
|
final prefix = 'revo'.codeUnits;
|
||||||
final genesisHashString = await getGenesisHash();
|
final genesisHashString = await getGenesisHash();
|
||||||
final genesisHash = HEX.decode(genesisHashString.substring(2)) as Uint8List;
|
final genesisHash = HEX.decode(genesisHashString.substring(2)) as Uint8List;
|
||||||
final idtyIndexBytes = _int32bytes(idtyIndex);
|
final idtyIndexBytes = _int32bytes(idtyIndex);
|
||||||
final oldPubkey = await addressToPubkey(address);
|
// final pubkey = await addressToPubkey(address);
|
||||||
final messageToSign =
|
final messageToSign =
|
||||||
Uint8List.fromList(prefix + genesisHash + idtyIndexBytes + oldPubkey);
|
Uint8List.fromList(prefix + idtyIndexBytes + genesisHash);
|
||||||
final revocationSig = await _signMessage(messageToSign, address, password);
|
final revocationSig = await _signMessage(messageToSign, address, password);
|
||||||
|
|
||||||
final txInfo = TxInfoData(
|
final txInfo = TxInfoData(
|
||||||
|
|
|
@ -86,9 +86,9 @@ class ManageMembership extends StatelessWidget {
|
||||||
Provider.of<MyWalletsProvider>(context, listen: false);
|
Provider.of<MyWalletsProvider>(context, listen: false);
|
||||||
SubstrateSdk sub = Provider.of<SubstrateSdk>(context, listen: false);
|
SubstrateSdk sub = Provider.of<SubstrateSdk>(context, listen: false);
|
||||||
|
|
||||||
MyWalletsProvider mw = MyWalletsProvider();
|
// MyWalletsProvider mw = MyWalletsProvider();
|
||||||
final wallet = mw.getWalletDataByAddress(address);
|
// final wallet = mw.getWalletDataByAddress(address);
|
||||||
await sub.setCurrentWallet(wallet!);
|
// await sub.setCurrentWallet(wallet!);
|
||||||
|
|
||||||
WalletData? defaultWallet = myWalletProvider.getDefaultWallet();
|
WalletData? defaultWallet = myWalletProvider.getDefaultWallet();
|
||||||
String? pin;
|
String? pin;
|
||||||
|
@ -110,7 +110,10 @@ class ManageMembership extends StatelessWidget {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(builder: (context) {
|
MaterialPageRoute(builder: (context) {
|
||||||
return const TransactionInProgress(transType: 'revokeIdty');
|
return TransactionInProgress(
|
||||||
|
transType: 'revokeIdty',
|
||||||
|
fromAddress: getShortPubkey(address),
|
||||||
|
toAddress: getShortPubkey(address));
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue