Skip to content

Commit

Permalink
feat: add expiration time to multisig (#267)
Browse files Browse the repository at this point in the history
* add expiration time to multisig

* update version

---------

Co-authored-by: Andrey Malochka <andrey.molocko2018@gmail.com>
  • Loading branch information
AndreyMolochko and Andrey Malochka authored Nov 22, 2024
1 parent 51e09c6 commit 3cbf41c
Show file tree
Hide file tree
Showing 24 changed files with 153 additions and 127 deletions.
6 changes: 5 additions & 1 deletion packages/flutter_nekoton_bridge/ios/Classes/frb.h
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,8 @@ void wire_prepare_deploy_with_multiple_owners__method__TonWalletDartWrapper(int6
struct wire_TonWalletDartWrapper *that,
struct wire_uint_8_list *expiration,
struct wire_StringList *custodians,
uint8_t req_confirms);
uint8_t req_confirms,
uint32_t *expiration_time);

void wire_prepare_transfer__method__TonWalletDartWrapper(int64_t port_,
struct wire_TonWalletDartWrapper *that,
Expand Down Expand Up @@ -1143,6 +1144,8 @@ struct wire_TonWalletDartWrapper *new_box_autoadd_ton_wallet_dart_wrapper_0(void

struct wire_TransactionExecutionOptions *new_box_autoadd_transaction_execution_options_0(void);

uint32_t *new_box_autoadd_u32_0(uint32_t value);

uint64_t *new_box_autoadd_u64_0(uint64_t value);

struct wire_UnsignedMessageImpl *new_box_autoadd_unsigned_message_impl_0(void);
Expand Down Expand Up @@ -1468,6 +1471,7 @@ static int64_t dummy_method_to_enforce_bundling(void) {
dummy_var ^= ((int64_t) (void*) new_box_autoadd_token_wallet_dart_wrapper_0);
dummy_var ^= ((int64_t) (void*) new_box_autoadd_ton_wallet_dart_wrapper_0);
dummy_var ^= ((int64_t) (void*) new_box_autoadd_transaction_execution_options_0);
dummy_var ^= ((int64_t) (void*) new_box_autoadd_u32_0);
dummy_var ^= ((int64_t) (void*) new_box_autoadd_u64_0);
dummy_var ^= ((int64_t) (void*) new_box_autoadd_unsigned_message_impl_0);
dummy_var ^= ((int64_t) (void*) new_int_32_list_0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ final _data = <r.Reflectable, r.ReflectorData>{
const [
0,
0,
const [#expiration, #custodians, #reqConfirms]
const [#expiration, #custodians, #reqConfirms, #expirationTime]
],
const [
0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ final _data = <r.Reflectable, r.ReflectorData>{
const [
0,
0,
const [#expiration, #custodians, #reqConfirms]
const [#expiration, #custodians, #reqConfirms, #expirationTime]
],
const [
0,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ final _data = <r.Reflectable, r.ReflectorData>{
const [
0,
0,
const [#expiration, #custodians, #reqConfirms]
const [#expiration, #custodians, #reqConfirms, #expirationTime]
],
const [
0,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,14 @@ class TonWallet extends RustToDartMirrorInterface
required Expiration expiration,
required List<PublicKey> custodians,
required int reqConfirms,
int? expirationTime,
}) async =>
UnsignedMessage.create(
message: await wallet.prepareDeployWithMultipleOwners(
expiration: jsonEncode(expiration),
custodians: custodians.map((key) => key.publicKey).toList(),
reqConfirms: reqConfirms,
expirationTime: expirationTime,
),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ final _data = <r.Reflectable, r.ReflectorData>{
const [
0,
0,
const [#expiration, #custodians, #reqConfirms]
const [#expiration, #custodians, #reqConfirms, #expirationTime]
],
const [
0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ final _data = <r.Reflectable, r.ReflectorData>{
const [
0,
0,
const [#expiration, #custodians, #reqConfirms]
const [#expiration, #custodians, #reqConfirms, #expirationTime]
],
const [
0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ final _data = <r.Reflectable, r.ReflectorData>{
const [
0,
0,
const [#expiration, #custodians, #reqConfirms]
const [#expiration, #custodians, #reqConfirms, #expirationTime]
],
const [
0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ final _data = <r.Reflectable, r.ReflectorData>{
const [
0,
0,
const [#expiration, #custodians, #reqConfirms]
const [#expiration, #custodians, #reqConfirms, #expirationTime]
],
const [
0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ final _data = <r.Reflectable, r.ReflectorData>{
const [
0,
0,
const [#expiration, #custodians, #reqConfirms]
const [#expiration, #custodians, #reqConfirms, #expirationTime]
],
const [
0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ final _data = <r.Reflectable, r.ReflectorData>{
const [
0,
0,
const [#expiration, #custodians, #reqConfirms]
const [#expiration, #custodians, #reqConfirms, #expirationTime]
],
const [
0,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions packages/flutter_nekoton_bridge/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_nekoton_bridge
description: Flutter Nekoton bridge.
version: 2.0.1-dev.2
version: 2.0.1-dev.3
homepage: https://github.com/broxus/nekoton_bridge.git
repository: https://github.com/broxus/nekoton_bridge.git

Expand All @@ -13,16 +13,16 @@ dependencies:
sdk: flutter
plugin_platform_interface: ^2.1.8
rxdart: ^0.27.7
reflectable: ^4.0.9
reflectable: ^4.0.10
money2_fixer: ^2.0.0
money2: ^5.2.1
nekoton_bridge: ^2.0.1-dev.2
money2: ^5.4.0
nekoton_bridge: ^2.0.1-dev.3
freezed_annotation: ^2.4.4
json_annotation: ^4.9.0
# for generating mirror hash
uuid: ^3.0.6
uuid: ^3.0.7
tuple: ^2.0.2
crypto: ^3.0.5
crypto: ^3.0.6
dev_dependencies:
ffi: ^2.1.3
ffigen: ^13.0.0
Expand All @@ -32,9 +32,9 @@ dev_dependencies:
integration_test:
sdk: flutter
mocktail: ^1.0.4
build_runner: ^2.4.12
build_runner: ^2.4.13
freezed: ^2.5.7
json_serializable: ^6.8.0
json_serializable: ^6.9.0

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
Expand Down
17 changes: 14 additions & 3 deletions packages/nekoton_bridge/lib/src/bridge_generated.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1572,6 +1572,7 @@ abstract class NekotonBridge {
required String expiration,
required List<String> custodians,
required int reqConfirms,
int? expirationTime,
dynamic hint});

FlutterRustBridgeTaskConstMeta
Expand Down Expand Up @@ -3603,12 +3604,14 @@ class TonWalletDartWrapper {
{required String expiration,
required List<String> custodians,
required int reqConfirms,
int? expirationTime,
dynamic hint}) =>
bridge.prepareDeployWithMultipleOwnersMethodTonWalletDartWrapper(
that: this,
expiration: expiration,
custodians: custodians,
reqConfirms: reqConfirms,
expirationTime: expirationTime,
);

/// Prepare transferring tokens from this wallet to other.
Expand Down Expand Up @@ -7913,19 +7916,21 @@ class NekotonBridgeImpl implements NekotonBridge {
required String expiration,
required List<String> custodians,
required int reqConfirms,
int? expirationTime,
dynamic hint}) {
var arg0 = _platform.api2wire_box_autoadd_ton_wallet_dart_wrapper(that);
var arg1 = _platform.api2wire_String(expiration);
var arg2 = _platform.api2wire_StringList(custodians);
var arg3 = api2wire_u8(reqConfirms);
var arg4 = _platform.api2wire_opt_box_autoadd_u32(expirationTime);
return _platform.executeNormal(FlutterRustBridgeTask(
callFfi: (port_) => _platform.inner
.wire_prepare_deploy_with_multiple_owners__method__TonWalletDartWrapper(
port_, arg0, arg1, arg2, arg3),
port_, arg0, arg1, arg2, arg3, arg4),
parseSuccessData: (d) => _wire2api_unsigned_message_impl(d),
constMeta:
kPrepareDeployWithMultipleOwnersMethodTonWalletDartWrapperConstMeta,
argValues: [that, expiration, custodians, reqConfirms],
argValues: [that, expiration, custodians, reqConfirms, expirationTime],
hint: hint,
));
}
Expand All @@ -7935,7 +7940,13 @@ class NekotonBridgeImpl implements NekotonBridge {
const FlutterRustBridgeTaskConstMeta(
debugName:
"prepare_deploy_with_multiple_owners__method__TonWalletDartWrapper",
argNames: ["that", "expiration", "custodians", "reqConfirms"],
argNames: [
"that",
"expiration",
"custodians",
"reqConfirms",
"expirationTime"
],
);

Future<UnsignedMessageImpl> prepareTransferMethodTonWalletDartWrapper(
Expand Down
Loading

0 comments on commit 3cbf41c

Please sign in to comment.