Skip to content

Commit a52b706

Browse files
committed
test: add sign message test PE-1136
1 parent 3f3c72e commit a52b706

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/wallets_test.dart

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import 'dart:convert';
22
import 'dart:io';
3+
import 'dart:typed_data';
34

45
import 'package:arweave/arweave.dart';
6+
import 'package:arweave/utils.dart';
57
import 'package:test/test.dart';
68

79
import 'utils.dart';
@@ -55,5 +57,18 @@ void main() {
5557
}, onPlatform: {
5658
'browser': Skip('dart:io unavailable'),
5759
});
60+
61+
test('sign message with wallet', () async {
62+
final wallet = await getTestWallet();
63+
final message = utf8.encode('<test message>');
64+
65+
final signature = await wallet.signMessage(message as Uint8List);
66+
expect(
67+
encodeBytesToBase64(signature),
68+
startsWith('II5LxGnPt4WTSz9P__wMAdjzXWlZE-wGbKU7wm4DbGuPXB5Vifs'),
69+
);
70+
}, onPlatform: {
71+
'browser': Skip('dart:io unavailable'),
72+
});
5873
});
5974
}

0 commit comments

Comments
 (0)