Skip to content

Commit 25896e5

Browse files
committed
fix: specify format when import client
1 parent f79f78b commit 25896e5

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

examples/eme/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { Client, fromBase64, fromBuffer } from 'azot';
1313

1414
// If you have *.wvd file
1515
const wvd = await readFile('client.wvd');
16-
const client = await Client.fromPacked(wvd);
16+
const client = await Client.fromPacked(wvd, 'wvd');
1717

1818
const initDataType = 'cenc';
1919
const initData = fromBase64(pssh).toBuffer();

examples/session/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ async function main() {
1010

1111
// Load device/client
1212
const wvd = await readFile('client.wvd');
13-
const client = await Client.fromPacked(wvd);
13+
const client = await Client.fromPacked(wvd, 'wvd');
1414

1515
// Create session
1616
const session = new Session('temporary', client);

test/client.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ test('export client', async () => {
2525

2626
test('import wvd', async () => {
2727
const wvd = await read('client.wvd');
28-
const client = await Client.fromPacked(wvd);
28+
const client = await Client.fromPacked(wvd, 'wvd');
2929
expect(client.id).toBeDefined();
3030
expect(client.key).toBeDefined();
3131
const keys = await fetchDecryptionKeysWithDefaults();
@@ -36,8 +36,8 @@ test('export wvd', async () => {
3636
const id = await read('device_client_id_blob');
3737
const key = await read('device_private_key');
3838
const client = await Client.fromUnpacked(id, key);
39-
const wvd = await client.pack();
40-
const wvdClient = await Client.fromPacked(wvd);
39+
const wvd = await client.pack('wvd');
40+
const wvdClient = await Client.fromPacked(wvd, 'wvd');
4141
const keys = await fetchDecryptionKeysWithDefaults(wvdClient);
4242
expect(keys.length).toBe(5);
4343
});

test/session.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test('session', async () => {
1111

1212
// Load device/client
1313
const wvd = await readFile('client.wvd');
14-
const client = await Client.fromPacked(wvd);
14+
const client = await Client.fromPacked(wvd, 'wvd');
1515

1616
// Create session
1717
const session = new Session('temporary', client);

0 commit comments

Comments
 (0)