|
3 | 3 | const assert = require('assert'); |
4 | 4 | const initMoneroCoreJs = require('../index.js'); |
5 | 5 | const [standard, subaddress, integrated] = require('./fixtures/data.json'); |
| 6 | +WebAssembly.instantiateStreaming = false; |
6 | 7 |
|
7 | 8 | describe('index', () => { |
8 | 9 |
|
9 | 10 | describe('createTx (wasm)', () => { |
10 | 11 | it('should work (standard address)', async () => { |
11 | 12 | const moneroCoreJs = await initMoneroCoreJs(); |
12 | | - const rawTx = moneroCoreJs.createTx(standard); |
| 13 | + const { rawTx, txKey } = moneroCoreJs.createTx(standard); |
13 | 14 | assert.strictEqual(typeof rawTx, 'string'); |
14 | 15 | assert.ok(rawTx.length > 0); |
| 16 | + assert.strictEqual(typeof txKey, 'string'); |
| 17 | + assert.ok(txKey.length > 0); |
15 | 18 | }); |
16 | 19 | it('should work wasm (subaddress address)', async () => { |
17 | 20 | const moneroCoreJs = await initMoneroCoreJs(); |
18 | | - const rawTx = moneroCoreJs.createTx(subaddress); |
| 21 | + const { rawTx, txKey } = moneroCoreJs.createTx(subaddress); |
19 | 22 | assert.strictEqual(typeof rawTx, 'string'); |
20 | 23 | assert.ok(rawTx.length > 0); |
| 24 | + assert.strictEqual(typeof txKey, 'string'); |
| 25 | + assert.ok(txKey.length > 0); |
21 | 26 | }); |
22 | 27 | it('should work wasm (integrated address)', async () => { |
23 | 28 | const moneroCoreJs = await initMoneroCoreJs(); |
24 | | - const rawTx = moneroCoreJs.createTx(integrated); |
| 29 | + const { rawTx, txKey } = moneroCoreJs.createTx(integrated); |
25 | 30 | assert.strictEqual(typeof rawTx, 'string'); |
26 | 31 | assert.ok(rawTx.length > 0); |
| 32 | + assert.strictEqual(typeof txKey, 'string'); |
| 33 | + assert.ok(txKey.length > 0); |
27 | 34 | }); |
28 | 35 | }); |
29 | 36 |
|
30 | 37 | describe('createTx (asm)', () => { |
31 | 38 | it('should work asm (standard address)', async () => { |
32 | 39 | const moneroCoreJs = await initMoneroCoreJs(false, true); |
33 | | - const rawTx = moneroCoreJs.createTx(standard); |
| 40 | + const { rawTx, txKey } = moneroCoreJs.createTx(standard); |
34 | 41 | assert.strictEqual(typeof rawTx, 'string'); |
35 | 42 | assert.ok(rawTx.length > 0); |
| 43 | + assert.strictEqual(typeof txKey, 'string'); |
| 44 | + assert.ok(txKey.length > 0); |
36 | 45 | }); |
37 | 46 | it('should work asm (subaddress address)', async () => { |
38 | 47 | const moneroCoreJs = await initMoneroCoreJs(false, true); |
39 | | - const rawTx = moneroCoreJs.createTx(subaddress); |
| 48 | + const { rawTx, txKey } = moneroCoreJs.createTx(subaddress); |
40 | 49 | assert.strictEqual(typeof rawTx, 'string'); |
41 | 50 | assert.ok(rawTx.length > 0); |
| 51 | + assert.strictEqual(typeof txKey, 'string'); |
| 52 | + assert.ok(txKey.length > 0); |
42 | 53 | }); |
43 | 54 | it('should work asm (integrated address)', async () => { |
44 | 55 | const moneroCoreJs = await initMoneroCoreJs(false, true); |
45 | | - const rawTx = moneroCoreJs.createTx(integrated); |
| 56 | + const { rawTx, txKey } = moneroCoreJs.createTx(integrated); |
46 | 57 | assert.strictEqual(typeof rawTx, 'string'); |
47 | 58 | assert.ok(rawTx.length > 0); |
| 59 | + assert.strictEqual(typeof txKey, 'string'); |
| 60 | + assert.ok(txKey.length > 0); |
48 | 61 | }); |
49 | 62 | }); |
50 | 63 |
|
51 | | - // describe('createTx (BulletproofPlus)', () => { |
52 | | - // it('should work wasm', async () => { |
53 | | - // const moneroCoreJs = await initMoneroCoreJs(); |
54 | | - // CLSAG.forEach((fixture) => { |
55 | | - // const rawTx = moneroCoreJs.createTx(fixture); |
56 | | - // assert.strictEqual(typeof rawTx, 'string'); |
57 | | - // assert.ok(rawTx.length > 0); |
58 | | - // }); |
59 | | - // }); |
60 | | - // it('should work asm', async () => { |
61 | | - // const moneroCoreJs = await initMoneroCoreJs(false, true); |
62 | | - // CLSAG.forEach((fixture) => { |
63 | | - // const rawTx = moneroCoreJs.createTx(fixture); |
64 | | - // assert.strictEqual(typeof rawTx, 'string'); |
65 | | - // assert.ok(rawTx.length > 0); |
66 | | - // }); |
67 | | - // }); |
68 | | - // }); |
69 | | - |
70 | 64 | }); |
0 commit comments