Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix circular dependency between JS modules #2614

Merged
merged 2 commits into from
Aug 12, 2022
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions bin/wasm-node/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 2 additions & 11 deletions bin/wasm-node/javascript/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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.
*/
Expand Down
12 changes: 11 additions & 1 deletion bin/wasm-node/javascript/src/instance/instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down