From d728b8e1e30bb772609b9645f38591b1f1f96d45 Mon Sep 17 00:00:00 2001 From: kumulynja Date: Mon, 19 Feb 2024 16:58:36 +0100 Subject: [PATCH] Change mnemonic generation return type --- example/lib/main.dart | 4 +--- lib/src/root.dart | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/example/lib/main.dart b/example/lib/main.dart index 53c892c..cac9197 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -72,9 +72,7 @@ class _MyAppState extends State { ldk.SocketAddress.hostname(addr: "0.0.0.0", port: 3003)); ldk.Builder aliceBuilder = ldk.Builder.fromConfig(config: aliceConfig); aliceNode = await aliceBuilder - .setEntropyBip39Mnemonic( - mnemonic: ldk.Mnemonic( - "cart super leaf clinic pistol plug replace close super tooth wealth usage")) + .setEntropyBip39Mnemonic(mnemonic: await ldk.Mnemonic.generate()) .setEsploraServer(esploraUrl) .build(); await startNode(aliceNode); diff --git a/lib/src/root.dart b/lib/src/root.dart index ef84399..129d659 100644 --- a/lib/src/root.dart +++ b/lib/src/root.dart @@ -7,9 +7,9 @@ import 'package:path_provider/path_provider.dart'; class Mnemonic extends bridge.Mnemonic { Mnemonic(String seedPhrase) : super(bridge: loaderApi, seedPhrase: seedPhrase); - static Future generate() async { + static Future generate() async { final res = await bridge.Mnemonic.generate(bridge: loaderApi); - return res; + return Mnemonic(res.seedPhrase); } }