Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1046,8 +1046,8 @@ packages:
dependency: "direct main"
description:
path: "."
ref: "5722fb3ba05c8f52e8e0255c485ae5ea52e9a694"
resolved-ref: "5722fb3ba05c8f52e8e0255c485ae5ea52e9a694"
ref: "d4852f3ebaaef20d71a8954098634af8e25c3b50"
resolved-ref: "d4852f3ebaaef20d71a8954098634af8e25c3b50"
url: "https://github.com/cypherstack/flutter_libmwc.git"
source: git
version: "0.1.0"
Expand Down
2 changes: 1 addition & 1 deletion scripts/app_config/templates/pubspec.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ dependencies:
# flutter_libmwc:
# git:
# url: https://github.com/cypherstack/flutter_libmwc.git
# ref: 5722fb3ba05c8f52e8e0255c485ae5ea52e9a694
# ref: d4852f3ebaaef20d71a8954098634af8e25c3b50
# %%END_ENABLE_MWC%%

# %%ENABLE_TOR%%
Expand Down
2 changes: 1 addition & 1 deletion tool/native_dependency_compatibility.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"f7fea2a926ea88e2eb6a353579372188d6915314": { "version": "27.0", "build": "27A266a" },
"6e954a9d5a0aaaafb861049b79041d7ae98c2a08": { "version": "27.0", "build": "27A266a" },
"63e93b01c3c4c68a52b26a43e4442a4738d5e7e8": { "version": "27.0", "build": "27A266a" },
"5722fb3ba05c8f52e8e0255c485ae5ea52e9a694": { "version": "27.0", "build": "27A266a" }
"d4852f3ebaaef20d71a8954098634af8e25c3b50": { "version": "27.0", "build": "27A266a" }
}
}
34 changes: 28 additions & 6 deletions tool/wl_templates/MWC_libmwc_interface_impl.template.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
//ON
import 'dart:async';

import 'package:flutter_libmwc/lib.dart' as mimblewimblecoin;
import 'package:flutter_libmwc/models/transaction.dart'
as mimblewimblecoin_models;

import '../../utilities/logger.dart';
//END_ON
import '../interfaces/libmwc_interface.dart';

Expand Down Expand Up @@ -261,26 +264,45 @@ final class _LibMwcInterfaceImpl extends LibMwcInterface {
required String wallet,
required String mwcmqsConfig,
}) {
return mimblewimblecoin.Libmwc.startMwcMqsListener(
wallet: wallet,
mwcmqsConfig: mwcmqsConfig,
// The plugin's start is asynchronous and throws when the listener cannot
// start. Callers treat this as fire and forget, so log the failure.
unawaited(
mimblewimblecoin.Libmwc.startMwcMqsListener(
wallet: wallet,
mwcmqsConfig: mwcmqsConfig,
).then<void>(
(_) {},
onError: (Object e, StackTrace s) =>
Logging.instance.e('Failed to start MWCMQS listener: $e\n$s'),
),
);
}

@override
void stopMwcMqsListener() {
return mimblewimblecoin.Libmwc.stopMwcMqsListener();
// The plugin stops only the listener of the wallet passed to it; this
// interface stops whichever listener is running.
final owner = mimblewimblecoin.ListenerManager.wallet;
if (owner == null) return;
unawaited(
mimblewimblecoin.Libmwc.stopMwcMqsListener(wallet: owner).then<void>(
(_) {},
onError: (Object e, StackTrace s) =>
Logging.instance.e('Failed to stop MWCMQS listener: $e\n$s'),
),
);
}

@override
Future<({String commitId, String slateId})> txFinalize({
required String wallet,
required String slateJson,
}) {
return mimblewimblecoin.Libmwc.txFinalize(
}) async {
final result = await mimblewimblecoin.Libmwc.txFinalize(
wallet: wallet,
slateJson: slateJson,
);
return (commitId: result.commitId, slateId: result.slateId);
}

@override
Expand Down
Loading