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

chore: fix failing RPC test #293

Merged
merged 2 commits into from
Oct 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
},
});