recoverFromMnemonic using non empty seed on mainnet succeeds

This commit is contained in:
sneurlax 2022-12-09 10:41:54 -06:00
parent e3111cf9d2
commit 74a25d5001

View file

@ -793,80 +793,80 @@ void main() {
// verifyNoMoreInteractions(priceAPI); // verifyNoMoreInteractions(priceAPI);
// }); // });
// test("recoverFromMnemonic using non empty seed on mainnet succeeds", test("recoverFromMnemonic using non empty seed on mainnet succeeds",
// () async { () async {
// when(client?.getServerFeatures()).thenAnswer((_) async => { when(client?.getServerFeatures()).thenAnswer((_) async => {
// "hosts": {}, "hosts": {},
// "pruning": null, "pruning": null,
// "server_version": "Unit tests", "server_version": "Unit tests",
// "protocol_min": "1.4", "protocol_min": "1.4",
// "protocol_max": "1.4.2", "protocol_max": "1.4.2",
// "genesis_hash": GENESIS_HASH_MAINNET, "genesis_hash": GENESIS_HASH_MAINNET,
// "hash_function": "sha256", "hash_function": "sha256",
// "services": [] "services": []
// }); });
// when(client?.getBatchHistory(args: historyBatchArgs0)) when(client?.getBatchHistory(args: historyBatchArgs0))
// .thenAnswer((_) async => historyBatchResponse); .thenAnswer((_) async => historyBatchResponse);
// when(client?.getBatchHistory(args: historyBatchArgs1)) when(client?.getBatchHistory(args: historyBatchArgs1))
// .thenAnswer((_) async => historyBatchResponse); .thenAnswer((_) async => historyBatchResponse);
// when(client?.getBatchHistory(args: historyBatchArgs2)) when(client?.getBatchHistory(args: historyBatchArgs2))
// .thenAnswer((_) async => historyBatchResponse); .thenAnswer((_) async => historyBatchResponse);
// when(client?.getBatchHistory(args: historyBatchArgs3)) when(client?.getBatchHistory(args: historyBatchArgs3))
// .thenAnswer((_) async => historyBatchResponse); .thenAnswer((_) async => historyBatchResponse);
// when(client?.getBatchHistory(args: historyBatchArgs4)) when(client?.getBatchHistory(args: historyBatchArgs4))
// .thenAnswer((_) async => historyBatchResponse); .thenAnswer((_) async => historyBatchResponse);
// when(client?.getBatchHistory(args: historyBatchArgs5)) when(client?.getBatchHistory(args: historyBatchArgs5))
// .thenAnswer((_) async => historyBatchResponse); .thenAnswer((_) async => historyBatchResponse);
//
// List<dynamic> dynamicArgValues = []; List<dynamic> dynamicArgValues = [];
//
// when(client?.getBatchHistory(args: anyNamed("args"))) when(client?.getBatchHistory(args: anyNamed("args")))
// .thenAnswer((realInvocation) async { .thenAnswer((realInvocation) async {
// if (realInvocation.namedArguments.values.first.length == 1) { if (realInvocation.namedArguments.values.first.length == 1) {
// dynamicArgValues.add(realInvocation.namedArguments.values.first); dynamicArgValues.add(realInvocation.namedArguments.values.first);
// } }
//
// return historyBatchResponse; return historyBatchResponse;
// }); });
//
// await Hive.openBox<dynamic>(testWalletId); await Hive.openBox<dynamic>(testWalletId);
//
// bool hasThrown = false; bool hasThrown = false;
// try { try {
// await part?.recoverFromMnemonic( await part?.recoverFromMnemonic(
// mnemonic: TEST_MNEMONIC, mnemonic: TEST_MNEMONIC,
// maxUnusedAddressGap: 2, maxUnusedAddressGap: 2,
// maxNumberOfIndexesToCheck: 1000, maxNumberOfIndexesToCheck: 1000,
// height: 4000); height: 4000);
// } catch (_) { } catch (_) {
// hasThrown = true; hasThrown = true;
// } }
// expect(hasThrown, false); expect(hasThrown, false);
//
// verify(client?.getServerFeatures()).called(1); verify(client?.getServerFeatures()).called(1);
// verify(client?.getBatchHistory(args: historyBatchArgs0)).called(1); // verify(client?.getBatchHistory(args: historyBatchArgs0)).called(1); // TODO remove this def above
// verify(client?.getBatchHistory(args: historyBatchArgs1)).called(1); // verify(client?.getBatchHistory(args: historyBatchArgs1)).called(1); // TODO remove this def above
// verify(client?.getBatchHistory(args: historyBatchArgs2)).called(1); verify(client?.getBatchHistory(args: historyBatchArgs2)).called(1);
// verify(client?.getBatchHistory(args: historyBatchArgs3)).called(1); verify(client?.getBatchHistory(args: historyBatchArgs3)).called(1);
// verify(client?.getBatchHistory(args: historyBatchArgs4)).called(1); verify(client?.getBatchHistory(args: historyBatchArgs4)).called(1);
// verify(client?.getBatchHistory(args: historyBatchArgs5)).called(1); verify(client?.getBatchHistory(args: historyBatchArgs5)).called(1);
//
// for (final arg in dynamicArgValues) { for (final arg in dynamicArgValues) {
// final map = Map<String, List<dynamic>>.from(arg as Map); final map = Map<String, List<dynamic>>.from(arg as Map);
// verify(client?.getBatchHistory(args: map)).called(1); verify(client?.getBatchHistory(args: map)).called(1);
// expect(activeScriptHashes.contains(map.values.first.first as String), expect(activeScriptHashes.contains(map.values.first.first as String),
// true); true);
// } }
//
// expect(secureStore.interactions, 10); // 14 expect(secureStore.interactions, 10); // 14
// expect(secureStore.writes, 5); // 7 expect(secureStore.writes, 5); // 7
// expect(secureStore.reads, 5); // 7 expect(secureStore.reads, 5); // 7
// expect(secureStore.deletes, 0); expect(secureStore.deletes, 0);
//
// verifyNoMoreInteractions(client); verifyNoMoreInteractions(client);
// verifyNoMoreInteractions(cachedClient); verifyNoMoreInteractions(cachedClient);
// verifyNoMoreInteractions(priceAPI); verifyNoMoreInteractions(priceAPI);
// }); });
test("fullRescan succeeds", () async { test("fullRescan succeeds", () async {
when(client?.getServerFeatures()).thenAnswer((_) async => { when(client?.getServerFeatures()).thenAnswer((_) async => {