From 780814bd3742f8bc36e75b6fd8b40d19db6a32b7 Mon Sep 17 00:00:00 2001 From: Branko Bosnic Date: Wed, 24 Apr 2024 14:48:20 +0200 Subject: [PATCH 1/5] remove cursor from slot blocks request --- api/src/models/api/nova/chronicle/ISlotBlocksRequest.ts | 5 ----- api/src/services/nova/chronicleService.ts | 4 +--- client/src/models/api/nova/ISlotBlocksRequest.ts | 5 ----- client/src/services/nova/novaApiClient.ts | 8 +------- 4 files changed, 2 insertions(+), 20 deletions(-) diff --git a/api/src/models/api/nova/chronicle/ISlotBlocksRequest.ts b/api/src/models/api/nova/chronicle/ISlotBlocksRequest.ts index 0336656f9..a8593c765 100644 --- a/api/src/models/api/nova/chronicle/ISlotBlocksRequest.ts +++ b/api/src/models/api/nova/chronicle/ISlotBlocksRequest.ts @@ -8,9 +8,4 @@ export interface ISlotBlocksRequest { * The slot index to get the details for. */ slotIndex: string; - - /** - * The cursor state for the request. - */ - cursor?: string; } diff --git a/api/src/services/nova/chronicleService.ts b/api/src/services/nova/chronicleService.ts index f9763c9c9..134a40cd2 100644 --- a/api/src/services/nova/chronicleService.ts +++ b/api/src/services/nova/chronicleService.ts @@ -58,9 +58,7 @@ export class ChronicleService { do { try { - const params = { - cursor: request.cursor, - }; + const params = { cursor }; const response = await FetchHelper.json( this.chronicleEndpoint, `${CHRONICLE_ENDPOINTS.slotBlocks}${params ? `${FetchHelper.urlParams(params)}` : ""}`.replace( diff --git a/client/src/models/api/nova/ISlotBlocksRequest.ts b/client/src/models/api/nova/ISlotBlocksRequest.ts index 0336656f9..a8593c765 100644 --- a/client/src/models/api/nova/ISlotBlocksRequest.ts +++ b/client/src/models/api/nova/ISlotBlocksRequest.ts @@ -8,9 +8,4 @@ export interface ISlotBlocksRequest { * The slot index to get the details for. */ slotIndex: string; - - /** - * The cursor state for the request. - */ - cursor?: string; } diff --git a/client/src/services/nova/novaApiClient.ts b/client/src/services/nova/novaApiClient.ts index edaf87cb3..549db86c3 100644 --- a/client/src/services/nova/novaApiClient.ts +++ b/client/src/services/nova/novaApiClient.ts @@ -305,13 +305,7 @@ export class NovaApiClient extends ApiClient { * @returns The response from the request. */ public async getSlotBlocks(request: ISlotBlocksRequest): Promise { - const params = { - cursor: request.cursor, - }; - return this.callApi( - `nova/slot/blocks/chronicle/${request.network}/${request.slotIndex}${FetchHelper.urlParams(params)}`, - "get", - ); + return this.callApi(`nova/slot/blocks/chronicle/${request.network}/${request.slotIndex}`, "get"); } /** From d6c2ac6907aee25616c870da1789614d82006ec1 Mon Sep 17 00:00:00 2001 From: Branko Bosnic Date: Thu, 25 Apr 2024 14:32:51 +0200 Subject: [PATCH 2/5] fix: add cursor from response --- api/src/services/nova/chronicleService.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/api/src/services/nova/chronicleService.ts b/api/src/services/nova/chronicleService.ts index 134a40cd2..3eead0aad 100644 --- a/api/src/services/nova/chronicleService.ts +++ b/api/src/services/nova/chronicleService.ts @@ -67,9 +67,7 @@ export class ChronicleService { ), "get", ); - // Hardcoded to null for now because chronicle always returns the same cursor: https://github.com/iotaledger/inx-chronicle/issues/1362 - cursor = null; - // cursor = response.cursor; + cursor = response.cursor; if (response.blocks) { slotBlocks.push(...response.blocks); From 278e7afd25853c3d2796f450ce18e210ca1d9ad8 Mon Sep 17 00:00:00 2001 From: Branko Bosnic Date: Thu, 25 Apr 2024 15:28:40 +0200 Subject: [PATCH 3/5] fix: slot blocks query --- api/src/services/nova/influx/influxQueries.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/services/nova/influx/influxQueries.ts b/api/src/services/nova/influx/influxQueries.ts index 7b3abc2e3..711bbf217 100644 --- a/api/src/services/nova/influx/influxQueries.ts +++ b/api/src/services/nova/influx/influxQueries.ts @@ -93,7 +93,7 @@ export const BLOCK_STATS_QUERY = ` sum("candidacy_announcement_count") AS "candidacy", sum("validation_count") AS "noPayload" FROM "iota_block_activity" - WHERE time >= $from and time <= $to + WHERE time > $from and time <= $to `; export const TOKENS_HELD_BY_OUTPUTS_DAILY_QUERY = { From 48cb91930e9f0cd7dd23176f6615a036adf1d5ee Mon Sep 17 00:00:00 2001 From: Branko Bosnic Date: Fri, 26 Apr 2024 11:39:43 +0200 Subject: [PATCH 4/5] fix: add copy button to commit id --- client/src/app/routes/nova/SlotPage.tsx | 2 +- client/src/app/routes/nova/TransactionPage.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/app/routes/nova/SlotPage.tsx b/client/src/app/routes/nova/SlotPage.tsx index c41a844cd..baef56e8b 100644 --- a/client/src/app/routes/nova/SlotPage.tsx +++ b/client/src/app/routes/nova/SlotPage.tsx @@ -89,7 +89,7 @@ export default function SlotPage({
Commitment Id
- +
diff --git a/client/src/app/routes/nova/TransactionPage.tsx b/client/src/app/routes/nova/TransactionPage.tsx index ea742eb53..df6412059 100644 --- a/client/src/app/routes/nova/TransactionPage.tsx +++ b/client/src/app/routes/nova/TransactionPage.tsx @@ -125,7 +125,7 @@ const TransactionPage: React.FC> = ({
Slot Commitment
- +
{issuerAddress && ( From 2135460fd2fd8ae516da27a9c97f998c53149f4a Mon Sep 17 00:00:00 2001 From: Branko Bosnic Date: Fri, 26 Apr 2024 15:32:27 +0200 Subject: [PATCH 5/5] fix: update block stats query --- api/src/services/nova/influx/influxQueries.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/services/nova/influx/influxQueries.ts b/api/src/services/nova/influx/influxQueries.ts index 711bbf217..f245f5cef 100644 --- a/api/src/services/nova/influx/influxQueries.ts +++ b/api/src/services/nova/influx/influxQueries.ts @@ -93,7 +93,7 @@ export const BLOCK_STATS_QUERY = ` sum("candidacy_announcement_count") AS "candidacy", sum("validation_count") AS "noPayload" FROM "iota_block_activity" - WHERE time > $from and time <= $to + WHERE time >= $from and time < $to `; export const TOKENS_HELD_BY_OUTPUTS_DAILY_QUERY = {