Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

Commit

Permalink
chore: fix failing RPC test (#293)
Browse files Browse the repository at this point in the history
  • Loading branch information
harrysolovay authored Oct 12, 2022
1 parent c066412 commit c761a74
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions rpc/providers/proxy.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert } from "../../deps/std/testing/asserts.ts";
import { polkadot } from "../../known/mod.ts";
import { config as testConfig } from "../../test_util/mod.ts";
import * as U from "../../util/mod.ts";
import * as msg from "../messages.ts";
import { proxyClient } from "./proxy.ts";
Expand All @@ -9,15 +9,16 @@ Deno.test({
sanitizeResources: false,
sanitizeOps: false,
async fn(t) {
const client = U.throwIfError(await proxyClient(polkadot));
const config = await testConfig();
const client = U.throwIfError(await proxyClient(config));

await t.step("call", async () => {
const raw = await client.call("state_getMetadata", []);
assert(typeof raw.result === "string");
});

await t.step("subscribe", async () => {
const result: msg.NotifMessage<typeof polkadot, "chain_subscribeAllHeads">[] = [];
const result: msg.NotifMessage<typeof config, "chain_subscribeAllHeads">[] = [];
let i = 1;
await client.subscribe("chain_subscribeAllHeads", [], (stop) => {
return (message) => {
Expand All @@ -34,5 +35,6 @@ Deno.test({
});

await client.close();
config.close();
},
});

0 comments on commit c761a74

Please sign in to comment.