Re-add top-level cryptoWaitReady (#1486)

This commit is contained in:
Jaco
2022-05-13 08:34:53 +03:00
committed by GitHub
parent 6c299f81c6
commit 66e2382f26
2 changed files with 7 additions and 7 deletions
+5 -5
View File
@@ -7,7 +7,7 @@ import { utils as utilsNobleSecp256k1 } from '@noble/secp256k1';
import { u8aConcat } from '@polkadot/util';
// import { cryptoWaitReady } from './crypto';
import { cryptoWaitReady } from './crypto';
import { hmacSha256AsU8a } from './hmac';
// Set overrides on the secp256k1 utils
@@ -15,7 +15,7 @@ import { hmacSha256AsU8a } from './hmac';
utilsNobleSecp256k1.hmacSha256Sync = (key: Uint8Array, ...messages: Uint8Array[]) =>
hmacSha256AsU8a(key, u8aConcat(...messages));
// // start init process immediately
// cryptoWaitReady().catch((): void => {
// // shouldn't happen, logged above
// });
// start init process immediately
cryptoWaitReady().catch((): void => {
// shouldn't happen, logged and caught inside cryptoWaitReady
});
+2 -2
View File
@@ -14,7 +14,7 @@ import { objectSpread } from '../object/spread';
* `UInt8Array` input values return the actual BN. `null` or `undefined` values returns an `0x0` value.
* @param value The value to convert
* @param options Options to pass while converting
* @param options.isLe Convert using Little Endian
* @param options.isLe Convert using Little Endian (default)
* @param options.isNegative Convert using two's complement
* @example
* <BR>
@@ -26,7 +26,7 @@ import { objectSpread } from '../object/spread';
* ```
*/
export function u8aToBn (value: Uint8Array, options: ToBnOptions | boolean = {}): BN {
// NOTE: This is the same process as followed in the hextoBn conversion
// NOTE: This is the same process as followed in the hexToBn conversion
// For Uint8Array, default to LE
const { isLe, isNegative } = objectSpread<ToBnOptions>(
{ isLe: true, isNegative: false },