Only throw on construction types (#6690)

This commit is contained in:
Jaco 2021-12-16 09:03:26 +01:00 committed by GitHub
parent 4f3b497256
commit 41fc0c25be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,13 +58,16 @@ export function checkEndpoints (issueFile: string, failures: string[]): void {
api = new ApiPromise({
provider,
throwOnConnect: true,
throwOnUnknown: true,
throwOnUnknown: false,
typesBundle,
typesChain
});
setTimeout((): void => {
provider && provider.connect().catch(() => undefined);
provider &&
provider
.connect()
.catch(() => undefined);
}, 1000);
await Promise.race([
@ -75,7 +78,9 @@ export function checkEndpoints (issueFile: string, failures: string[]): void {
reject(new Error(`Timeout connecting to ${ws}`));
}, 30_000);
}),
api.isReadyOrError.then((api) => api.rpc.chain.getBlock().then((b) => console.log(b.toHuman())))
api.isReadyOrError
.then((a) => a.rpc.chain.getBlock())
.then((b) => console.log(b.toHuman()))
]);
} catch (error) {
if (isError(error) && failures.some((f) => (error as Error).message.includes(f))) {