diff --git a/bin/wasm-node/CHANGELOG.md b/bin/wasm-node/CHANGELOG.md index af023b9087..789b4d50fa 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. ([#2614](https://github.com/paritytech/smoldot/pull/2614)) + ## 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. */