Skip to content

Commit

Permalink
Fix circular dependency between JS modules (#2614)
Browse files Browse the repository at this point in the history
* Fix circular dependency between JS modules

* PR number
  • Loading branch information
tomaka authored Aug 12, 2022
1 parent 4885234 commit b979ef1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
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

0 comments on commit b979ef1

Please sign in to comment.