Skip to content

Commit

Permalink
chore: update flutter rust bridge
Browse files Browse the repository at this point in the history
  • Loading branch information
ngutech21 committed Oct 23, 2023
1 parent 2cc1697 commit 7c314a6
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 16 deletions.
2 changes: 1 addition & 1 deletion flutter/lib/generated/bridge_definitions.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// AUTO GENERATED FILE, DO NOT EDIT.
// Generated by `flutter_rust_bridge`@ 1.82.1.
// Generated by `flutter_rust_bridge`@ 1.82.3.
// ignore_for_file: non_constant_identifier_names, unused_element, duplicate_ignore, directives_ordering, curly_braces_in_flow_control_structures, unnecessary_lambdas, slash_for_doc_comments, prefer_const_literals_to_create_immutables, implicit_dynamic_list_literal, duplicate_import, unused_import, unnecessary_import, prefer_single_quotes, prefer_const_constructors, use_super_parameters, always_use_package_imports, annotate_overrides, invalid_use_of_protected_member, constant_identifier_names, invalid_use_of_internal_member, prefer_is_empty, unnecessary_const

import 'bridge_generated.io.dart' if (dart.library.html) 'bridge_generated.web.dart';
Expand Down
22 changes: 11 additions & 11 deletions flutter/lib/generated/bridge_generated.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// AUTO GENERATED FILE, DO NOT EDIT.
// Generated by `flutter_rust_bridge`@ 1.82.1.
// Generated by `flutter_rust_bridge`@ 1.82.3.
// ignore_for_file: non_constant_identifier_names, unused_element, duplicate_ignore, directives_ordering, curly_braces_in_flow_control_structures, unnecessary_lambdas, slash_for_doc_comments, prefer_const_literals_to_create_immutables, implicit_dynamic_list_literal, duplicate_import, unused_import, unnecessary_import, prefer_single_quotes, prefer_const_constructors, use_super_parameters, always_use_package_imports, annotate_overrides, invalid_use_of_protected_member, constant_identifier_names, invalid_use_of_internal_member, prefer_is_empty, unnecessary_const

