Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply method naming changes in Breez SDK #610

Merged
merged 1 commit into from
Jul 24, 2023
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
2 changes: 1 addition & 1 deletion lib/background/breez_service_initializer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Future<BreezBridge> initializeBreezServices() async {
print("Initialized Services");
print("Node has started");
}
await breezLib.syncNode();
await breezLib.sync();
print("Node has synchronized");
return breezLib;
}
2 changes: 1 addition & 1 deletion lib/bloc/account/account_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class AccountBloc extends Cubit<AccountState> with HydratedMixin {
var lastSync = DateTime.fromMillisecondsSinceEpoch(0);
FGBGEvents.stream.listen((event) async {
if (event == FGBGType.foreground && DateTime.now().difference(lastSync).inSeconds > nodeSyncInterval) {
await _breezLib.syncNode();
await _breezLib.sync();
lastSync = DateTime.now();
}
});
Expand Down
2 changes: 1 addition & 1 deletion lib/bloc/input/input_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class InputBloc extends Cubit<InputState> {
Future<InputState> handlePaymentRequest({required InputType_Bolt11 inputData}) async {
final LNInvoice lnInvoice = inputData.invoice;

NodeState? nodeState = await _breezLib.getNodeState();
NodeState? nodeState = await _breezLib.nodeInfo();
if (nodeState == null || nodeState.id == lnInvoice.payeePubkey) {
return InputState(isLoading: false);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/bloc/withdraw/withdraw_funds_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class WithdrawFundsBloc extends Cubit<WithdrawFundsState> {
}

Future<int> _retrieveUTXOS() async {
final nodeState = await _breezLib.getNodeState();
final nodeState = await _breezLib.nodeInfo();
if (nodeState == null) {
_log.e("_retrieveUTXOS Failed to get node state");
throw Exception(getSystemAppLocalizations().node_state_error);
Expand Down
66 changes: 33 additions & 33 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ packages:
dependency: transitive
description:
name: _flutterfire_internals
sha256: a742f71d7f3484253a623b30e19256aa4668ecbb3de6ad1beb0bcf8d4777ecd8
sha256: "5dce45a06d386358334eb1689108db6455d90ceb0d75848d5f4819283d4ee2b8"
url: "https://pub.dev"
source: hosted
version: "1.3.3"
version: "1.3.4"
analyzer:
dependency: transitive
description:
Expand Down Expand Up @@ -95,7 +95,7 @@ packages:
path: "../breez-sdk/libs/sdk-flutter"
relative: true
source: path
version: "0.0.4"
version: "0.1.4"
breez_translations:
dependency: "direct main"
description:
Expand Down Expand Up @@ -373,10 +373,10 @@ packages:
dependency: transitive
description:
name: file_selector_macos
sha256: "7a6f1ae6107265664f3f7f89a66074882c4d506aef1441c9af313c1f7e6f41ce"
sha256: "4ada532862917bf16e3adb3891fe3a5917a58bae03293e497082203a80909412"
url: "https://pub.dev"
source: hosted
version: "0.9.3"
version: "0.9.3+1"
file_selector_platform_interface:
dependency: transitive
description:
Expand Down Expand Up @@ -413,10 +413,10 @@ packages:
dependency: "direct main"
description:
name: firebase_core
sha256: a4a99204da264a0aa9d54a332ea0315ce7b0768075139c77abefe98093dd98be
sha256: "2e9324f719e90200dc7d3c4f5d2abc26052f9f2b995d3b6626c47a0dfe1c8192"
url: "https://pub.dev"
source: hosted
version: "2.14.0"
version: "2.15.0"
firebase_core_platform_interface:
dependency: transitive
description:
Expand All @@ -437,42 +437,42 @@ packages:
dependency: "direct main"
description:
name: firebase_dynamic_links
sha256: "9b984d0abd227a702451a997abcca763f4dbf67e260dad60e5506d55e3eff244"
sha256: "4872f4d7e94736041398bc3490c2ddd87ee159d6b051ba01ca2708e5260a7ebe"
url: "https://pub.dev"
source: hosted
version: "5.3.3"
version: "5.3.4"
firebase_dynamic_links_platform_interface:
dependency: transitive
description:
name: firebase_dynamic_links_platform_interface
sha256: "6ef00a0be18f3231e9727f7c4b31db89dbfa16792098beb850603c30854560ff"
sha256: "946fccfefb67e26bf63e392f1b3917d79ea031d3071488f0c5e8ab72de8219ab"
url: "https://pub.dev"
source: hosted
version: "0.2.6+3"
version: "0.2.6+4"
firebase_messaging:
dependency: "direct main"
description:
name: firebase_messaging
sha256: "7a09d8c21147f009882a27c96de1918ea283f974d73cb6fae1d234bb9ec18d8b"
sha256: "8ac91d83a028eef050de770f1dc98421e215714d245f34de7b154d436676fbd0"
url: "https://pub.dev"
source: hosted
version: "14.6.4"
version: "14.6.5"
firebase_messaging_platform_interface:
dependency: transitive
description:
name: firebase_messaging_platform_interface
sha256: e9e9dc48a3d8ffa67aaba3d6b1ebf74bc7d7d8c83d10b1458ff97878b9d8a2b0
sha256: b2995e3640efb646e9ebf0e2fa50dea84895f0746a31d7e3af0e5e009a533a1a
url: "https://pub.dev"
source: hosted
version: "4.5.3"
version: "4.5.4"
firebase_messaging_web:
dependency: transitive
description:
name: firebase_messaging_web
sha256: "381f217e41e0e407baf8df21787b97e46fabfacefd6a953425be3a6cdf2269f4"
sha256: "5d8446a28339124a2cb4f57a6ca454a3aca7d0c5c0cdfa5707afb192f7c830a7"
url: "https://pub.dev"
source: hosted
version: "3.5.3"
version: "3.5.4"
fixnum:
dependency: transitive
description:
Expand Down Expand Up @@ -837,10 +837,10 @@ packages:
dependency: transitive
description:
name: image_picker_android
sha256: d2bab152deb2547ea6f53d82ebca9b7e77386bb706e5789e815d37e08ea475bb
sha256: "8179b54039b50eee561676232304f487602e2950ffb3e8995ed9034d6505ca34"
url: "https://pub.dev"
source: hosted
version: "0.8.7+3"
version: "0.8.7+4"
image_picker_for_web:
dependency: transitive
description:
Expand Down Expand Up @@ -877,10 +877,10 @@ packages:
dependency: transitive
description:
name: image_picker_platform_interface
sha256: "7c7b96bb9413a9c28229e717e6fd1e3edd1cc5569c1778fcca060ecf729b65ee"
sha256: c1134543ae2187e85299996d21c526b2f403854994026d575ae4cf30d7bb2a32
url: "https://pub.dev"
source: hosted
version: "2.8.0"
version: "2.9.0"
image_picker_windows:
dependency: transitive
description:
Expand Down Expand Up @@ -1122,10 +1122,10 @@ packages:
dependency: transitive
description:
name: path_provider_foundation
sha256: "1995d88ec2948dac43edf8fe58eb434d35d22a2940ecee1a9fefcd62beee6eb3"
sha256: "916731ccbdce44d545414dd9961f26ba5fbaa74bcbb55237d8e65a623a8c7297"
url: "https://pub.dev"
source: hosted
version: "2.2.3"
version: "2.2.4"
path_provider_linux:
dependency: transitive
description:
Expand Down Expand Up @@ -1170,10 +1170,10 @@ packages:
dependency: "direct main"
description:
name: plugin_platform_interface
sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc"
sha256: "43798d895c929056255600343db8f049921cbec94d31ec87f1dc5c16c01935dd"
url: "https://pub.dev"
source: hosted
version: "2.1.4"
version: "2.1.5"
pointycastle:
dependency: transitive
description:
Expand Down Expand Up @@ -1290,10 +1290,10 @@ packages:
dependency: transitive
description:
name: shared_preferences_foundation
sha256: b046999bf0ff58f04c364491bb803dcfa8f42e47b19c75478f53d323684a8cc1
sha256: f39696b83e844923b642ce9dd4bd31736c17e697f6731a5adf445b1274cf3cd4
url: "https://pub.dev"
source: hosted
version: "2.3.1"
version: "2.3.2"
shared_preferences_linux:
dependency: transitive
description:
Expand Down Expand Up @@ -1591,10 +1591,10 @@ packages:
dependency: transitive
description:
name: url_launcher_android
sha256: "15f5acbf0dce90146a0f5a2c4a002b1814a6303c4c5c075aa2623b2d16156f03"
sha256: "78cb6dea3e93148615109e58e42c35d1ffbf5ef66c44add673d0ab75f12ff3af"
url: "https://pub.dev"
source: hosted
version: "6.0.36"
version: "6.0.37"
url_launcher_ios:
dependency: transitive
description:
Expand All @@ -1615,10 +1615,10 @@ packages:
dependency: transitive
description:
name: url_launcher_macos
sha256: "91ee3e75ea9dadf38036200c5d3743518f4a5eb77a8d13fda1ee5764373f185e"
sha256: "1c4fdc0bfea61a70792ce97157e5cc17260f61abbe4f39354513f39ec6fd73b1"
url: "https://pub.dev"
source: hosted
version: "3.0.5"
version: "3.0.6"
url_launcher_platform_interface:
dependency: transitive
description:
Expand Down Expand Up @@ -1744,10 +1744,10 @@ packages:
dependency: transitive
description:
name: xdg_directories
sha256: ee1505df1426458f7f60aac270645098d318a8b4766d85fde75f76f2e21807d1
sha256: e0b1147eec179d3911f1f19b59206448f78195ca1d20514134e10641b7d7fbff
url: "https://pub.dev"
source: hosted
version: "1.0.0"
version: "1.0.1"
xml:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion test/bloc/input/input_bloc_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void main() {
final parsedInput = await breezLib.parseInput(input: input);

final bloc = InputBloc(breezLib, injector.lightningLinks, injector.device);
breezLib.getNodeState();
breezLib.nodeInfo();

expectLater(
bloc.stream,
Expand Down
4 changes: 2 additions & 2 deletions test/mock/breez_bridge_mock.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class BreezBridgeMock extends Mock implements BreezBridge {
required Config config,
required Uint8List seed,
}) async {
await getNodeState();
await nodeInfo();
}

Config config = const Config(
Expand Down Expand Up @@ -54,7 +54,7 @@ class BreezBridgeMock extends Mock implements BreezBridge {
);

@override
Future<NodeState?> getNodeState() async {
Future<NodeState?> nodeInfo() async {
nodeStateController.add(nodeState);
return nodeState;
}
Expand Down
Loading