File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed
Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import {
2020 getSessionDomain ,
2121 getSessionTypedData ,
2222 createSession ,
23+ createSessionRequest ,
2324} from "../utils"
2425
2526type WalletMock = Pick < StarknetWindowObject , "request" >
@@ -159,15 +160,25 @@ describe("Utils", () => {
159160 sessionKey,
160161 }
161162
162- const accountSessionSignature = await createSession ( {
163- address : "0x1234567890abcdef" ,
164- authorisationSignature : [ "0x123" , "0x456" ] ,
163+ const sessionRequest = createSessionRequest ( {
164+ chainId,
165165 sessionParams,
166+ } )
167+
168+ const authorisationSignature = await walletMock . request ( {
169+ type : "wallet_signTypedData" ,
170+ params : sessionRequest . sessionTypedData ,
171+ } )
172+
173+ const session = await createSession ( {
174+ address : "0x1234567890abcdef" ,
175+ authorisationSignature,
176+ sessionRequest,
166177 chainId,
167178 } )
168179
169- expect ( accountSessionSignature ) . not . toBeNull ( )
170- expect ( accountSessionSignature ) . toStrictEqual ( {
180+ expect ( session ) . not . toBeNull ( )
181+ expect ( session ) . toStrictEqual ( {
171182 sessionKeyGuid :
172183 "0x4bef97e579cdb4c9fa3546db3017a69ddbc40598cd7311359f1e6c03f02b155" ,
173184 hash : "0x87f8341a9fb39398e15dec07024475dd96406fe4880b9a24d10fb9e6bbf6bd" ,
You can’t perform that action at this time.
0 commit comments