Skip to content

Commit

Permalink
fix(dapp-connector): remove unnecessary bindings for CIP-30 initial A…
Browse files Browse the repository at this point in the history
…PI methods
  • Loading branch information
lgobbi-atix committed Sep 19, 2023
1 parent 944e0ce commit c786042
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 0 additions & 2 deletions packages/dapp-connector/src/WalletApi/Cip30Wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ export class Cip30Wallet {
readonly #authenticator: RemoteAuthenticator;

constructor(properties: WalletProperties, { api, authenticator, logger }: WalletDependencies) {
this.enable = this.enable.bind(this);
this.icon = properties.icon;
this.isEnabled = this.isEnabled.bind(this);
this.name = properties.walletName;
this.#api = api;
this.#logger = logger;
Expand Down
6 changes: 4 additions & 2 deletions packages/dapp-connector/test/injectGlobal.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,14 @@ describe('injectGlobal', () => {
expect(window.cardano[properties.walletName].name).toBe(properties.walletName);
expect(typeof window.cardano[properties.walletName].apiVersion).toBe('string');
expect(window.cardano[properties.walletName].icon).toBe(properties.icon);
expect(window.cardano[properties.walletName].isEnabled).toBeDefined();
expect(typeof window.cardano[properties.walletName].isEnabled).toBe('function');
expect(window.cardano[properties.walletName].enable).toBeDefined();
expect(typeof window.cardano[properties.walletName].enable).toBe('function');
expect(Object.keys(window.cardano[properties.walletName])).toEqual([
'apiVersion',
'supportedExtensions',
'enable',
'icon',
'isEnabled',
'name'
]);
expect(window.cardano['another-obj']).toBe(anotherObj);
Expand Down

0 comments on commit c786042

Please sign in to comment.