How to use the @reactivex/ix-es2015-cjs/asynciterable/toarray.toArray function in @reactivex/ix-es2015-cjs

To help you get started, we’ve selected a few @reactivex/ix-es2015-cjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github neo-one-suite / neo-one / scripts / verify / storage.ts View on Github external
const verifyStorage = async (hash: string): Promise => {
  const storageItems = await toArray(AsyncIterableX.from(oneProvider.iterStorage(scriptHashToAddress(hash))));
  const storageItemChunks = _.chunk(storageItems, BATCH_SIZE);
  const storageItemCount = storageItems.length;

  let totalEqual = 0;
  let count = 0;
  for (const chunk of storageItemChunks) {
    await Promise.all(
      chunk.map(async (itemIn) => {
        count += 1;
        let [currentItem, testItem] = await Promise.all([
          getStorage(oneRPCURL, itemIn),
          getStorage(testRPCURL, itemIn),
        ]);

        if (!isEqual(currentItem, testItem)) {
          await new Promise((resolve) => setTimeout(resolve, 5000));