import "bridge_definitions.dart";
Expand Down Expand Up @@ -37,7 +37,7 @@ class NativeImpl implements Native {
return _platform.executeStream(FlutterRustBridgeTask(
callFfi: (port_) => _platform.inner.wire_get_cashu_balance(port_),
parseSuccessData: _wire2api_u64,
parseErrorData: null,
parseErrorData: _wire2api_FrbAnyhowException,
constMeta: kGetCashuBalanceConstMeta,
argValues: [],
hint: hint,
Expand All @@ -55,7 +55,7 @@ class NativeImpl implements Native {
return _platform.executeStream(FlutterRustBridgeTask(
callFfi: (port_) => _platform.inner.wire_cashu_mint_tokens(port_, arg0, arg1),
parseSuccessData: _wire2api_u64,
parseErrorData: null,
parseErrorData: _wire2api_FrbAnyhowException,
constMeta: kCashuMintTokensConstMeta,
argValues: [amount, hash],
hint: hint,
Expand All @@ -72,7 +72,7 @@ class NativeImpl implements Native {
return _platform.executeStream(FlutterRustBridgeTask(
callFfi: (port_) => _platform.inner.wire_get_cashu_mint_payment_request(port_, arg0),
parseSuccessData: _wire2api_flutter_payment_request,
parseErrorData: null,
parseErrorData: _wire2api_FrbAnyhowException,
constMeta: kGetCashuMintPaymentRequestConstMeta,
argValues: [amount],
hint: hint,
Expand Down Expand Up @@ -106,7 +106,7 @@ class NativeImpl implements Native {
return _platform.executeStream(FlutterRustBridgeTask(
callFfi: (port_) => _platform.inner.wire_cashu_pay_invoice(port_, arg0),
parseSuccessData: _wire2api_bool,
parseErrorData: null,
parseErrorData: _wire2api_FrbAnyhowException,
constMeta: kCashuPayInvoiceConstMeta,
argValues: [invoice],
hint: hint,
Expand Down Expand Up @@ -140,7 +140,7 @@ class NativeImpl implements Native {
return _platform.executeStream(FlutterRustBridgeTask(
callFfi: (port_) => _platform.inner.wire_get_fedimint_payment_request(port_, arg0),
parseSuccessData: _wire2api_fedimint_payment_request,
parseErrorData: null,
parseErrorData: _wire2api_FrbAnyhowException,
constMeta: kGetFedimintPaymentRequestConstMeta,
argValues: [amount],
hint: hint,
Expand All @@ -158,7 +158,7 @@ class NativeImpl implements Native {
return _platform.executeStream(FlutterRustBridgeTask(
callFfi: (port_) => _platform.inner.wire_fedimint_mint_tokens(port_, arg0, arg1),
parseSuccessData: _wire2api_u64,
parseErrorData: null,
parseErrorData: _wire2api_FrbAnyhowException,
constMeta: kFedimintMintTokensConstMeta,
argValues: [amount, operationId],
hint: hint,
Expand All @@ -174,7 +174,7 @@ class NativeImpl implements Native {
return _platform.executeStream(FlutterRustBridgeTask(
callFfi: (port_) => _platform.inner.wire_get_fedimint_balance(port_),
parseSuccessData: _wire2api_u64,
parseErrorData: null,
parseErrorData: _wire2api_FrbAnyhowException,
constMeta: kGetFedimintBalanceConstMeta,
argValues: [],
hint: hint,
Expand All @@ -191,7 +191,7 @@ class NativeImpl implements Native {
return _platform.executeStream(FlutterRustBridgeTask(
callFfi: (port_) => _platform.inner.wire_fedimint_pay_invoice(port_, arg0),
parseSuccessData: _wire2api_bool,
parseErrorData: null,
parseErrorData: _wire2api_FrbAnyhowException,
constMeta: kFedimintPayInvoiceConstMeta,
argValues: [invoice],
hint: hint,
Expand All @@ -208,7 +208,7 @@ class NativeImpl implements Native {
return _platform.executeStream(FlutterRustBridgeTask(
callFfi: (port_) => _platform.inner.wire_receive_token(port_, arg0),
parseSuccessData: _wire2api_u64,
parseErrorData: null,
parseErrorData: _wire2api_FrbAnyhowException,
constMeta: kReceiveTokenConstMeta,
argValues: [token],
hint: hint,
Expand All @@ -224,7 +224,7 @@ class NativeImpl implements Native {
return _platform.executeStream(FlutterRustBridgeTask(
callFfi: (port_) => _platform.inner.wire_get_btcprice(port_),
parseSuccessData: _wire2api_f64,
parseErrorData: null,
parseErrorData: _wire2api_FrbAnyhowException,
constMeta: kGetBtcpriceConstMeta,
argValues: [],
hint: hint,
Expand Down
2 changes: 1 addition & 1 deletion flutter/lib/generated/bridge_generated.io.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// AUTO GENERATED FILE, DO NOT EDIT.
// Generated by `flutter_rust_bridge`@ 1.82.1.
// Generated by `flutter_rust_bridge`@ 1.82.3.
// ignore_for_file: non_constant_identifier_names, unused_element, duplicate_ignore, directives_ordering, curly_braces_in_flow_control_structures, unnecessary_lambdas, slash_for_doc_comments, prefer_const_literals_to_create_immutables, implicit_dynamic_list_literal, duplicate_import, unused_import, unnecessary_import, prefer_single_quotes, prefer_const_constructors, use_super_parameters, always_use_package_imports, annotate_overrides, invalid_use_of_protected_member, constant_identifier_names, invalid_use_of_internal_member, prefer_is_empty, unnecessary_const

import "bridge_definitions.dart";
Expand Down
2 changes: 1 addition & 1 deletion flutter/lib/generated/bridge_generated.web.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// AUTO GENERATED FILE, DO NOT EDIT.
// Generated by `flutter_rust_bridge`@ 1.82.1.
// Generated by `flutter_rust_bridge`@ 1.82.3.
// ignore_for_file: non_constant_identifier_names, unused_element, duplicate_ignore, directives_ordering, curly_braces_in_flow_control_structures, unnecessary_lambdas, slash_for_doc_comments, prefer_const_literals_to_create_immutables, implicit_dynamic_list_literal, duplicate_import, unused_import, unnecessary_import, prefer_single_quotes, prefer_const_constructors, use_super_parameters, always_use_package_imports, annotate_overrides, invalid_use_of_protected_member, constant_identifier_names, invalid_use_of_internal_member, prefer_is_empty, unnecessary_const

import "bridge_definitions.dart";
Expand Down
6 changes: 5 additions & 1 deletion flutter/native/src/bridge_generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
clippy::too_many_arguments
)]
// AUTO GENERATED FILE, DO NOT EDIT.
// Generated by `flutter_rust_bridge`@ 1.82.1.
// Generated by `flutter_rust_bridge`@ 1.82.3.

use crate::api::*;
use core::panic::UnwindSafe;
Expand All @@ -20,6 +20,10 @@ use std::sync::Arc;

// Section: imports

use crate::api::FedimintPaymentRequest;
use crate::api::FlutterInvoice;
use crate::api::FlutterPaymentRequest;

// Section: wire functions

fn wire_init_cashu_impl(port_: MessagePort) {
Expand Down
8 changes: 8 additions & 0 deletions flutter/native/src/bridge_generated.web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ impl Wire2Api<Vec<u8>> for Box<[u8]> {
}
// Section: impl Wire2Api for JsValue

impl<T> Wire2Api<Option<T>> for JsValue
where
JsValue: Wire2Api<T>,
{
fn wire2api(self) -> Option<T> {
(!self.is_null() && !self.is_undefined()).then(|| self.wire2api())
}
}
impl Wire2Api<String> for JsValue {
fn wire2api(self) -> String {
self.as_string().expect("non-UTF-8 string, or not a string")
Expand Down
2 changes: 1 addition & 1 deletion flutter/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ dependencies:
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
ffi: ^2.0.1
flutter_rust_bridge: 1.82.1
flutter_rust_bridge: 1.82.3
meta: ^1.8.0
qr_flutter: ^4.1.0
share_plus: ^7.1.0
Expand Down

0 comments on commit 7c314a6

Please sign in to comment.