From 5baf719778d6ce17447be8708fd320d1bd2a6c33 Mon Sep 17 00:00:00 2001 From: Sladuca Date: Fri, 1 Sep 2023 13:52:20 -0400 Subject: [PATCH] use RedisStreamId type instead of string --- actors/insertion-writer/src/utils.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/actors/insertion-writer/src/utils.ts b/actors/insertion-writer/src/utils.ts index eda7c991d9..510a59a75d 100644 --- a/actors/insertion-writer/src/utils.ts +++ b/actors/insertion-writer/src/utils.ts @@ -1,12 +1,13 @@ import { SubgraphUtils } from "@nocturne-xyz/core"; +import { RedisStreamId } from "@nocturne-xyz/persistent-log"; const { makeSubgraphQuery } = SubgraphUtils; -export function merkleIndexToRedisStreamId(merkleIndex: number): string { +export function merkleIndexToRedisStreamId(merkleIndex: number): RedisStreamId { return `${merkleIndex}-1`; } -export function merkleIndexFromRedisStreamId(id: string): number { +export function merkleIndexFromRedisStreamId(id: RedisStreamId): number { const components = id.split("-"); if (!components || components.length !== 2) { throw new Error("invalid id");