Skip to content

Commit 94769d9

Browse files
authored
Merge pull request #127 from TheBlueMatt/main
Add missing `UtilMethods` export and sanity-test node-net setups
2 parents 5cdb34f + 2b4cef0 commit 94769d9

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,10 +358,6 @@ jobs:
358358
uses: actions/checkout@v2
359359
with:
360360
fetch-depth: 0
361-
- name: Temporarily use rustc from yesterday
362-
run: |
363-
rustup install 1.67.1
364-
rustup default 1.67.1
365361
- name: Fetch upstream LLVM/clang snapshot
366362
run: |
367363
git config --global safe.directory '*'

node-net/net.mts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ export class NodeLDKNet {
88
private ping_timer;
99
private servers: net.Server[];
1010
public constructor(public peer_manager: ldk.PeerManager) {
11+
// @ts-ignore
12+
if (peer_manager._node_ldk_net_singleton_check != undefined) {
13+
throw "Only one NdoeLDKNet should exist per PeerManager";
14+
}
15+
// @ts-ignore
16+
peer_manager._node_ldk_net_singleton_check = this;
1117
this.ping_timer = setInterval(function() {
1218
peer_manager.timer_tick_occurred();
1319
peer_manager.process_events();
@@ -24,6 +30,8 @@ export class NodeLDKNet {
2430
server.close();
2531
}
2632
this.peer_manager.disconnect_all_peers();
33+
// @ts-ignore
34+
delete this.peer_manager._node_ldk_net_singleton_check;
2735
}
2836

2937
/**

ts/index.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export async function initializeWasmFromBinary(bin: Uint8Array) {
88
await initializeWasmFromUint8Array(bin);
99
}
1010

11+
export * from './structs/UtilMethods.mjs';
1112
export * from './structs/TxOut.mjs';
1213
export * from './structs/BigEndianScalar.mjs';
1314
export * from './enums/COption_NoneZ.mjs';

typescript_strings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ def __init__(self, DEBUG: bool, target: Target, outdir: str, **kwargs):
361361
await initializeWasmFromUint8Array(bin);
362362
}
363363
364+
export * from './structs/UtilMethods.mjs';
364365
""")
365366

366367
self.bindings_version_file = """export function get_ldk_java_bindings_version(): String {

0 commit comments

Comments
 (0)