Skip to content

Commit 3f1ca57

Browse files
committed
Refactor isModuleEnabled method
1 parent 68a7c71 commit 3f1ca57

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/CPK.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -330,11 +330,7 @@ class CPK {
330330
if (!this.#contract) {
331331
throw new Error('CPK contract uninitialized')
332332
}
333-
const modules = await this.#contract.call('getModules', [])
334-
const selectedModules = modules.filter(
335-
(module: Address) => module.toLowerCase() === moduleAddress.toLowerCase()
336-
)
337-
return selectedModules.length > 0
333+
return await this.#contract.call('isModuleEnabled', [moduleAddress])
338334
}
339335

340336
async enableModule(moduleAddress: Address): Promise<TransactionResult> {

0 commit comments

Comments
 (0)