summaryrefslogtreecommitdiff
path: root/impls/monero.dart
diff options
context:
space:
mode:
authorcyan <cyjan@mrcyjanek.net>2024-07-30 17:46:55 +0200
committerGitHub <noreply@github.com>2024-07-30 17:46:55 +0200
commit373588247bcdb0ef2a16531fb8cd556743c5cd74 (patch)
treea26e5a4c08cd56b8e47a20cdc94306b0e7a3a01c /impls/monero.dart
parent3b9928a665099f10cfd7e17f82cdf222e9f3ae27 (diff)
Generic safety cleanup (#22)
* create checksum system for versioning * minor changes to CI * dart ffi cleanup * update checksums
Diffstat (limited to 'impls/monero.dart')
-rw-r--r--impls/monero.dart/ffigen_monero.yaml2
-rw-r--r--impls/monero.dart/ffigen_wownero.yaml2
-rw-r--r--impls/monero.dart/lib/monero.dart47
-rw-r--r--impls/monero.dart/lib/src/checksum_monero.dart6
-rw-r--r--impls/monero.dart/lib/src/checksum_wownero.dart6
-rw-r--r--impls/monero.dart/lib/src/generated_bindings_monero.g.dart54
-rw-r--r--impls/monero.dart/lib/src/generated_bindings_wownero.g.dart54
-rw-r--r--impls/monero.dart/lib/wownero.dart49
l---------impls/monero.dart/monero_wallet2_api_c.h1
l---------impls/monero.dart/wownero_wallet2_api_c.h1
10 files changed, 218 insertions, 4 deletions
diff --git a/impls/monero.dart/ffigen_monero.yaml b/impls/monero.dart/ffigen_monero.yaml
index 3732939..516dbc9 100644
--- a/impls/monero.dart/ffigen_monero.yaml
+++ b/impls/monero.dart/ffigen_monero.yaml
@@ -3,7 +3,7 @@ description: monero_c bindings
output: 'lib/src/generated_bindings_monero.g.dart'
headers:
entry-points:
- - 'monero_wallet2_api_c.h'
+ - '../../monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.h'
exclude-all-by-default: true
functions:
diff --git a/impls/monero.dart/ffigen_wownero.yaml b/impls/monero.dart/ffigen_wownero.yaml
index e057fa1..1149dca 100644
--- a/impls/monero.dart/ffigen_wownero.yaml
+++ b/impls/monero.dart/ffigen_wownero.yaml
@@ -3,7 +3,7 @@ description: monero_c wownero bindings
output: 'lib/src/generated_bindings_wownero.g.dart'
headers:
entry-points:
- - 'wownero_wallet2_api_c.h'
+ - '../../wownero_libwallet2_api_c/src/main/cpp/wallet2_api_c.h'
exclude-all-by-default: true
functions:
diff --git a/impls/monero.dart/lib/monero.dart b/impls/monero.dart/lib/monero.dart
index 818caf7..2d573ff 100644
--- a/impls/monero.dart/lib/monero.dart
+++ b/impls/monero.dart/lib/monero.dart
@@ -77,6 +77,8 @@ import 'dart:io';
import 'package:ffi/ffi.dart';
import 'package:monero/src/generated_bindings_monero.g.dart';
+export 'src/checksum_monero.dart';
+
typedef PendingTransaction = Pointer<Void>;
MoneroC? lib;
@@ -3916,6 +3918,51 @@ int MONERO_cw_WalletListener_height(WalletListener wlptr) {
return s;
}
+String MONERO_checksum_wallet2_api_c_h() {
+ debugStart?.call('MONERO_checksum_wallet2_api_c_h');
+ lib ??= MoneroC(DynamicLibrary.open(libPath));
+
+ final s = lib!.MONERO_checksum_wallet2_api_c_h();
+ debugEnd?.call('MONERO_checksum_wallet2_api_c_h');
+ return s.cast<Utf8>().toDartString();
+}
+
+String MONERO_checksum_wallet2_api_c_cpp() {
+ debugStart?.call('MONERO_checksum_wallet2_api_c_cpp');
+ lib ??= MoneroC(DynamicLibrary.open(libPath));
+
+ final s = lib!.MONERO_checksum_wallet2_api_c_cpp();
+ debugEnd?.call('MONERO_checksum_wallet2_api_c_cpp');
+ return s.cast<Utf8>().toDartString();
+}
+
+String MONERO_checksum_wallet2_api_c_exp() {
+ debugStart?.call('MONERO_checksum_wallet2_api_c_exp');
+ lib ??= MoneroC(DynamicLibrary.open(libPath));
+
+ final s = lib!.MONERO_checksum_wallet2_api_c_exp();
+ debugEnd?.call('MONERO_checksum_wallet2_api_c_exp');
+ return s.cast<Utf8>().toDartString();
+}
+
+int MONERO_checksum_wallet2_api_c_version() {
+ debugStart?.call('MONERO_checksum_wallet2_api_c_version');
+ lib ??= MoneroC(DynamicLibrary.open(libPath));
+
+ final s = lib!.MONERO_checksum_wallet2_api_c_version();
+ debugEnd?.call('MONERO_checksum_wallet2_api_c_version');
+ return s;
+}
+
+String MONERO_checksum_wallet2_api_c_date() {
+ debugStart?.call('MONERO_checksum_wallet2_api_c_date');
+ lib ??= MoneroC(DynamicLibrary.open(libPath));
+
+ final s = lib!.MONERO_checksum_wallet2_api_c_date();
+ debugEnd?.call('MONERO_checksum_wallet2_api_c_date');
+ return s.cast<Utf8>().toDartString();
+}
+
void MONERO_free(Pointer<Void> wlptr) {
debugStart?.call('MONERO_free');
lib ??= MoneroC(DynamicLibrary.open(libPath));
diff --git a/impls/monero.dart/lib/src/checksum_monero.dart b/impls/monero.dart/lib/src/checksum_monero.dart
new file mode 100644
index 0000000..cd59b61
--- /dev/null
+++ b/impls/monero.dart/lib/src/checksum_monero.dart
@@ -0,0 +1,6 @@
+// ignore_for_file: constant_identifier_names
+const String wallet2_api_c_h_sha256 = "b9c712f59873da33dfc4c9caa4850ee5cba4bf7310179dfc33af9d3029d9855a";
+const String wallet2_api_c_cpp_sha256 = "7edf0905802faa48f66362a6d2ebf25f458107b67cd4abc6d01886c40f5634ef";
+const String wallet2_api_c_exp_sha256 = "bfac0ee584f50bd9263ae453103530c2594b21aec8ae7622e8c192c027f5d6af";
+const int libwallet2_api_c_version = 48;
+const String wallet2_api_c_date = "2024-07-30 15:06:42 +0000";
diff --git a/impls/monero.dart/lib/src/checksum_wownero.dart b/impls/monero.dart/lib/src/checksum_wownero.dart
new file mode 100644
index 0000000..3f629dc
--- /dev/null
+++ b/impls/monero.dart/lib/src/checksum_wownero.dart
@@ -0,0 +1,6 @@
+// ignore_for_file: constant_identifier_names
+const String wallet2_api_c_h_sha256 = "1f4688b9ddacbc33e82426c50480ab8e3727718f59e577080a7dc6dca48bcf9d";
+const String wallet2_api_c_cpp_sha256 = "f2b818197f90711d938c17ce0513b110b1e2b4fe9765f54be7afa5a3b4ad8077";
+const String wallet2_api_c_exp_sha256 = "dd9874cc43a6a74bbfa3e49c4ad3f835ff22efd3de8f679cc91c4af3d931aedb";
+const int libwallet2_api_c_version = 25;
+const String wallet2_api_c_date = "2024-07-30 15:13:50 +0000";
diff --git a/impls/monero.dart/lib/src/generated_bindings_monero.g.dart b/impls/monero.dart/lib/src/generated_bindings_monero.g.dart
index 3733f8d..0337d64 100644
--- a/impls/monero.dart/lib/src/generated_bindings_monero.g.dart
+++ b/impls/monero.dart/lib/src/generated_bindings_monero.g.dart
@@ -5414,4 +5414,58 @@ class MoneroC {
'MONERO_free');
late final _MONERO_free =
_MONERO_freePtr.asFunction<void Function(ffi.Pointer<ffi.Void>)>();
+
+ ffi.Pointer<ffi.Char> MONERO_checksum_wallet2_api_c_h() {
+ return _MONERO_checksum_wallet2_api_c_h();
+ }
+
+ late final _MONERO_checksum_wallet2_api_c_hPtr =
+ _lookup<ffi.NativeFunction<ffi.Pointer<ffi.Char> Function()>>(
+ 'MONERO_checksum_wallet2_api_c_h');
+ late final _MONERO_checksum_wallet2_api_c_h =
+ _MONERO_checksum_wallet2_api_c_hPtr.asFunction<
+ ffi.Pointer<ffi.Char> Function()>();
+
+ ffi.Pointer<ffi.Char> MONERO_checksum_wallet2_api_c_cpp() {
+ return _MONERO_checksum_wallet2_api_c_cpp();
+ }
+
+ late final _MONERO_checksum_wallet2_api_c_cppPtr =
+ _lookup<ffi.NativeFunction<ffi.Pointer<ffi.Char> Function()>>(
+ 'MONERO_checksum_wallet2_api_c_cpp');
+ late final _MONERO_checksum_wallet2_api_c_cpp =
+ _MONERO_checksum_wallet2_api_c_cppPtr.asFunction<
+ ffi.Pointer<ffi.Char> Function()>();
+
+ ffi.Pointer<ffi.Char> MONERO_checksum_wallet2_api_c_exp() {
+ return _MONERO_checksum_wallet2_api_c_exp();
+ }
+
+ late final _MONERO_checksum_wallet2_api_c_expPtr =
+ _lookup<ffi.NativeFunction<ffi.Pointer<ffi.Char> Function()>>(
+ 'MONERO_checksum_wallet2_api_c_exp');
+ late final _MONERO_checksum_wallet2_api_c_exp =
+ _MONERO_checksum_wallet2_api_c_expPtr.asFunction<
+ ffi.Pointer<ffi.Char> Function()>();
+
+ int MONERO_checksum_wallet2_api_c_version() {
+ return _MONERO_checksum_wallet2_api_c_version();
+ }
+
+ late final _MONERO_checksum_wallet2_api_c_versionPtr =
+ _lookup<ffi.NativeFunction<ffi.Int Function()>>(
+ 'MONERO_checksum_wallet2_api_c_version');
+ late final _MONERO_checksum_wallet2_api_c_version =
+ _MONERO_checksum_wallet2_api_c_versionPtr.asFunction<int Function()>();
+
+ ffi.Pointer<ffi.Char> MONERO_checksum_wallet2_api_c_date() {
+ return _MONERO_checksum_wallet2_api_c_date();
+ }
+
+ late final _MONERO_checksum_wallet2_api_c_datePtr =
+ _lookup<ffi.NativeFunction<ffi.Pointer<ffi.Char> Function()>>(
+ 'MONERO_checksum_wallet2_api_c_date');
+ late final _MONERO_checksum_wallet2_api_c_date =
+ _MONERO_checksum_wallet2_api_c_datePtr.asFunction<
+ ffi.Pointer<ffi.Char> Function()>();
}
diff --git a/impls/monero.dart/lib/src/generated_bindings_wownero.g.dart b/impls/monero.dart/lib/src/generated_bindings_wownero.g.dart
index 527ab17..24792e4 100644
--- a/impls/monero.dart/lib/src/generated_bindings_wownero.g.dart
+++ b/impls/monero.dart/lib/src/generated_bindings_wownero.g.dart
@@ -4977,4 +4977,58 @@ class WowneroC {
'WOWNERO_free');
late final _WOWNERO_free =
_WOWNERO_freePtr.asFunction<void Function(ffi.Pointer<ffi.Void>)>();
+
+ ffi.Pointer<ffi.Char> WOWNERO_checksum_wallet2_api_c_h() {
+ return _WOWNERO_checksum_wallet2_api_c_h();
+ }
+
+ late final _WOWNERO_checksum_wallet2_api_c_hPtr =
+ _lookup<ffi.NativeFunction<ffi.Pointer<ffi.Char> Function()>>(
+ 'WOWNERO_checksum_wallet2_api_c_h');
+ late final _WOWNERO_checksum_wallet2_api_c_h =
+ _WOWNERO_checksum_wallet2_api_c_hPtr.asFunction<
+ ffi.Pointer<ffi.Char> Function()>();
+
+ ffi.Pointer<ffi.Char> WOWNERO_checksum_wallet2_api_c_cpp() {
+ return _WOWNERO_checksum_wallet2_api_c_cpp();
+ }
+
+ late final _WOWNERO_checksum_wallet2_api_c_cppPtr =
+ _lookup<ffi.NativeFunction<ffi.Pointer<ffi.Char> Function()>>(
+ 'WOWNERO_checksum_wallet2_api_c_cpp');
+ late final _WOWNERO_checksum_wallet2_api_c_cpp =
+ _WOWNERO_checksum_wallet2_api_c_cppPtr.asFunction<
+ ffi.Pointer<ffi.Char> Function()>();
+
+ ffi.Pointer<ffi.Char> WOWNERO_checksum_wallet2_api_c_exp() {
+ return _WOWNERO_checksum_wallet2_api_c_exp();
+ }
+
+ late final _WOWNERO_checksum_wallet2_api_c_expPtr =
+ _lookup<ffi.NativeFunction<ffi.Pointer<ffi.Char> Function()>>(
+ 'WOWNERO_checksum_wallet2_api_c_exp');
+ late final _WOWNERO_checksum_wallet2_api_c_exp =
+ _WOWNERO_checksum_wallet2_api_c_expPtr.asFunction<
+ ffi.Pointer<ffi.Char> Function()>();
+
+ int WOWNERO_checksum_wallet2_api_c_version() {
+ return _WOWNERO_checksum_wallet2_api_c_version();
+ }
+
+ late final _WOWNERO_checksum_wallet2_api_c_versionPtr =
+ _lookup<ffi.NativeFunction<ffi.Int Function()>>(
+ 'WOWNERO_checksum_wallet2_api_c_version');
+ late final _WOWNERO_checksum_wallet2_api_c_version =
+ _WOWNERO_checksum_wallet2_api_c_versionPtr.asFunction<int Function()>();
+
+ ffi.Pointer<ffi.Char> WOWNERO_checksum_wallet2_api_c_date() {
+ return _WOWNERO_checksum_wallet2_api_c_date();
+ }
+
+ late final _WOWNERO_checksum_wallet2_api_c_datePtr =
+ _lookup<ffi.NativeFunction<ffi.Pointer<ffi.Char> Function()>>(
+ 'WOWNERO_checksum_wallet2_api_c_date');
+ late final _WOWNERO_checksum_wallet2_api_c_date =
+ _WOWNERO_checksum_wallet2_api_c_datePtr.asFunction<
+ ffi.Pointer<ffi.Char> Function()>();
}
diff --git a/impls/monero.dart/lib/wownero.dart b/impls/monero.dart/lib/wownero.dart
index 2f9252d..401da8d 100644
--- a/impls/monero.dart/lib/wownero.dart
+++ b/impls/monero.dart/lib/wownero.dart
@@ -77,6 +77,8 @@ import 'dart:io';
import 'package:ffi/ffi.dart';
import 'package:monero/src/generated_bindings_wownero.g.dart';
+export 'src/checksum_wownero.dart';
+
typedef PendingTransaction = Pointer<Void>;
WowneroC? lib;
@@ -3604,6 +3606,53 @@ int WOWNERO_deprecated_14WordSeedHeight({
return s;
}
+
+String WOWNERO_checksum_wallet2_api_c_h() {
+ debugStart?.call('WOWNERO_checksum_wallet2_api_c_h');
+ lib ??= WowneroC(DynamicLibrary.open(libPath));
+
+ final s = lib!.WOWNERO_checksum_wallet2_api_c_h();
+ debugEnd?.call('WOWNERO_checksum_wallet2_api_c_h');
+ return s.cast<Utf8>().toDartString();
+}
+
+String WOWNERO_checksum_wallet2_api_c_cpp() {
+ debugStart?.call('WOWNERO_checksum_wallet2_api_c_cpp');
+ lib ??= WowneroC(DynamicLibrary.open(libPath));
+
+ final s = lib!.WOWNERO_checksum_wallet2_api_c_cpp();
+ debugEnd?.call('WOWNERO_checksum_wallet2_api_c_cpp');
+ return s.cast<Utf8>().toDartString();
+}
+
+String WOWNERO_checksum_wallet2_api_c_exp() {
+ debugStart?.call('WOWNERO_checksum_wallet2_api_c_exp');
+ lib ??= WowneroC(DynamicLibrary.open(libPath));
+
+ final s = lib!.WOWNERO_checksum_wallet2_api_c_exp();
+ debugEnd?.call('WOWNERO_checksum_wallet2_api_c_exp');
+ return s.cast<Utf8>().toDartString();
+}
+
+int WOWNERO_checksum_wallet2_api_c_version() {
+ debugStart?.call('WOWNERO_checksum_wallet2_api_c_version');
+ lib ??= WowneroC(DynamicLibrary.open(libPath));
+
+ final s = lib!.WOWNERO_checksum_wallet2_api_c_version();
+ debugEnd?.call('WOWNERO_checksum_wallet2_api_c_version');
+ return s;
+}
+
+String WOWNERO_checksum_wallet2_api_c_date() {
+ debugStart?.call('WOWNERO_checksum_wallet2_api_c_date');
+ lib ??= WowneroC(DynamicLibrary.open(libPath));
+
+ final s = lib!.WOWNERO_checksum_wallet2_api_c_date();
+ debugEnd?.call('WOWNERO_checksum_wallet2_api_c_date');
+ return s.cast<Utf8>().toDartString();
+}
+
+
void WOWNERO_free(Pointer<Void> wlptr) {
debugStart?.call('WOWNERO_free');
lib ??= WowneroC(DynamicLibrary.open(libPath));
diff --git a/impls/monero.dart/monero_wallet2_api_c.h b/impls/monero.dart/monero_wallet2_api_c.h
deleted file mode 120000
index 21162b9..0000000
--- a/impls/monero.dart/monero_wallet2_api_c.h
+++ /dev/null
@@ -1 +0,0 @@
-../../monero_libwallet2_api_c/src/main/cpp/wallet2_api_c.h \ No newline at end of file
diff --git a/impls/monero.dart/wownero_wallet2_api_c.h b/impls/monero.dart/wownero_wallet2_api_c.h
deleted file mode 120000
index 3dfff5c..0000000
--- a/impls/monero.dart/wownero_wallet2_api_c.h
+++ /dev/null
@@ -1 +0,0 @@
-../../wownero_libwallet2_api_c/src/main/cpp/wallet2_api_c.h \ No newline at end of file