Skip to content

Commit 4c788cf

Browse files
committed
add params to new block call back
1 parent 24dc475 commit 4c788cf

4 files changed

Lines changed: 34 additions & 56 deletions

File tree

cw_monero/lib/monero_wallet.dart

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,9 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance,
8989
late bool _hasSyncAfterStartup;
9090
Timer? _autoSaveTimer;
9191

92-
void Function()? _onNewBlock1;
93-
void Function()? _onNewTransaction1;
94-
void Function()? _syncStatusChanged1;
95-
96-
void Function()? get onNewBlock => _onNewBlock1;
97-
void Function()? get onNewTransaction => _onNewTransaction1;
98-
void Function()? get syncStatusChanged => _syncStatusChanged1;
99-
100-
set onNewBlock(void Function()? cb) => _onNewBlock1 = cb;
101-
set onNewTransaction(void Function()? cb) => _onNewTransaction1 = cb;
102-
set syncStatusChanged(void Function()? cb) => _syncStatusChanged1 = cb;
92+
void Function({required int height, required int blocksLeft})? onNewBlock;
93+
void Function()? onNewTransaction;
94+
void Function()? syncStatusChanged;
10395

10496
Future<void> init() async {
10597
await walletAddresses.init();
@@ -440,7 +432,7 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance,
440432
} catch (e) {
441433
print(e.toString());
442434
}
443-
onNewBlock?.call();
435+
onNewBlock?.call(height: height, blocksLeft: blocksLeft);
444436
}
445437

446438
void _onNewTransaction() async {

cw_wownero/lib/wownero_wallet.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ abstract class WowneroWalletBase extends WalletBase<WowneroBalance,
8989
late bool _hasSyncAfterStartup;
9090
Timer? _autoSaveTimer;
9191

92-
void Function()? onNewBlock;
92+
void Function({required int height, required int blocksLeft})? onNewBlock;
9393
void Function()? onNewTransaction;
9494
void Function()? syncStatusChanged;
9595

@@ -435,7 +435,7 @@ abstract class WowneroWalletBase extends WalletBase<WowneroBalance,
435435
} catch (e) {
436436
print(e.toString());
437437
}
438-
onNewBlock?.call();
438+
onNewBlock?.call(height: height, blocksLeft: blocksLeft);
439439
}
440440

