Skip to content

Commit

Permalink
fix(store-indexer): transform env var to undefined (#2741)
Browse files Browse the repository at this point in the history
  • Loading branch information
alvrs authored Apr 25, 2024
1 parent 43cde88 commit 65aa32c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/eighty-actors-live.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@latticexyz/store-indexer": patch
---

Added support for passing in an empty `STORE_ADDRESS=` environment variable.
6 changes: 5 additions & 1 deletion packages/store-indexer/bin/parseEnv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ export const indexerEnvSchema = z.intersection(
START_BLOCK: z.coerce.bigint().nonnegative().default(0n),
MAX_BLOCK_RANGE: z.coerce.bigint().positive().default(1000n),
POLLING_INTERVAL: z.coerce.number().positive().default(1000),
STORE_ADDRESS: z.string().refine(isHex).optional(),
STORE_ADDRESS: z
.string()
.transform((input) => (input === "" ? undefined : input))
.refine(isHex)
.optional(),
}),
z.union([
z.object({
Expand Down

0 comments on commit 65aa32c

Please sign in to comment.