@ledgerhq/ledger-key-ring-protocol 0.5.1-nightly.1 → 0.5.1-nightly.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +10 -0
- package/lib/qrcode/cipher.d.ts +4 -4
- package/lib/qrcode/cipher.d.ts.map +1 -1
- package/lib/qrcode/cipher.js +26 -43
- package/lib/qrcode/cipher.js.map +1 -1
- package/lib/qrcode/cipher.test.js +16 -25
- package/lib/qrcode/cipher.test.js.map +1 -1
- package/lib/qrcode/index.d.ts.map +1 -1
- package/lib/qrcode/index.js +23 -26
- package/lib/qrcode/index.js.map +1 -1
- package/lib/sdk.js +1 -1
- package/lib/sdk.js.map +1 -1
- package/lib-es/qrcode/cipher.d.ts +4 -4
- package/lib-es/qrcode/cipher.d.ts.map +1 -1
- package/lib-es/qrcode/cipher.js +26 -43
- package/lib-es/qrcode/cipher.js.map +1 -1
- package/lib-es/qrcode/cipher.test.js +16 -25
- package/lib-es/qrcode/cipher.test.js.map +1 -1
- package/lib-es/qrcode/index.d.ts.map +1 -1
- package/lib-es/qrcode/index.js +23 -26
- package/lib-es/qrcode/index.js.map +1 -1
- package/lib-es/sdk.js +1 -1
- package/lib-es/sdk.js.map +1 -1
- package/package.json +5 -5
- package/src/qrcode/cipher.test.ts +14 -14
- package/src/qrcode/cipher.ts +14 -16
- package/src/qrcode/index.ts +19 -20
- package/src/sdk.ts +1 -1
- package/tests/test-helpers/recordTrustchainSdkTests.ts +4 -4
- package/tests/test-helpers/replayTrustchainSdkTests.ts +1 -1
|
@@ -94,8 +94,8 @@ export async function recordTestTrustchainSdk(
|
|
|
94
94
|
// Monkey patches the `crypto.randomBytes` method to log generated random bytes in hexadecimal format in order to deterministically replay them in unit tests.
|
|
95
95
|
const randomBytesOutputs: string[] = [];
|
|
96
96
|
const originalRandomBytes = crypto.randomBytes;
|
|
97
|
-
crypto.randomBytes =
|
|
98
|
-
const bytes =
|
|
97
|
+
crypto.randomBytes = (size: number) => {
|
|
98
|
+
const bytes = originalRandomBytes.call(crypto, size);
|
|
99
99
|
randomBytesOutputs.push(crypto.to_hex(bytes));
|
|
100
100
|
return bytes;
|
|
101
101
|
};
|
|
@@ -103,8 +103,8 @@ export async function recordTestTrustchainSdk(
|
|
|
103
103
|
// Monkey patches the `crypto.randomKeypair` method to log generated random keypairs in hexadecimal format in order to deterministically replay them in unit tests.
|
|
104
104
|
const randomKeypairOutputs: string[] = [];
|
|
105
105
|
const originalRandomKeypair = crypto.randomKeypair;
|
|
106
|
-
crypto.randomKeypair =
|
|
107
|
-
const keypair =
|
|
106
|
+
crypto.randomKeypair = () => {
|
|
107
|
+
const keypair = originalRandomKeypair.call(crypto);
|
|
108
108
|
randomKeypairOutputs.push(crypto.to_hex(keypair.privateKey));
|
|
109
109
|
return keypair;
|
|
110
110
|
};
|
|
@@ -69,7 +69,7 @@ export async function replayTrustchainSdkTests<Json extends JsonShape>(
|
|
|
69
69
|
if (bytes.length !== size) {
|
|
70
70
|
throw new Error("unexpected randomBytes size. Expected " + size + " but got " + bytes.length);
|
|
71
71
|
}
|
|
72
|
-
return
|
|
72
|
+
return bytes;
|
|
73
73
|
});
|
|
74
74
|
|
|
75
75
|
const recordStore = RecordStore.fromString(json.apdus);
|