From 7aafeb948171facf3282ca5e4e5903796eb76825 Mon Sep 17 00:00:00 2001 From: Owen Wu <1449069+yubing744@users.noreply.github.com> Date: Mon, 2 Oct 2023 14:40:28 +0800 Subject: [PATCH] feat: fixbug for session key list create_time not show correct (#902) --- dashboard/src/views/feature/SessionKeyList.tsx | 4 ++-- sdk/typescript/test/e2e/sdk.test.ts | 5 +++++ sdk/typescript/test/e2e/servers/rooch-server.ts | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/dashboard/src/views/feature/SessionKeyList.tsx b/dashboard/src/views/feature/SessionKeyList.tsx index 9278b617b9..71f7d36303 100644 --- a/dashboard/src/views/feature/SessionKeyList.tsx +++ b/dashboard/src/views/feature/SessionKeyList.tsx @@ -72,7 +72,7 @@ export default function SessionKeyList() { headerName: 'Last Active Time', width: 200, valueGetter: (params: GridValueGetterParams) => { - return formatDate(params.row.last_active_time) + return formatDate(params.row.last_active_time * 1000) }, }, { @@ -80,7 +80,7 @@ export default function SessionKeyList() { headerName: 'Create Time', width: 200, valueGetter: (params: GridValueGetterParams) => { - return formatDate(params.row.create_time) + return formatDate(params.row.create_time * 1000) }, }, { diff --git a/sdk/typescript/test/e2e/sdk.test.ts b/sdk/typescript/test/e2e/sdk.test.ts index 896d71f177..51545709c2 100644 --- a/sdk/typescript/test/e2e/sdk.test.ts +++ b/sdk/typescript/test/e2e/sdk.test.ts @@ -391,6 +391,9 @@ describe('SDK', () => { const account = new Account(provider, roochAddress, authorizer) expect(account).toBeDefined() + // wait timestamp sync + await new Promise((resolve) => setTimeout(resolve, 5000)) + // create session account const sessionAccount = await account.createSessionAccount( ['0x3::empty::empty', '0x1::*::*'], @@ -406,6 +409,8 @@ describe('SDK', () => { expect(page.data).toHaveLength(1) expect(page.data[0].authentication_key).toBeDefined() expect(page.data[0].max_inactive_interval).toBe(100) + expect(page.data[0].create_time).greaterThan(1696225092) + expect(page.data[0].last_active_time).greaterThan(1696225092) // query next page const nextPage = await account.querySessionKeys(page.nextCursor, 10) diff --git a/sdk/typescript/test/e2e/servers/rooch-server.ts b/sdk/typescript/test/e2e/servers/rooch-server.ts index 059db50aa2..991347b0bf 100644 --- a/sdk/typescript/test/e2e/servers/rooch-server.ts +++ b/sdk/typescript/test/e2e/servers/rooch-server.ts @@ -18,6 +18,8 @@ export class RoochServer { 'local', '-d', 'TMP', + '--eth-rpc-url', + 'https://goerli.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161', ]) if (this.child) {