Skip to content

Commit

Permalink
chore: regenerate with LibBip85 name
Browse files Browse the repository at this point in the history
  • Loading branch information
ethicnology committed Nov 21, 2024
1 parent c897bc5 commit d9a6a46
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 33 deletions.
3 changes: 2 additions & 1 deletion bindings/dart-bip85/flutter_rust_bridge.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
rust_input: crate::api
rust_root: rust/
dart_output: lib/src/rust
dart_output: lib/src/rust
dart_entrypoint_class_name: LibBip85
2 changes: 1 addition & 1 deletion bindings/dart-bip85/lib/bip85.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
library bip85;

export 'src/rust/api/bip85.dart';
export 'src/rust/frb_generated.dart' show RustLib;
export 'src/rust/frb_generated.dart' show LibBip85;
10 changes: 5 additions & 5 deletions bindings/dart-bip85/lib/src/rust/api/bip85.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ import '../frb_generated.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';

Uint8List derive({required String xprv, required String path}) =>
RustLib.instance.api.crateApiBip85Derive(xprv: xprv, path: path);
LibBip85.instance.api.crateApiBip85Derive(xprv: xprv, path: path);

String toWif({required String xprv, required int index}) =>
RustLib.instance.api.crateApiBip85ToWif(xprv: xprv, index: index);
LibBip85.instance.api.crateApiBip85ToWif(xprv: xprv, index: index);

String toXprv({required String xprv, required int index}) =>
RustLib.instance.api.crateApiBip85ToXprv(xprv: xprv, index: index);
LibBip85.instance.api.crateApiBip85ToXprv(xprv: xprv, index: index);

String toHex({required String xprv, required int length, required int index}) =>
RustLib.instance.api
LibBip85.instance.api
.crateApiBip85ToHex(xprv: xprv, length: length, index: index);

String toMnemonic(
{required String xprv, required int wordCount, required int index}) =>
RustLib.instance.api.crateApiBip85ToMnemonic(
LibBip85.instance.api.crateApiBip85ToMnemonic(
xprv: xprv, wordCount: wordCount, index: index);
25 changes: 13 additions & 12 deletions bindings/dart-bip85/lib/src/rust/frb_generated.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ import 'frb_generated.io.dart'
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';

/// Main entrypoint of the Rust API
class RustLib extends BaseEntrypoint<RustLibApi, RustLibApiImpl, RustLibWire> {
class LibBip85
extends BaseEntrypoint<LibBip85Api, LibBip85ApiImpl, LibBip85Wire> {
@internal
static final instance = RustLib._();
static final instance = LibBip85._();

RustLib._();
LibBip85._();

/// Initialize flutter_rust_bridge
static Future<void> init({
RustLibApi? api,
LibBip85Api? api,
BaseHandler? handler,
ExternalLibrary? externalLibrary,
}) async {
Expand All @@ -34,7 +35,7 @@ class RustLib extends BaseEntrypoint<RustLibApi, RustLibApiImpl, RustLibWire> {
/// Initialize flutter_rust_bridge in mock mode.
/// No libraries for FFI are loaded.
static void initMock({
required RustLibApi api,
required LibBip85Api api,
}) {
instance.initMockImpl(
api: api,
Expand All @@ -48,12 +49,12 @@ class RustLib extends BaseEntrypoint<RustLibApi, RustLibApiImpl, RustLibWire> {
static void dispose() => instance.disposeImpl();

@override
ApiImplConstructor<RustLibApiImpl, RustLibWire> get apiImplConstructor =>
RustLibApiImpl.new;
ApiImplConstructor<LibBip85ApiImpl, LibBip85Wire> get apiImplConstructor =>
LibBip85ApiImpl.new;

@override
WireConstructor<RustLibWire> get wireConstructor =>
RustLibWire.fromExternalLibrary;
WireConstructor<LibBip85Wire> get wireConstructor =>
LibBip85Wire.fromExternalLibrary;

@override
Future<void> executeRustInitializers() async {}
Expand All @@ -76,7 +77,7 @@ class RustLib extends BaseEntrypoint<RustLibApi, RustLibApiImpl, RustLibWire> {
);
}

abstract class RustLibApi extends BaseApi {
abstract class LibBip85Api extends BaseApi {
Uint8List crateApiBip85Derive({required String xprv, required String path});

String crateApiBip85ToHex(
Expand All @@ -90,8 +91,8 @@ abstract class RustLibApi extends BaseApi {
String crateApiBip85ToXprv({required String xprv, required int index});
}

class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi {
RustLibApiImpl({
class LibBip85ApiImpl extends LibBip85ApiImplPlatform implements LibBip85Api {
LibBip85ApiImpl({
required super.handler,
required super.wire,
required super.generalizedFrbRustBinding,
Expand Down
12 changes: 6 additions & 6 deletions bindings/dart-bip85/lib/src/rust/frb_generated.io.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import 'dart:ffi' as ffi;
import 'frb_generated.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated_io.dart';

abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
RustLibApiImplPlatform({
abstract class LibBip85ApiImplPlatform extends BaseApiImpl<LibBip85Wire> {
LibBip85ApiImplPlatform({
required super.handler,
required super.wire,
required super.generalizedFrbRustBinding,
Expand Down Expand Up @@ -79,15 +79,15 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {

// Section: wire_class

class RustLibWire implements BaseWire {
factory RustLibWire.fromExternalLibrary(ExternalLibrary lib) =>
RustLibWire(lib.ffiDynamicLibrary);
class LibBip85Wire implements BaseWire {
factory LibBip85Wire.fromExternalLibrary(ExternalLibrary lib) =>
LibBip85Wire(lib.ffiDynamicLibrary);

/// Holds the symbol lookup function.
final ffi.Pointer<T> Function<T extends ffi.NativeType>(String symbolName)
_lookup;

/// The symbols are looked up in [dynamicLibrary].
RustLibWire(ffi.DynamicLibrary dynamicLibrary)
LibBip85Wire(ffi.DynamicLibrary dynamicLibrary)
: _lookup = dynamicLibrary.lookup;
}
12 changes: 6 additions & 6 deletions bindings/dart-bip85/lib/src/rust/frb_generated.web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import 'dart:convert';
import 'frb_generated.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated_web.dart';

abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {
RustLibApiImplPlatform({
abstract class LibBip85ApiImplPlatform extends BaseApiImpl<LibBip85Wire> {
LibBip85ApiImplPlatform({
required super.handler,
required super.wire,
required super.generalizedFrbRustBinding,
Expand Down Expand Up @@ -81,13 +81,13 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl<RustLibWire> {

// Section: wire_class

class RustLibWire implements BaseWire {
RustLibWire.fromExternalLibrary(ExternalLibrary lib);
class LibBip85Wire implements BaseWire {
LibBip85Wire.fromExternalLibrary(ExternalLibrary lib);
}

@JS('wasm_bindgen')
external RustLibWasmModule get wasmModule;
external LibBip85WasmModule get wasmModule;

@JS()
@anonymous
extension type RustLibWasmModule._(JSObject _) implements JSObject {}
extension type LibBip85WasmModule._(JSObject _) implements JSObject {}
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Rust implementation of bip-85
// Written in 2020 by Rita Kitic <[email protected]>
// Maintained in 2024 by Azad EMERY <[email protected]>
// Initial work in 2020 by Rita Kitic <[email protected]>
// Maintained in 2024 by J. Azad EMERY <[email protected]>

//! # BIP-85 deterministic entropy generation
//!
Expand Down

0 comments on commit d9a6a46

Please sign in to comment.