We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 515007a commit 8cfafe7Copy full SHA for 8cfafe7
1 file changed
tests/wif.test.js
@@ -5,10 +5,13 @@ import { test } from 'node:test'
5
import assert from 'node:assert/strict'
6
import * as wif from 'wif'
7
8
+const tracked = []
9
+
10
async function fromWifString(str) {
11
const a = await lib.fromWifString(str)
12
const b = lib.fromWifStringSync(str)
13
assert.deepStrictEqual(a, b)
14
+ tracked.push(a.privateKey, b.privateKey)
15
return a
16
}
17
@@ -97,3 +100,11 @@ test('invalid length throws before version check', async (t) => {
97
100
})
98
101
99
102
103
104
+test('wif.decode returns non-pooled Uint8Array instances', (t) => {
105
+ t.assert.ok(tracked.length > 1000)
106
107
+ for (const u8 of tracked) {
108
+ t.assert.strictEqual(u8.byteLength, u8.buffer.byteLength)
109
+ }
110
+})
0 commit comments