Skip to content

Commit

Permalink
Merge pull request #145 from LtbLightning/upgrade-to-v0.31.2
Browse files Browse the repository at this point in the history
Upgrade to v0.31.2
  • Loading branch information
BitcoinZavior authored Nov 8, 2024
2 parents 2976571 + 6e153bf commit 6c62a20
Show file tree
Hide file tree
Showing 24 changed files with 326 additions and 290 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/precompile_binaries.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
on:
push:
branches: [0.31.2, master, main]
branches: '*'

name: Precompile Binaries

Expand Down Expand Up @@ -32,6 +32,12 @@ jobs:
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Set up Android SDK
if: (matrix.os == 'ubuntu-20.04')
uses: android-actions/setup-android@v2
- name: Install Specific NDK
if: (matrix.os == 'ubuntu-20.04')
run: sdkmanager --install "ndk;24.0.8215888"
- name: Precompile (with iOS)
if: (matrix.os == 'macOS-latest')
run: dart run build_tool precompile-binaries -v --manifest-dir=../../rust --repository=LtbLightning/bdk-flutter
Expand All @@ -45,4 +51,4 @@ jobs:
working-directory: cargokit/build_tool
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
PRIVATE_KEY: ${{ secrets.CARGOKIT_PRIVATE_KEY }}
PRIVATE_KEY: ${{ secrets.CARGOKIT_PRIVATE_KEY }}
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ Updated `flutter_rust_bridge` to `2.0.0`.
- `PartiallySignedTransaction`, `ScriptBuf` & `Transaction`.
#### Changed
- `partiallySignedTransaction.serialize()` serialize the data as raw binary.
#### Fixed
- Thread `frb_workerpool` panicked on Sql database access.


## [0.31.2-dev.2]
#### Fixed
Expand Down
2 changes: 1 addition & 1 deletion android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<manifest></manifest>
<manifest package="io.bdk.f.bdk_flutter"></manifest>
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.6.10'
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import UIKit
import Flutter

@UIApplicationMain
@main
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
Expand Down
4 changes: 2 additions & 2 deletions example/macos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ EXTERNAL SOURCES:
:path: Flutter/ephemeral

SPEC CHECKSUMS:
bdk_flutter: f31096ce6d28094dbbb43d2a3fb130f7c54683df
bdk_flutter: d0437c6116753242241fed48270587542a636d40
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24

PODFILE CHECKSUM: 6acf97521436d16fc31cd5e1a02000905acdb3ae

COCOAPODS: 1.14.3
COCOAPODS: 1.15.2
2 changes: 1 addition & 1 deletion example/macos/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Cocoa
import FlutterMacOS

