@@ -2,38 +2,41 @@ import { describe, expect, it } from 'vitest'
2
2
import { createRegisteredClient , createUser , TEST_API_URL } from '@test/helpers'
3
3
import {
4
4
generateInboxId ,
5
- getInboxIdForAddress ,
5
+ getInboxIdForIdentifier ,
6
6
isAddressAuthorized ,
7
7
isInstallationAuthorized ,
8
+ PublicIdentifierKind ,
9
+ RootIdentifierKind ,
8
10
} from '../dist/index'
9
11
10
12
describe ( 'generateInboxId' , ( ) => {
11
13
it ( 'should generate an inbox id' , ( ) => {
12
14
const user = createUser ( )
13
- const inboxId = generateInboxId ( user . account . address )
15
+ const inboxId = generateInboxId ( {
16
+ identifier : user . account . address ,
17
+ identifierKind : RootIdentifierKind . Ethereum ,
18
+ } )
14
19
expect ( inboxId ) . toBeDefined ( )
15
20
} )
16
21
} )
17
22
18
- describe ( 'getInboxIdForAddress ' , ( ) => {
23
+ describe ( 'getInboxIdForIdentifier ' , ( ) => {
19
24
it ( 'should return `null` inbox ID for unregistered address' , async ( ) => {
20
25
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
+ } )
26
30
expect ( inboxId ) . toBe ( null )
27
31
} )
28
32
29
33
it ( 'should return inbox ID for registered address' , async ( ) => {
30
34
const user = createUser ( )
31
35
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
+ } )
37
40
expect ( inboxId ) . toBe ( client . inboxId ( ) )
38
41
} )
39
42
} )
0 commit comments