Skip to content

Commit d09cc83

Browse files
committed
cleanup
1 parent bcc4a14 commit d09cc83

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed

bindings_node/test/Client.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,16 @@ describe('Client', () => {
4444
])
4545
expect(canMessage).toEqual({
4646
[{
47-
identifier: user.account.address,
47+
identifier: user.account.address.toLowerCase(),
4848
identifierKind: PublicIdentifierKind.Ethereum,
49-
}.toLowerCase()]: true,
49+
}]: true,
5050
})
5151
})
5252

5353
it('should find an inbox ID from an address', async () => {
5454
const user = createUser()
5555
const client = await createRegisteredClient(user)
56-
const inboxId = await client.findInboxIdByAddress({
56+
const inboxId = await client.findInboxIdByIdentifier({
5757
identifier: user.account.address,
5858
identifierKind: PublicIdentifierKind.Ethereum,
5959
})

bindings_node/test/inboxId.test.ts

+16-13
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,41 @@ import { describe, expect, it } from 'vitest'
22
import { createRegisteredClient, createUser, TEST_API_URL } from '@test/helpers'
33
import {
44
generateInboxId,
5-
getInboxIdForAddress,
5+
getInboxIdForIdentifier,
66
isAddressAuthorized,
77
isInstallationAuthorized,
8+
PublicIdentifierKind,
9+
RootIdentifierKind,
810
} from '../dist/index'
911

1012
describe('generateInboxId', () => {
1113
it('should generate an inbox id', () => {
1214
const user = createUser()
13-
const inboxId = generateInboxId(user.account.address)
15+
const inboxId = generateInboxId({
16+
identifier: user.account.address,
17+
identifierKind: RootIdentifierKind.Ethereum,
18+
})
1419
expect(inboxId).toBeDefined()
1520
})
1621
})
1722

18-
describe('getInboxIdForAddress', () => {
23+
describe('getInboxIdForIdentifier', () => {
1924
it('should return `null` inbox ID for unregistered address', async () => {
2025
const user = createUser()
21-
const inboxId = await getInboxIdForAddress(
22-
TEST_API_URL,
23-
false,
24-
user.account.address
25-
)
26+
const inboxId = await getInboxIdForIdentifier(TEST_API_URL, false, {
27+
identifier: user.account.address,
28+
identifierKind: PublicIdentifierKind.Ethereum,
29+
})
2630
expect(inboxId).toBe(null)
2731
})
2832

2933
it('should return inbox ID for registered address', async () => {
3034
const user = createUser()
3135
const client = await createRegisteredClient(user)
32-
const inboxId = await getInboxIdForAddress(
33-
TEST_API_URL,
34-
false,
35-
user.account.address
36-
)
36+
const inboxId = await getInboxIdForIdentifier(TEST_API_URL, false, {
37+
identifier: user.account.address,
38+
identifierKind: PublicIdentifierKind.Ethereum,
39+
})
3740
expect(inboxId).toBe(client.inboxId())
3841
})
3942
})

0 commit comments

Comments
 (0)