From 05d99e7981b169fad25a91eff992f2742db2a26e Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Fri, 12 Aug 2022 09:45:14 +0200 Subject: [PATCH 1/2] Fix circular dependency between JS modules --- bin/wasm-node/CHANGELOG.md | 4 ++++ bin/wasm-node/javascript/src/client.ts | 13 ++----------- bin/wasm-node/javascript/src/instance/instance.ts | 12 +++++++++++- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/bin/wasm-node/CHANGELOG.md b/bin/wasm-node/CHANGELOG.md index af023b9087..b52cd271be 100644 --- a/bin/wasm-node/CHANGELOG.md +++ b/bin/wasm-node/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Fixed + +- Fix circular dependency between JavaScript modules. + ## 0.6.29 - 2022-08-09 ### Fixed diff --git a/bin/wasm-node/javascript/src/client.ts b/bin/wasm-node/javascript/src/client.ts index f9b7e04d8a..ee856ac9ad 100644 --- a/bin/wasm-node/javascript/src/client.ts +++ b/bin/wasm-node/javascript/src/client.ts @@ -17,6 +17,8 @@ import { PlatformBindings, start as startInstance } from './instance/instance.js'; +export { CrashError } from './instance/instance.js'; + /** * Thrown in case of a problem when initializing the chain. */ @@ -48,17 +50,6 @@ export class JsonRpcDisabledError extends Error { } } -/** - * Thrown in case the underlying client encounters an unexpected crash. - * - * This is always an internal bug in smoldot and is never supposed to happen. - */ -export class CrashError extends Error { - constructor(message: string) { - super(message); - } -} - /** * Client with zero or more active connections to blockchains. */ diff --git a/bin/wasm-node/javascript/src/instance/instance.ts b/bin/wasm-node/javascript/src/instance/instance.ts index 471c60591b..68c08016e4 100644 --- a/bin/wasm-node/javascript/src/instance/instance.ts +++ b/bin/wasm-node/javascript/src/instance/instance.ts @@ -18,10 +18,20 @@ import * as buffer from './buffer.js'; import * as instance from './raw-instance.js'; import { SmoldotWasmInstance } from './bindings.js'; -import { CrashError } from '../client.js'; export { PlatformBindings, ConnectionError, ConnectionConfig, Connection } from './raw-instance.js'; +/** + * Thrown in case the underlying client encounters an unexpected crash. + * + * This is always an internal bug in smoldot and is never supposed to happen. + */ + export class CrashError extends Error { + constructor(message: string) { + super(message); + } +} + /** * Contains the configuration of the instance. */ From 5dd895c98269e413c42d702d4dba15582aba63f6 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Fri, 12 Aug 2022 09:45:46 +0200 Subject: [PATCH 2/2] PR number --- bin/wasm-node/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/wasm-node/CHANGELOG.md b/bin/wasm-node/CHANGELOG.md index b52cd271be..789b4d50fa 100644 --- a/bin/wasm-node/CHANGELOG.md +++ b/bin/wasm-node/CHANGELOG.md @@ -4,7 +4,7 @@ ### Fixed -- Fix circular dependency between JavaScript modules. +- Fix circular dependency between JavaScript modules. ([#2614](https://github.com/paritytech/smoldot/pull/2614)) ## 0.6.29 - 2022-08-09