mirror of
https://github.com/zapstore/zapstore.git
synced 2026-10-05 12:38:24 +00:00
18 lines
541 B
Dart
18 lines
541 B
Dart
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:models/models.dart';
|
|
import 'package:zapstore/services/device_key_service.dart';
|
|
|
|
void main() {
|
|
final service = DeviceKeyService();
|
|
|
|
test('parses a copied nsec into lower-case hex', () {
|
|
const hex =
|
|
'0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef';
|
|
expect(service.parsePrivateKey(bech32Encode('nsec', hex)), hex);
|
|
});
|
|
|
|
test('rejects malformed nsec checksums', () {
|
|
expect(service.parsePrivateKey('nsec1invalid'), isNull);
|
|
});
|
|
}
|