Skip to content

Commit 4ec4b4f

Browse files
committed
test(reku): unsubscribe order
1 parent 1721d0c commit 4ec4b4f

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

packages/reku/provider/contract.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { Fn } from '@ora-io/utils'
2+
import { isWin } from '@ora-io/utils/os'
23
import type { Interface, InterfaceAbi } from 'ethers'
34
import { ethers } from 'ethers'
45

@@ -31,10 +32,15 @@ export class ContractManager {
3132
}
3233

3334
removeAllListeners() {
35+
if (!isWin)
36+
this._contract?.removeAllListeners()
37+
3438
for (const [event, listener] of this._listeners)
3539
this._contract?.off(event, listener)
3640

37-
this._contract?.removeAllListeners()
41+
if (isWin)
42+
this._contract?.removeAllListeners()
43+
3844
this._listeners.clear()
3945
}
4046

packages/utils/os/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const isWin = process.platform === 'win32'
2+
export const isMac = process.platform === 'darwin'
3+
export const isLinux = process.platform === 'linux'

0 commit comments

Comments
 (0)