Skip to content

Commit

Permalink
Refactor isModuleEnabled method
Browse files Browse the repository at this point in the history
  • Loading branch information
germartinez committed Oct 15, 2020
1 parent de2e675 commit 947d590
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/CPK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,7 @@ class CPK {
if (!this.#contract) {
throw new Error('CPK contract uninitialized')
}
const modules = await this.#contract.call('getModules', [])
const selectedModules = modules.filter(
(module: Address) => module.toLowerCase() === moduleAddress.toLowerCase()
)
return selectedModules.length > 0
return await this.#contract.call('isModuleEnabled', [moduleAddress])
}

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

0 comments on commit 947d590

Please sign in to comment.