Skip to content

Commit

Permalink
Using fixUnorderedBlocks compat from papi (#444)
Browse files Browse the repository at this point in the history
This should fix `TypeError: Cannot read properties of undefined (reading
'number')` crashes.
See polkadot-api/polkadot-api#710

Related to #438, but isn't the only reason for crashes
  • Loading branch information
mutantcornholio authored Sep 13, 2024
1 parent f01f2c0 commit b8902da
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/papi/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { config } from "#src/config";
import fs from "fs";
import { createClient, PolkadotClient } from "polkadot-api";
import { withLogsRecorder } from "polkadot-api/logs-provider";
import { fixUnorderedBlocks, parsed } from "polkadot-api/polkadot-sdk-compat";
import { getWsProvider, JsonRpcProvider } from "polkadot-api/ws-provider/node";

import { getNetworkData } from "./chains";
Expand All @@ -20,4 +21,4 @@ if (process.env.PAPI_DEBUG) {
}, provider);
}

export const client: PolkadotClient = createClient(provider);
export const client: PolkadotClient = createClient(parsed(fixUnorderedBlocks)(provider));

0 comments on commit b8902da

Please sign in to comment.