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

Commit

Permalink
chore: DNT usage fixes (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
harrysolovay authored Jul 23, 2022
1 parent 75af543 commit d22d5c8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 18 deletions.
13 changes: 3 additions & 10 deletions _tasks/dnt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,11 @@ await fs.emptyDir(outDir);
await Promise.all([
build({
entryPoints: ["mod.ts", {
name: "./fluent",
path: "fluent/mod.ts",
}, {
name: "./test-util",
path: "test-util/mod.ts",
}, {
name: "./frame_metadata",
path: "frame_metadata/mod.ts",
}, {
name: "./config",
path: "config/mod.ts",
}, {
name: "./known",
path: "known/mod.ts",
Expand All @@ -29,11 +23,11 @@ await Promise.all([
}],
outDir,
mappings: {
"https://deno.land/x/scale@v0.3.0/mod.ts": {
"https://deno.land/x/scale@v0.3.2/mod.ts": {
name: "parity-scale-codec",
version: "^0.3.0",
version: "^0.3.2",
},
"_deps/smoldot_phantom.ts": {
"deps/smoldot_phantom.ts": {
name: "@substrate/smoldot-light",
version: "0.6.20",
peerDependency: true,
Expand All @@ -57,7 +51,6 @@ await Promise.all([
deno: {
test: true,
},
webSocket: true,
},
test: false,
typeCheck: false,
Expand Down
7 changes: 2 additions & 5 deletions config/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,14 @@ import {
PalletMetadata as PalletMetadata_,
} from "./metadata.ts";

declare const rpc_provider_methods_: unique symbol;
declare const metadata_: unique symbol;

export declare const config_: unique symbol;
/** We represent as a class, not a branded type, because we want to extend into a pretty signature. */
export class Config<
D = any,
M extends ProviderMethods = ProviderMethods,
F extends Metadata_ = Metadata_,
> {
declare [rpc_provider_methods_]: M;
declare [metadata_]: F;
#$!: [M, F];

constructor(readonly discoveryValue: D) {}
}
Expand Down
2 changes: 1 addition & 1 deletion deps/scale.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from "https://deno.land/x/scale@v0.3.0/mod.ts";
export * from "https://deno.land/x/scale@v0.3.2/mod.ts";
4 changes: 2 additions & 2 deletions effect/atoms/RpcCall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ export function rpcCall<
async function(client, methodName, ...params) {
const result = await client.call(methodName, params as Parameters<Methods[T_<MethodName>]>);
if (result.error) {
return new RpcError();
return new RpcCallError();
}
return result;
},
);
}

class RpcError extends U.ErrorCtor("Rpc") {}
export class RpcCallError extends U.ErrorCtor("Rpc") {}

0 comments on commit d22d5c8

Please sign in to comment.