Skip to content

Commit

Permalink
Merge pull request #35 from relaystr/release-0.1.3
Browse files Browse the repository at this point in the history
Release 0.1.3
  • Loading branch information
frnandu authored Nov 6, 2024
2 parents cee0003 + 5db3ab2 commit f2dde58
Show file tree
Hide file tree
Showing 18 changed files with 219 additions and 145 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## 0.1.3

- upgrade to flutter_rust_bridge 2.6.0
- close usecase in requests
- async cache manager
- set contact list usecase
- use broadcast usecase for other usecases
-

## 0.1.2

- upgrade to flutter_rust_bridge 2.5.0
Expand Down
2 changes: 1 addition & 1 deletion lib/domain_layer/entities/broadcast_response.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class NdkBroadcastResponse {
/// a map of relays publishing to
/// [String] is the relayUrl/identifier
/// [Future<String>] is the relay response e.g. OK, err reason
Map<String, Completer<String>> _publishingRelays = {};
// Map<String, Completer<String>> _publishingRelays = {};

NdkBroadcastResponse({
required this.publishedEvent,
Expand Down
14 changes: 7 additions & 7 deletions lib/domain_layer/usecases/follows/follows.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,21 @@ import '../../entities/filter.dart';
import '../../repositories/cache_manager.dart';
import '../../repositories/event_signer.dart';
import '../broadcast/broadcast.dart';
import '../relay_manager.dart';
import '../requests/requests.dart';

/// Follows usecase
class Follows {
final Requests _requests;
final Broadcast _broadcast;
final CacheManager _cacheManager;
final RelayManager _relayManager;
final EventSigner? _signer;

Follows({
required Requests requests,
required Broadcast broadcast,
required CacheManager cacheManager,
required RelayManager relayManager,
required EventSigner? signer,
}) : _relayManager = relayManager,
}) :
_cacheManager = cacheManager,
_requests = requests,
_signer = signer,
Expand Down Expand Up @@ -112,7 +109,8 @@ class Follows {
contactList.loadedTimestamp = Helpers.now;
contactList.createdAt = Helpers.now;

final bResult = _broadcast.broadcast(
// final bResult =
_broadcast.broadcast(
nostrEvent: contactList.toEvent(),
specificRelays: customRelays,
);
Expand All @@ -129,7 +127,8 @@ class Follows {
contactList.loadedTimestamp = Helpers.now;
contactList.createdAt = Helpers.now;

final bResult = _broadcast.broadcast(
// final bResult =
_broadcast.broadcast(
nostrEvent: contactList.toEvent(),
);
//await bResult.publishDone;
Expand Down Expand Up @@ -187,7 +186,8 @@ class Follows {
contactList.loadedTimestamp = Helpers.now;
contactList.createdAt = Helpers.now;

final bResult = _broadcast.broadcast(
// final bResult =
_broadcast.broadcast(
nostrEvent: contactList.toEvent(),
specificRelays: customRelays,
);
Expand Down
2 changes: 0 additions & 2 deletions lib/domain_layer/usecases/jit_engine.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import 'dart:async';

import 'package:ndk/shared/nips/nip01/client_msg.dart';

import '../../shared/helpers/relay_helper.dart';
import '../../shared/logger/logger.dart';
import '../entities/broadcast_response.dart';
Expand Down
7 changes: 3 additions & 4 deletions lib/domain_layer/usecases/metadatas/metadatas.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,15 @@ import '../requests/requests.dart';
class Metadatas {
final Requests _requests;
final CacheManager _cacheManager;
final RelayManager _relayManager;
final Broadcast _broadcast;
final EventSigner? _signer;

Metadatas({
required Requests requests,
required CacheManager cacheManager,
required RelayManager relayManager,
required Broadcast broadcast,
required EventSigner? signer,
}) : _relayManager = relayManager,
}) :
_cacheManager = cacheManager,
_requests = requests,
_signer = signer,
Expand Down Expand Up @@ -156,7 +154,8 @@ class Metadatas {
} else {
event = metadata.toEvent();
}
final bResult = _broadcast.broadcast(
// final bResult =
_broadcast.broadcast(
nostrEvent: event,
specificRelays: specificRelays,
);
Expand Down
4 changes: 0 additions & 4 deletions lib/domain_layer/usecases/relay_sets_engine.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,14 @@ class RelaySetsEngine implements NetworkEngine {

final RelayManager _relayManager;

final EventSigner? _signer;

final CacheManager _cacheManager;

/// engine that pre-calculates relay sets for gossip
RelaySetsEngine({
required RelayManager relayManager,
required CacheManager cacheManager,
EventSigner? signer,
GlobalState? globalState,
}) : _cacheManager = cacheManager,
_signer = signer,
_relayManager = relayManager {
_globalState = globalState ?? GlobalState();
_relayManager.connect(urls: _relayManager.bootstrapRelays);
Expand Down
3 changes: 0 additions & 3 deletions lib/presentation_layer/init.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ class Initialization {
cacheManager: ndkConfig.cache,
globalState: globalState,
relayManager: relayManager,
signer: ndkConfig.eventSigner,
);
break;
case NdkEngine.JIT:
Expand Down Expand Up @@ -99,15 +98,13 @@ class Initialization {
follows = Follows(
requests: requests,
cacheManager: ndkConfig.cache,
relayManager: relayManager,
broadcast: broadcast,
signer: ndkConfig.eventSigner,
);

metadatas = Metadatas(
requests: requests,
cacheManager: ndkConfig.cache,
relayManager: relayManager,
broadcast: broadcast,
signer: ndkConfig.eventSigner,
);
Expand Down
2 changes: 1 addition & 1 deletion lib/rust_bridge/api/event_verifier.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is automatically generated, so please do not edit it.
// @generated by `flutter_rust_bridge`@ 2.5.0.
// @generated by `flutter_rust_bridge`@ 2.6.0.

// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import

Expand Down
4 changes: 2 additions & 2 deletions lib/rust_bridge/frb_generated.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is automatically generated, so please do not edit it.
// @generated by `flutter_rust_bridge`@ 2.5.0.
// @generated by `flutter_rust_bridge`@ 2.6.0.

// ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field

Expand Down Expand Up @@ -65,7 +65,7 @@ class RustLib extends BaseEntrypoint<RustLibApi, RustLibApiImpl, RustLibWire> {
kDefaultExternalLibraryLoaderConfig;

@override
String get codegenVersion => '2.5.0';
String get codegenVersion => '2.6.0';

@override
int get rustContentHash => 786322520;
Expand Down
2 changes: 1 addition & 1 deletion lib/rust_bridge/frb_generated.io.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is automatically generated, so please do not edit it.
// @generated by `flutter_rust_bridge`@ 2.5.0.
// @generated by `flutter_rust_bridge`@ 2.6.0.

// ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field

Expand Down
2 changes: 1 addition & 1 deletion lib/rust_bridge/frb_generated.web.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file is automatically generated, so please do not edit it.
// @generated by `flutter_rust_bridge`@ 2.5.0.
// @generated by `flutter_rust_bridge`@ 2.6.0.

// ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field

Expand Down
1 change: 1 addition & 0 deletions lib/tag_count_event_filter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:ndk/domain_layer/entities/nip_01_event.dart';
import 'domain_layer/entities/contact_list.dart';
import 'domain_layer/entities/nip_65.dart';

/// filter for too many tags
class PTagCountEventFilter extends EventFilter {
int maxTagCount;

Expand Down
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: ndk
description: Nostr Development Kit - the most performant lib for all your nostr usecases
version: 0.1.2
version: 0.1.3
homepage: https://github.com/relaystr/ndk

environment:
Expand Down Expand Up @@ -32,8 +32,8 @@ dependencies:
amberflutter: ^0.0.9
logger: ^2.4.0
rxdart: ^0.28.0
flutter_rust_bridge: ^2.5.0
rust_lib_ndk: ^0.1.2
flutter_rust_bridge: ^2.6.0
rust_lib_ndk: ^0.1.3

#dependency_overrides:
# rust_lib_ndk:
Expand Down
6 changes: 5 additions & 1 deletion rust_builder/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
## 0.1.3

- upgrade to flutter_rust_bridge 2.6.0

## 0.1.2

- upgrade to flutter_rust_bridge 2.5.0
- upgrade to flutter_rust_bridge 2.5.0

## 0.1.1

Expand Down
2 changes: 1 addition & 1 deletion rust_builder/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: rust_lib_ndk
description: "Utility to build Rust code"
version: 0.1.2
version: 0.1.3
repository: https://github.com/relaystr/ndk

environment:
Expand Down
Loading

0 comments on commit f2dde58

Please sign in to comment.