Re-add top-level cryptoWaitReady (#1486)
This commit is contained in:
@@ -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
|
||||
});
|
||||
|
||||
@@ -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 },
|
||||
|
||||
Reference in New Issue
Block a user