441441
void _onNewTransaction() async {

example/pubspec.lock

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ packages:
2828
name: async
2929
url: "https://pub.dartlang.org"
3030
source: hosted
31-
version: "2.8.2"
31+
version: "2.9.0"
3232
boolean_selector:
3333
dependency: transitive
3434
description:
@@ -42,21 +42,14 @@ packages:
4242
name: characters
4343
url: "https://pub.dartlang.org"
4444
source: hosted
45-
version: "1.2.0"
46-
charcode:
47-
dependency: transitive
48-
description:
49-
name: charcode
50-
url: "https://pub.dartlang.org"
51-
source: hosted
52-
version: "1.3.1"
45+
version: "1.2.1"
5346
clock:
5447
dependency: transitive
5548
description:
5649
name: clock
5750
url: "https://pub.dartlang.org"
5851
source: hosted
59-
version: "1.1.0"
52+
version: "1.1.1"
6053
collection:
6154
dependency: transitive
6255
description:
@@ -133,7 +126,7 @@ packages:
133126
name: fake_async
134127
url: "https://pub.dartlang.org"
135128
source: hosted
136-
version: "1.3.0"
129+
version: "1.3.1"
137130
ffi:
138131
dependency: transitive
139132
description:
@@ -267,21 +260,21 @@ packages:
267260
name: matcher
268261
url: "https://pub.dartlang.org"
269262
source: hosted
270-
version: "0.12.11"
263+
version: "0.12.12"
271264
material_color_utilities:
272265
dependency: transitive
273266
description:
274267
name: material_color_utilities
275268
url: "https://pub.dartlang.org"
276269
source: hosted
277-
version: "0.1.4"
270+
version: "0.1.5"
278271
meta:
279272
dependency: transitive
280273
description:
281274
name: meta
282275
url: "https://pub.dartlang.org"
283276
source: hosted
284-
version: "1.7.0"
277+
version: "1.8.0"
285278
mobx:
286279
dependency: transitive
287280
description:
@@ -295,7 +288,7 @@ packages:
295288
name: path
296289
url: "https://pub.dartlang.org"
297290
source: hosted
298-
version: "1.8.1"
291+
version: "1.8.2"
299292
path_provider:
300293
dependency: transitive
301294
description:
@@ -447,7 +440,7 @@ packages:
447440
name: source_span
448441
url: "https://pub.dartlang.org"
449442
source: hosted
450-
version: "1.8.2"
443+
version: "1.9.0"
451444
stack_trace:
452445
dependency: transitive
453446
description:
@@ -459,8 +452,8 @@ packages:
459452
dependency: transitive
460453
description:
461454
path: "."
462-
ref: b7b184ec36466f2a24104a7056de88881cb0c1e9
463-
resolved-ref: b7b184ec36466f2a24104a7056de88881cb0c1e9
455+
ref: "011dc9ce3d29f5fdeeaf711d58b5122f055c146d"
456+
resolved-ref: "011dc9ce3d29f5fdeeaf711d58b5122f055c146d"
464457
url: "https://github.com/cypherstack/stack_wallet_backup.git"
465458
source: git
466459
version: "0.0.1"
@@ -477,21 +470,21 @@ packages:
477470
name: string_scanner
478471
url: "https://pub.dartlang.org"
479472
source: hosted
480-
version: "1.1.0"
473+
version: "1.1.1"
481474
term_glyph:
482475
dependency: transitive
483476
description:
484477
name: term_glyph
485478
url: "https://pub.dartlang.org"
486479
source: hosted
487-
version: "1.2.0"
480+
version: "1.2.1"
488481
test_api:
489482
dependency: transitive
490483
description:
491484
name: test_api
492485
url: "https://pub.dartlang.org"
493486
source: hosted
494-
version: "0.4.9"
487+
version: "0.4.12"
495488
tuple:
496489
dependency: transitive
497490
description:

pubspec.lock

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ packages:
2828
name: async
2929
url: "https://pub.dartlang.org"
3030
source: hosted
31-
version: "2.8.2"
31+
version: "2.9.0"
3232
boolean_selector:
3333
dependency: transitive
3434
description:
@@ -42,21 +42,14 @@ packages:
4242
name: characters
4343
url: "https://pub.dartlang.org"
4444
source: hosted
45-
version: "1.2.0"
46-
charcode:
47-
dependency: transitive
48-
description:
49-
name: charcode
50-
url: "https://pub.dartlang.org"
51-
source: hosted
52-
version: "1.3.1"
45+
version: "1.2.1"
5346
clock:
5447
dependency: transitive
5548
description:
5649
name: clock
5750
url: "https://pub.dartlang.org"
5851
source: hosted
59-
version: "1.1.0"
52+
version: "1.1.1"
6053
collection:
6154
dependency: transitive
6255
description:
@@ -126,7 +119,7 @@ packages:
126119
name: fake_async
127120
url: "https://pub.dartlang.org"
128121
source: hosted
129-
version: "1.3.0"
122+
version: "1.3.1"
130123
ffi:
131124
dependency: "direct main"
132125
description:
@@ -267,21 +260,21 @@ packages:
267260
name: matcher
268261
url: "https://pub.dartlang.org"
269262
source: hosted
270-
version: "0.12.11"
263+
version: "0.12.12"
271264
material_color_utilities:
272265
dependency: transitive
273266
description:
274267
name: material_color_utilities
275268
url: "https://pub.dartlang.org"
276269
source: hosted
277-
version: "0.1.4"
270+
version: "0.1.5"
278271
meta:
279272
dependency: transitive
280273
description:
281274
name: meta
282275
url: "https://pub.dartlang.org"
283276
source: hosted
284-
version: "1.7.0"
277+
version: "1.8.0"
285278
mobx:
286279
dependency: transitive
287280
description:
@@ -295,7 +288,7 @@ packages:
295288
name: path
296289
url: "https://pub.dartlang.org"
297290
source: hosted
298-
version: "1.8.1"
291+
version: "1.8.2"
299292
path_provider:
300293
dependency: transitive
301294
description:
@@ -447,7 +440,7 @@ packages:
447440
name: source_span
448441
url: "https://pub.dartlang.org"
449442
source: hosted
450-
version: "1.8.2"
443+
version: "1.9.0"
451444
stack_trace:
452445
dependency: transitive
453446
description:
@@ -459,8 +452,8 @@ packages:
459452
dependency: "direct main"
460453
description:
461454
path: "."
462-
ref: b7b184ec36466f2a24104a7056de88881cb0c1e9
463-
resolved-ref: b7b184ec36466f2a24104a7056de88881cb0c1e9
455+
ref: "011dc9ce3d29f5fdeeaf711d58b5122f055c146d"
456+
resolved-ref: "011dc9ce3d29f5fdeeaf711d58b5122f055c146d"
464457
url: "https://github.com/cypherstack/stack_wallet_backup.git"
465458
source: git
466459
version: "0.0.1"
@@ -477,21 +470,21 @@ packages:
477470
name: string_scanner
478471
url: "https://pub.dartlang.org"
479472
source: hosted
480-
version: "1.1.0"
473+
version: "1.1.1"
481474
term_glyph:
482475
dependency: transitive
483476
description:
484477
name: term_glyph
485478
url: "https://pub.dartlang.org"
486479
source: hosted
487-
version: "1.2.0"
480+
version: "1.2.1"
488481
test_api:
489482
dependency: transitive
490483
description:
491484
name: test_api
492485
url: "https://pub.dartlang.org"
493486
source: hosted
494-
version: "0.4.9"
487+
version: "0.4.12"
495488
tuple:
496489
dependency: transitive
497490
description:

0 commit comments

Comments
 (0)