@NSApplicationMain
@main
class AppDelegate: FlutterAppDelegate {
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
return true
Expand Down
24 changes: 12 additions & 12 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -230,18 +230,18 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
url: "https://pub.dev"
source: hosted
version: "10.0.4"
version: "10.0.5"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
url: "https://pub.dev"
source: hosted
version: "3.0.3"
version: "3.0.5"
leak_tracker_testing:
dependency: transitive
description:
Expand Down Expand Up @@ -278,18 +278,18 @@ packages:
dependency: transitive
description:
name: material_color_utilities
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
url: "https://pub.dev"
source: hosted
version: "0.8.0"
version: "0.11.1"
meta:
dependency: transitive
description:
name: meta
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
url: "https://pub.dev"
source: hosted
version: "1.12.0"
version: "1.15.0"
mockito:
dependency: transitive
description:
Expand Down Expand Up @@ -387,10 +387,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
url: "https://pub.dev"
source: hosted
version: "0.7.0"
version: "0.7.2"
typed_data:
dependency: transitive
description:
Expand Down Expand Up @@ -419,10 +419,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
url: "https://pub.dev"
source: hosted
version: "14.2.1"
version: "14.2.5"
watcher:
dependency: transitive
description:
Expand Down
9 changes: 8 additions & 1 deletion lib/bdk_flutter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,11 @@ export './src/generated/api/types.dart'
export './src/generated/api/wallet.dart'
hide BdkWallet, finishBumpFeeTxBuilder, txBuilderFinish;
export './src/root.dart';
export 'src/utils/exceptions.dart' hide mapBdkError, BdkFfiException;
export 'src/utils/exceptions.dart'
hide
mapBdkError,
mapAddressError,
mapConsensusError,
mapDescriptorError,
mapHexError,
BdkFfiException;
2 changes: 1 addition & 1 deletion lib/src/generated/api/error.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import 'package:freezed_annotation/freezed_annotation.dart' hide protected;
import 'types.dart';
part 'error.freezed.dart';

// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`
// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`

@freezed
sealed class AddressError with _$AddressError {
Expand Down
2 changes: 0 additions & 2 deletions lib/src/generated/api/wallet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
import 'psbt.dart';
import 'types.dart';

// These functions are ignored because they are not marked as `pub`: `get_wallet`
// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `fmt`

Future<(BdkPsbt, TransactionDetails)> finishBumpFeeTxBuilder(
Expand Down Expand Up @@ -109,7 +108,6 @@ class BdkWallet {
onlyWitnessUtxo: onlyWitnessUtxo,
sighashType: sighashType);

/// Return whether or not a script is part of this wallet (either internal or external).
bool isMine({required BdkScriptBuf script}) => core.instance.api
.crateApiWalletBdkWalletIsMine(that: this, script: script);

Expand Down
14 changes: 7 additions & 7 deletions lib/src/generated/frb_generated.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1358,7 +1358,7 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi {
},
codec: DcoCodec(
decodeSuccessData: dco_decode_String,
decodeErrorData: null,
decodeErrorData: dco_decode_bdk_error,
),
constMeta: kCrateApiPsbtBdkPsbtAsStringConstMeta,
argValues: [that],
Expand Down Expand Up @@ -1428,7 +1428,7 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi {
},
codec: DcoCodec(
decodeSuccessData: dco_decode_opt_box_autoadd_u_64,
decodeErrorData: null,
decodeErrorData: dco_decode_bdk_error,
),
constMeta: kCrateApiPsbtBdkPsbtFeeAmountConstMeta,
argValues: [that],
Expand All @@ -1451,7 +1451,7 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi {
},
codec: DcoCodec(
decodeSuccessData: dco_decode_opt_box_autoadd_fee_rate,
decodeErrorData: null,
decodeErrorData: dco_decode_bdk_error,
),
constMeta: kCrateApiPsbtBdkPsbtFeeRateConstMeta,
argValues: [that],
Expand Down Expand Up @@ -1495,7 +1495,7 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi {
},
codec: DcoCodec(
decodeSuccessData: dco_decode_String,
decodeErrorData: null,
decodeErrorData: dco_decode_bdk_error,
),
constMeta: kCrateApiPsbtBdkPsbtJsonSerializeConstMeta,
argValues: [that],
Expand All @@ -1518,7 +1518,7 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi {
},
codec: DcoCodec(
decodeSuccessData: dco_decode_list_prim_u_8_strict,
decodeErrorData: null,
decodeErrorData: dco_decode_bdk_error,
),
constMeta: kCrateApiPsbtBdkPsbtSerializeConstMeta,
argValues: [that],
Expand All @@ -1541,7 +1541,7 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi {
},
codec: DcoCodec(
decodeSuccessData: dco_decode_String,
decodeErrorData: null,
decodeErrorData: dco_decode_bdk_error,
),
constMeta: kCrateApiPsbtBdkPsbtTxidConstMeta,
argValues: [that],
Expand Down Expand Up @@ -2411,7 +2411,7 @@ class coreApiImpl extends coreApiImplPlatform implements coreApi {
},
codec: DcoCodec(
decodeSuccessData: dco_decode_network,
decodeErrorData: null,
decodeErrorData: dco_decode_bdk_error,
),
constMeta: kCrateApiWalletBdkWalletNetworkConstMeta,
argValues: [that],
Expand Down
4 changes: 2 additions & 2 deletions lib/src/root.dart
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ class Blockchain extends BdkBlockchain {
}

/// [Blockchain] constructor for creating `Esplora` blockchain in `Mutinynet`
/// Esplora url: https://mutinynet.ltbl.io/api
/// Esplora url: https://mutinynet.com/api/
static Future<Blockchain> createMutinynet({
int stopGap = 20,
}) async {
final config = BlockchainConfig.esplora(
config: EsploraConfig(
baseUrl: 'https://mutinynet.ltbl.io/api',
baseUrl: 'https://mutinynet.com/api/',
stopGap: BigInt.from(stopGap),
),
);
Expand Down
6 changes: 4 additions & 2 deletions macos/bdk_flutter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ Pod::Spec.new do |s|
}
s.pod_target_xcconfig = {
'DEFINES_MODULE' => 'YES',
# Flutter.framework does not contain a i386 slice.
'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386',
'OTHER_LDFLAGS' => '-force_load ${BUILT_PRODUCTS_DIR}/libbdk_flutter.a',
'DEAD_CODE_STRIPPING' => 'YES',
'STRIP_INSTALLED_PRODUCT[config=Release][sdk=*][arch=*]' => "YES",
'STRIP_STYLE[config=Release][sdk=*][arch=*]' => "non-global",
'DEPLOYMENT_POSTPROCESSING[config=Release][sdk=*][arch=*]' => "YES",
}
end
24 changes: 12 additions & 12 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -327,18 +327,18 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
url: "https://pub.dev"
source: hosted
version: "10.0.4"
version: "10.0.5"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
url: "https://pub.dev"
source: hosted
version: "3.0.3"
version: "3.0.5"
leak_tracker_testing:
dependency: transitive
description:
Expand Down Expand Up @@ -375,18 +375,18 @@ packages:
dependency: transitive
description:
name: material_color_utilities
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
url: "https://pub.dev"
source: hosted
version: "0.8.0"
version: "0.11.1"
meta:
dependency: "direct main"
description:
name: meta
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
url: "https://pub.dev"
source: hosted
version: "1.12.0"
version: "1.15.0"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -540,10 +540,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
url: "https://pub.dev"
source: hosted
version: "0.7.0"
version: "0.7.2"
timing:
dependency: transitive
description:
Expand Down Expand Up @@ -580,10 +580,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
url: "https://pub.dev"
source: hosted
version: "14.2.1"
version: "14.2.5"
watcher:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ environment:
dependencies:
flutter:
sdk: flutter
flutter_rust_bridge: ">2.0.0-dev.41 <= 2.0.0"
flutter_rust_bridge: ">=2.0.0 < 2.1.0"
ffi: ^2.0.1
freezed_annotation: ^2.2.0
mockito: ^5.4.0
Expand Down
3 changes: 1 addition & 2 deletions rust/cargokit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ cargo:
toolchain: stable
precompiled_binaries:
url_prefix: https://github.com/LtbLightning/bdk-flutter/releases/download/precompiled_
public_key: 0e43d5e8452d00db7f3000c18fb1ba796babfcb5dc6306bb0629eff24f8be85b

public_key: 0e43d5e8452d00db7f3000c18fb1ba796babfcb5dc6306bb0629eff24f8be85b
4 changes: 2 additions & 2 deletions rust/src/api/blockchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl BdkBlockchain {
socks5: config.socks5,
timeout: config.timeout,
url: config.url,
stop_gap: usize::try_from(config.stop_gap).unwrap(),
stop_gap: config.stop_gap as usize,
validate_domain: config.validate_domain,
})
}
Expand All @@ -42,7 +42,7 @@ impl BdkBlockchain {
base_url: config.base_url,
proxy: config.proxy,
concurrency: config.concurrency,
stop_gap: usize::try_from(config.stop_gap).unwrap(),
stop_gap: config.stop_gap as usize,
timeout: config.timeout,
})
}
Expand Down
5 changes: 5 additions & 0 deletions rust/src/api/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,3 +361,8 @@ impl From<bdk::bitcoin::psbt::PsbtParseError> for BdkError {
BdkError::PsbtParse(value.to_string())
}
}
impl From<bdk::keys::bip39::Error> for BdkError {
fn from(value: bdk::keys::bip39::Error) -> Self {
BdkError::Bip39(value.to_string())
}
}
Loading

0 comments on commit 6c62a20

Please sign in to comment.