Skip to content

Commit 876a69d

Browse files
committed
chore: debugging
1 parent 5e2bd13 commit 876a69d

File tree

4 files changed

+37
-9
lines changed

4 files changed

+37
-9
lines changed

packages/site/src/pages/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ const Index = () => {
247247
inputs: [],
248248
action: {
249249
callback: async () =>
250-
return getConnectedAccounts(
250+
getConnectedAccounts(
251251
defaultCustodianApiUrl,
252252
'ECA3',
253253
'local-dev',

packages/snap/snap.manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "git+https://github.com/MetaMask/snap-institutional-wallet.git"
88
},
99
"source": {
10-
"shasum": "5X8S3GFJm+aaCZNmDsWTXDmo6JwbZQZCKRlzQjVGzTc=",
10+
"shasum": "MCTFFXAWA/7PHzkn767NRTsjJOLThlJqmRNMpcQ1ujQ=",
1111
"location": {
1212
"npm": {
1313
"filePath": "dist/bundle.js",

packages/snap/src/keyring.test.ts

+33-6
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,13 @@ describe('CustodialKeyring', () => {
105105

106106
describe('filterAccountChains', () => {
107107
it('should filter supported chains', async () => {
108-
const mockAccount = { id: '1', address: '0x123' };
108+
const mockAccount = {
109+
id: '1',
110+
address: '0x123',
111+
options: {
112+
custodian: { importOrigin: 'test-origin' },
113+
},
114+
};
109115
const mockWallet = {
110116
account: mockAccount,
111117
details: {
@@ -171,6 +177,7 @@ describe('CustodialKeyring', () => {
171177
custodian: {
172178
displayName: 'Test Custodian',
173179
deferPublication: false,
180+
importOrigin: 'test-origin',
174181
},
175182
},
176183
};
@@ -277,7 +284,11 @@ describe('CustodialKeyring', () => {
277284
account: {
278285
id: '1',
279286
address: mockAddress,
280-
options: { importOrigin: 'test-origin' },
287+
options: {
288+
custodian: {
289+
importOrigin: 'test-origin',
290+
},
291+
},
281292
},
282293
details: {
283294
token: 'oldToken',
@@ -290,7 +301,11 @@ describe('CustodialKeyring', () => {
290301
account: {
291302
id: '2',
292303
address: '0x456',
293-
options: { importOrigin: 'test-origin' },
304+
options: {
305+
custodian: {
306+
importOrigin: 'test-origin',
307+
},
308+
},
294309
},
295310
details: {
296311
token: 'oldToken',
@@ -303,7 +318,11 @@ describe('CustodialKeyring', () => {
303318
account: {
304319
id: '3',
305320
address: '0x789',
306-
options: { importOrigin: 'test-origin' },
321+
options: {
322+
custodian: {
323+
importOrigin: 'test-origin',
324+
},
325+
},
307326
},
308327
details: {
309328
token: 'differentToken',
@@ -391,7 +410,11 @@ describe('CustodialKeyring', () => {
391410
account: {
392411
id: '1',
393412
address: '0x123',
394-
options: { importOrigin: 'test-origin' },
413+
options: {
414+
custodian: {
415+
importOrigin: 'test-origin',
416+
},
417+
},
395418
},
396419
details: {
397420
token: 'token',
@@ -424,7 +447,11 @@ describe('CustodialKeyring', () => {
424447
account: {
425448
id: '1',
426449
address: '0x123',
427-
options: { importOrigin: 'test-origin' },
450+
options: {
451+
custodian: {
452+
importOrigin: 'test-origin',
453+
},
454+
},
428455
},
429456
details: {
430457
token: 'token',

packages/snap/src/keyring.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -264,13 +264,14 @@ export class CustodialKeyring implements Keyring {
264264
origin: string,
265265
): Promise<CustodialKeyringAccount[]> {
266266
const wallets = await this.#stateManager.listWallets();
267+
267268
const matchingWallets = wallets.filter((wallet) => {
268269
return (
269270
wallet.details.token === details.token &&
270271
wallet.details.custodianApiUrl === details.custodianApiUrl &&
271272
wallet.details.custodianType === details.custodianType &&
272273
wallet.details.custodianEnvironment === details.custodianEnvironment &&
273-
wallet.account.options.importOrigin === origin
274+
wallet.account.options.custodian.importOrigin === origin
274275
);
275276
});
276277
return matchingWallets.map((wallet) => wallet.account);

0 commit comments

Comments
 (0)