Skip to content

Add contractName and eventName to event types and improve TypeScript event definitions - #1071

Merged
DZakh merged 7 commits into
mainfrom
claude/export-evmevent-type-9QCpA
Apr 2, 2026
Merged

Add contractName and eventName to event types and improve TypeScript event definitions#1071
DZakh merged 7 commits into
mainfrom
claude/export-evmevent-type-9QCpA

Conversation

@DZakh

@DZakh DZakh commented Mar 31, 2026

Copy link
Copy Markdown
Member

Summary

This PR enhances event type definitions by adding contractName and eventName fields to all event types, and significantly improves TypeScript type generation for EVM and Fuel contract events with full field selection support.

Key Changes

  • Added contractName and eventName fields: Updated the genericEvent type in ReScript and TypeScript to include contractName and eventName fields, making event metadata more accessible to indexers.

  • Enhanced TypeScript event type generation: Replaced simple event name unions with full discriminated union types that include:

    • Event parameters with proper TypeScript types
    • Block and transaction fields with field selection awareness
    • Deprecated markers for unselected fields with guidance to enable them via config
    • Proper JSDoc comments for all fields
  • Improved field selection handling:

    • Added ts_type field to EventParamTypeTemplate and SelectedFieldTemplate for accurate TypeScript type generation
    • Added ts_transaction_type and ts_block_type to FieldSelection struct
    • Implemented generate_contract_event_ts_type() method to generate complete event types with field selection awareness
  • Updated event type structure: Modified EvmContracts and FuelContracts types from { events: string } to nested objects with full event type definitions.

  • Code formatting improvements:

    • Simplified ReScript regex literals (removed %re() wrapper)
    • Improved code formatting in RpcSource.res for better readability
    • Fixed indentation and line breaks in field registry definitions
  • Added TypeScript helper types: Introduced EvmEvent<> and FuelEvent<> generic types in Types.ts.hbs for convenient event type lookups by contract and event name.

  • Updated test snapshots: Regenerated snapshots to reflect the new event type structure with full field definitions.

Implementation Details

The TypeScript event type generation now:

  • Marks unselected block/transaction fields as never type with @deprecated JSDoc comments
  • Includes field descriptions for all selected fields
  • Properly handles different event kinds (EVM params, Fuel Mint/Burn/Transfer/Call/LogData)
  • Maintains consistency between ReScript and TypeScript type definitions

https://claude.ai/code/session_015qQJTt3EmYtGa7jZKcLBGH

Summary by CodeRabbit

  • New Features

    • Generated event types now include contractName and eventName; event argument alias renamed to params.
    • Added EvmEvent and FuelEvent lookup types and per-event TypeScript shapes; unselected fields typed as never with deprecation guidance.
    • Enhanced emitted typings for full EVM field-selection support.
  • Configuration Changes

    • Contract config now nests events under each contract for precise event typing and simulation.
  • Tests

    • Updated type-level tests and snapshots to match renamed params and new typings.
  • Chores

    • Pinned Rescript formatting command in tooling settings.

@coderabbitai

coderabbitai Bot commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds per-event metadata (contractName, eventName) to generic/internal events, renames generated event arguments from eventArgs to params, threads TypeScript typing generation into CLI codegen to emit per-contract-per-event shapes, changes indexer config contracts to nested contract→event maps, and updates sources, simulation, tests, and templates accordingly.

Changes

Cohort / File(s) Summary
Codegen templates & TS helpers
packages/cli/src/hbs_templating/codegen_templates.rs, packages/cli/templates/dynamic/codegen/src/Types.ts.hbs
Add ts_type plumbing for field TS typings; rename generated eventArgsparams; add TS helpers (generate_contract_event_ts_type, to_envio_dts_type) and export EvmEvent/FuelEvent lookup types.
Generated .d.ts & TS outputs
packages/cli/.../envio.d.ts (generated), packages/cli/templates/dynamic/...
Emit per-contract-per-event TS object shapes including contractName/eventName/params; add import type lines for BigDecimal/Address; map certain internal list types to unknown for .d.ts.
Envio public types & Internal types
packages/envio/index.d.ts, packages/envio/src/Internal.gen.ts, packages/envio/src/Internal.res
Change IndexerConfigTypes.*.contracts to nested Record<string, Record<string, { eventName: string }>>; extend genericEvent<...> / Internal.Event with readonly contractName: string and readonly eventName: string.
Event construction in sources & simulate items
packages/envio/src/SimulateItems.res, packages/envio/src/sources/HyperFuelSource.res, packages/envio/src/sources/HyperSyncSource.res, packages/envio/src/sources/RpcSource.res
When constructing generic/internal events, populate contractName and eventName from eventConfig; RpcSource also replaces some regex literal forms and reformats record literals (no semantic change).
Tests, mocks & scenario handlers
scenarios/test_codegen/**, scenarios/test_codegen/test/__mocks__/MockEvents.res, scenarios/test_codegen/test/EventHandler.test.ts, scenarios/test_codegen/test/CustomSelection.test.ts
Update generated-type usage to params and to EvmEvent/FuelEvent lookups; adjust compile-time assertions and snapshots to reflect params, contractName, eventName, and updated block/transaction selection never typings.
CLI config parsing / FieldSelection helpers
packages/cli/src/config_parsing/human_config.rs, packages/cli/src/config_parsing/system_config.rs
Add strum::EnumIter derives to EVM field enums and introduce FieldSelection::all_evm() helper to produce full EVM field selections for typing generation.
Mocks & helpers (scenarios)
scenarios/helpers/src/ChainMocking.res, scenarios/test_codegen/test/helpers/Mock.res, scenarios/test_codegen/test/__mocks__/MockEvents.res
Mocks now include explicit contractName and eventName in constructed event payloads and updated type parameters to use .params.
Tooling config
.claude/settings.json
Change rescript formatter command to pnpx rescript@11.1.3 format "$f" (tooling string update only).

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Source
    participant Internal
    participant Codegen
    participant Handler

    Client->>Source: emit raw event/log
    Source->>Internal: construct generic event
    Note over Internal: generic event includes\nparams, chainId, block, transaction,\nsrcAddress, logIndex, contractName, eventName
    Internal->>Codegen: resolve typed event shape via EvmEvent/FuelEvent/envio.d.ts
    Codegen-->>Handler: provide typed event (contractName, eventName, params, block, transaction)
    Handler->>Handler: handler logic uses typed fields
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • JonoPrest
  • JasoonS

Poem

🐰 I stitched names into each event’s song,
contract and event now hop along,
params tucked neat in every frame,
types hop in, no field the same,
rabbit cheers — the typings sang!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and clearly summarizes the main changes: adding contractName and eventName fields to event types and improving TypeScript event definitions, which aligns with the primary objectives of enhancing event metadata and type generation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/export-evmevent-type-9QCpA

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/cli/src/hbs_templating/codegen_templates.rs`:
- Around line 1378-1386: The FuelEventKind::Call arm currently returns "{}"
which drops the to/assetId/amount fields; update the match arm for
system_config::EventKind::Fuel(system_config::FuelEventKind::Call) to return the
same TypeScript shape as the Transfer arm ("{ readonly to: `0x${string}`;
readonly assetId: string; readonly amount: bigint }") so Fuel Call params are
emitted with to, assetId and amount consistent with how HyperFuelSource and
from_fuel_transfer_event expect them.
- Around line 1416-1445: The membership checks use f.name.snake but
selected_block_names/selected_tx_names contain camelCase keys (e.g. parentHash),
so fields explicitly enabled get treated as unselected; update the checks in the
block and transaction field mappings to compare against the camelCase name (use
f.name.camel) or normalize both sides (e.g. to_lowercase) so the if branches for
selected_block_names.contains(...) and selected_tx_names.contains(...) match the
actual keys and emit the non-deprecated types instead of never for enabled
fields.

In `@packages/cli/templates/dynamic/codegen/src/Types.ts.hbs`:
- Around line 42-63: The generics default for TEventName collapses to the
intersection of keys instead of the union because keyof over a union yields
common keys; fix both EvmEvent and FuelEvent by making the TEventName default
distributive so it computes the union per contract — replace the current default
TEventName extends keyof EvmContracts[TContractName] = keyof
EvmContracts[TContractName] with a distributive form like TEventName extends
keyof EvmContracts[TContractName] = TContractName extends any ? keyof
EvmContracts[TContractName] : never (and do the analogous change for FuelEvent
using FuelContracts) so the no-argument form returns the union/discriminated
union as documented.

In `@packages/envio/src/sources/RpcSource.res`:
- Around line 69-105: The regex literals in RpcSource.res (variables like
suggestedRangeRegExp, blockRangeLimitRegExp, alchemyRangeRegExp,
cloudflareRangeRegExp, thirdwebRangeRegExp, blockpiRangeRegExp, baseRangeRegExp,
maxAllowedBlocksRegExp, blastPaidRegExp, chainstackRegExp, coinbaseRegExp,
publicNodeRegExp, hyperliquidRegExp) use JavaScript /.../ syntax which breaks
ReScript; change each literal to the ReScript regex form %re(/.../) preserving
the same patterns so the file compiles (i.e., replace each /pattern/ with
%re(/pattern/) for all the listed RegExp variables).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 81c3a7a8-7b54-4ae3-94f3-d5ea2fefd9c7

📥 Commits

Reviewing files that changed from the base of the PR and between d6e75bc and a903831.

⛔ Files ignored due to path filters (5)
  • packages/cli/src/hbs_templating/snapshots/envio__hbs_templating__codegen_templates__test__envio_dts_code_generated_for_evm.snap is excluded by !**/*.snap
  • packages/cli/src/hbs_templating/snapshots/envio__hbs_templating__codegen_templates__test__envio_dts_code_generated_for_fuel.snap is excluded by !**/*.snap
  • packages/cli/src/hbs_templating/snapshots/envio__hbs_templating__codegen_templates__test__indexer_code_generates_correct_types_and_values.snap is excluded by !**/*.snap
  • packages/cli/src/hbs_templating/snapshots/envio__hbs_templating__codegen_templates__test__indexer_code_multiple_chains.snap is excluded by !**/*.snap
  • scenarios/test_codegen/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (9)
  • packages/cli/src/hbs_templating/codegen_templates.rs
  • packages/cli/templates/dynamic/codegen/src/Types.ts.hbs
  • packages/envio/index.d.ts
  • packages/envio/src/Internal.gen.ts
  • packages/envio/src/Internal.res
  • packages/envio/src/SimulateItems.res
  • packages/envio/src/sources/HyperFuelSource.res
  • packages/envio/src/sources/HyperSyncSource.res
  • packages/envio/src/sources/RpcSource.res

Comment thread packages/cli/src/hbs_templating/codegen_templates.rs Outdated
Comment thread packages/cli/src/hbs_templating/codegen_templates.rs Outdated
Comment thread packages/cli/src/hbs_templating/codegen_templates.rs Outdated
Comment thread packages/cli/templates/dynamic/codegen/src/Types.ts.hbs Outdated
Comment thread packages/envio/src/sources/RpcSource.res Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
packages/cli/src/hbs_templating/codegen_templates.rs (1)

1382-1394: ⚠️ Potential issue | 🟠 Major

Fuel Call params are still generated as {}.

Per the previous review, the runtime treats Call like Transfer with to, assetId, and amount fields (see from_fuel_transfer_event at lines 1002-1004 which handles both Call and Transfer). The TypeScript type generation should match:

🔧 Suggested fix
             system_config::EventKind::Fuel(system_config::FuelEventKind::Transfer) => {
                 "{ readonly to: `0x${string}`; readonly assetId: string; readonly amount: bigint }"
                     .to_string()
             }
-            system_config::EventKind::Fuel(system_config::FuelEventKind::Call) => "{}".to_string(),
+            system_config::EventKind::Fuel(system_config::FuelEventKind::Call) => {
+                "{ readonly to: `0x${string}`; readonly assetId: string; readonly amount: bigint }"
+                    .to_string()
+            }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/cli/src/hbs_templating/codegen_templates.rs` around lines 1382 -
1394, The TypeScript type for Fuel::Call is incorrectly generated as "{}" while
the runtime treats Call like Transfer; update the match arm in
codegen_templates.rs for
system_config::EventKind::Fuel(system_config::FuelEventKind::Call) to return the
same TS shape as the Transfer arm ("{ readonly to: `0x${string}`; readonly
assetId: string; readonly amount: bigint }".to_string()), so the generated type
matches the runtime logic used by from_fuel_transfer_event.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@packages/cli/src/hbs_templating/codegen_templates.rs`:
- Around line 1382-1394: The TypeScript type for Fuel::Call is incorrectly
generated as "{}" while the runtime treats Call like Transfer; update the match
arm in codegen_templates.rs for
system_config::EventKind::Fuel(system_config::FuelEventKind::Call) to return the
same TS shape as the Transfer arm ("{ readonly to: `0x${string}`; readonly
assetId: string; readonly amount: bigint }".to_string()), so the generated type
matches the runtime logic used by from_fuel_transfer_event.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 866a8c29-c73f-452d-a8d6-7fae8dbd01ab

📥 Commits

Reviewing files that changed from the base of the PR and between 3d7c368 and 4bdfa21.

⛔ Files ignored due to path filters (2)
  • packages/cli/src/hbs_templating/snapshots/envio__hbs_templating__codegen_templates__test__envio_dts_code_generated_for_evm.snap is excluded by !**/*.snap
  • packages/cli/src/hbs_templating/snapshots/envio__hbs_templating__codegen_templates__test__envio_dts_code_generated_for_fuel.snap is excluded by !**/*.snap
📒 Files selected for processing (2)
  • packages/cli/src/hbs_templating/codegen_templates.rs
  • packages/cli/templates/dynamic/codegen/src/Types.ts.hbs
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/cli/templates/dynamic/codegen/src/Types.ts.hbs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
packages/cli/src/hbs_templating/codegen_templates.rs (1)

1396-1396: ⚠️ Potential issue | 🟠 Major

Fuel Call params are still generated as {}.

The FuelEventKind::Call arm generates an empty object "{}" for params, but the ReScript codegen (lines 1002-1004) uses from_fuel_transfer_event for both Call and Transfer, meaning they share the same params shape at runtime (to, assetId, amount).

This creates a type mismatch between the generated TypeScript declaration and actual runtime values.

🔧 Suggested fix
             system_config::EventKind::Fuel(system_config::FuelEventKind::Transfer) => {
                 "{ readonly to: `0x${string}`; readonly assetId: string; readonly amount: bigint }"
                     .to_string()
             }
-            system_config::EventKind::Fuel(system_config::FuelEventKind::Call) => "{}".to_string(),
+            system_config::EventKind::Fuel(system_config::FuelEventKind::Call) => {
+                "{ readonly to: `0x${string}`; readonly assetId: string; readonly amount: bigint }"
+                    .to_string()
+            }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/cli/src/hbs_templating/codegen_templates.rs` at line 1396, The
FuelEventKind::Call arm in the match for system_config::EventKind::Fuel
currently returns an empty params string ("{}"), causing a TypeScript mismatch;
modify the FuelEventKind::Call arm in codegen_templates.rs so it generates the
same params shape as FuelEventKind::Transfer (i.e., include "to", "assetId",
"amount") so it matches the runtime helper from_fuel_transfer_event used by
ReScript; update the arm that references FuelEventKind::Call to produce the same
object fields as the Transfer arm to keep declarations consistent with runtime
values.
🧹 Nitpick comments (1)
packages/cli/src/config_parsing/system_config.rs (1)

1754-1759: Type mapping inconsistency for AccessList and AuthorizationList.

These fields use TypeIdent::Unknown here, but try_from_config_field_selection (lines 1904-1911) maps them to TypeApplication with specific HyperSyncClient types:

// In try_from_config_field_selection:
Tx::AccessList => Res::option(Res::Array(Box::new(Res::TypeApplication {
    name: "HyperSyncClient.ResponseTypes.accessList".to_string(),
    type_params: vec![],
}))),

If all_evm() is used for TypeScript type generation, this could result in unknown[] instead of the proper type. Consider whether these should match, or if Unknown is intentional for the "all fields" case.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/cli/src/config_parsing/system_config.rs` around lines 1754 - 1759,
The TypeIdent mapping for TransactionField::AccessList and ::AuthorizationList
currently returns TypeIdent::option(TypeIdent::array(TypeIdent::Unknown)), which
conflicts with try_from_config_field_selection's Res::TypeApplication mapping
(e.g. "HyperSyncClient.ResponseTypes.accessList"); update the constructors in
the match arm to return
TypeIdent::option(TypeIdent::array(TypeIdent::TypeApplication { name:
"HyperSyncClient.ResponseTypes.accessList".to_string(), type_params: vec![] }))
and similarly for authorizationList (matching the names used in
try_from_config_field_selection), so TypeScript generation for all_evm() yields
the same concrete types rather than unknown[]; if Unknown was intentionally used
for an "all fields" fallback, add a comment clarifying that intent instead of
changing behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@packages/cli/src/hbs_templating/codegen_templates.rs`:
- Line 1396: The FuelEventKind::Call arm in the match for
system_config::EventKind::Fuel currently returns an empty params string ("{}"),
causing a TypeScript mismatch; modify the FuelEventKind::Call arm in
codegen_templates.rs so it generates the same params shape as
FuelEventKind::Transfer (i.e., include "to", "assetId", "amount") so it matches
the runtime helper from_fuel_transfer_event used by ReScript; update the arm
that references FuelEventKind::Call to produce the same object fields as the
Transfer arm to keep declarations consistent with runtime values.

---

Nitpick comments:
In `@packages/cli/src/config_parsing/system_config.rs`:
- Around line 1754-1759: The TypeIdent mapping for TransactionField::AccessList
and ::AuthorizationList currently returns
TypeIdent::option(TypeIdent::array(TypeIdent::Unknown)), which conflicts with
try_from_config_field_selection's Res::TypeApplication mapping (e.g.
"HyperSyncClient.ResponseTypes.accessList"); update the constructors in the
match arm to return
TypeIdent::option(TypeIdent::array(TypeIdent::TypeApplication { name:
"HyperSyncClient.ResponseTypes.accessList".to_string(), type_params: vec![] }))
and similarly for authorizationList (matching the names used in
try_from_config_field_selection), so TypeScript generation for all_evm() yields
the same concrete types rather than unknown[]; if Unknown was intentionally used
for an "all fields" fallback, add a comment clarifying that intent instead of
changing behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f089e2bc-6195-469b-9b2b-9c94bc423341

📥 Commits

Reviewing files that changed from the base of the PR and between 4bdfa21 and afa62f5.

⛔ Files ignored due to path filters (2)
  • packages/cli/src/hbs_templating/snapshots/envio__hbs_templating__codegen_templates__test__envio_dts_code_generated_for_evm.snap is excluded by !**/*.snap
  • packages/cli/src/hbs_templating/snapshots/envio__hbs_templating__codegen_templates__test__envio_dts_code_generated_for_fuel.snap is excluded by !**/*.snap
📒 Files selected for processing (8)
  • .claude/settings.json
  • packages/cli/src/config_parsing/human_config.rs
  • packages/cli/src/config_parsing/system_config.rs
  • packages/cli/src/hbs_templating/codegen_templates.rs
  • packages/cli/templates/dynamic/codegen/src/Types.ts.hbs
  • packages/envio/src/sources/RpcSource.res
  • scenarios/test_codegen/src/handlers/EventHandlers.ts
  • scenarios/test_codegen/test/CustomSelection.test.ts
💤 Files with no reviewable changes (1)
  • scenarios/test_codegen/src/handlers/EventHandlers.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/cli/templates/dynamic/codegen/src/Types.ts.hbs

@DZakh
DZakh force-pushed the claude/export-evmevent-type-9QCpA branch 10 times, most recently from 56dd9e3 to b4f1569 Compare April 2, 2026 09:41
claude added 7 commits April 2, 2026 12:31
- Add contractName and eventName fields to genericEvent for runtime discrimination
- Modify EvmContracts/FuelContracts to contain full event types with literal
  discriminant fields, typed params, block/transaction fields
- Generate ALL available block/transaction fields per event (selected with
  proper types, unselected as never with @deprecated YAML config example
  including event signature)
- Generate FuelTypes interface for Fuel ABI type references
- Define EvmEvent<TContractName, TEventName> and FuelEvent types
- Remove @Gentype from event/params/block/transaction (exposed via envio.d.ts)
- Rename eventArgs to params in generated ReScript
- Import Address from envio, BigDecimal from bignumber.js in envio.d.ts
- Fix Fuel Call params to match Transfer (to, assetId, amount)
- Fix Fuel block fields to not include EVM defaults
- Add TypeScript and ReScript tests for event handler field access

https://claude.ai/code/session_015qQJTt3EmYtGa7jZKcLBGH
…es, remove eventLog

- Fix 4-space indentation for deprecated fields inside module type definitions
- Match ReScript @deprecated message to TypeScript format with YAML config example
- Pass all_ecosystem_fields to per-event custom field selection for deprecated markers
- Remove eventLog type alias, inline Internal.genericEvent in HandlerTypes

https://claude.ai/code/session_015qQJTt3EmYtGa7jZKcLBGH
Replace Indexer.eventLog<T> with per-event types (e.g. Indexer.Gravatar.NewGravatar.event)
in MockEvents.res and Internal.genericEvent in test files that need the generic form.
Remove unused eventLog import from EventHandlers.ts.

https://claude.ai/code/session_015qQJTt3EmYtGa7jZKcLBGH
…types

The per-event `event` type is nominally different from Internal.genericEvent,
which causes type errors when passed to Internal.fromGenericEvent.

https://claude.ai/code/session_015qQJTt3EmYtGa7jZKcLBGH
The generated test files require worker threads that time out in the
template-tests CI environment which has no database services.

https://claude.ai/code/session_015qQJTt3EmYtGa7jZKcLBGH
@DZakh
DZakh force-pushed the claude/export-evmevent-type-9QCpA branch from d916caf to c21a93a Compare April 2, 2026 12:32
@DZakh
DZakh merged commit f583c3a into main Apr 2, 2026
8 checks passed
@DZakh
DZakh deleted the claude/export-evmevent-type-9QCpA branch April 2, 2026 12:41
DZakh pushed a commit that referenced this pull request Apr 14, 2026
Typo was pre-existing in the template (from #1071) but my previous
commit moved the string, so address the CodeRabbit review comment
while it is still topical.

https://claude.ai/code/session_01YCbJaSa8Vpi5tSgU8WRWcS
DZakh added a commit that referenced this pull request Apr 14, 2026
* Drop -3 from remaining warnings; migrate deprecated bindings

Continues the Js.* → ReScript stdlib migration from #1103 for the
places where the -3 warning suppression was still left:

- scenarios/test_codegen and scenarios/fuel_test: ran rescript-tools
  migrate-all, plus manual fixes for Array.sort (now returns unit —
  switched to Array.toSorted) with Int.compare comparators, and
  string_of_int/float_of_int → Int.toString/Int.toFloat.

- packages/cli/templates/static/{codegen,blank_template}/rescript.json:
  dropped "warnings": -3. Templates regenerate indexer code, so also
  updated the Rust codegen:
    - type_schema.rs: Js.Json.t → JSON.t, Js.Date.t → Date.t,
      Js.Date.fromFloat → Date.fromTime.
    - codegen_templates.rs: SingleOrMultiple now uses Array.isArray
      instead of Js.Json.decodeArray, with JSON.t aliases.
    - Regenerated insta snapshots.

https://claude.ai/code/session_01YCbJaSa8Vpi5tSgU8WRWcS

* Fix chainId sort ordering after migrate to Int.compare

The migration from Array.sort with subtraction to Array.toSorted with
Int.compare changed the runtime behaviour: the old a - b on Obj.magic
strings relied on JS numeric coercion, so "137" - "1337" = -1200 sorted
numerically. Int.compare uses the < primitive which compares strings
lexicographically, so "1337" < "137" and the metric rows came out in
the wrong order, breaking the multichain rollback test.

Parse the chainId/value strings with Int.fromString before comparing so
the sort keeps its original numeric semantics.

https://claude.ai/code/session_01YCbJaSa8Vpi5tSgU8WRWcS

* Fix typo: interperated → interpreted in SingleOrMultiple error

Typo was pre-existing in the template (from #1071) but my previous
commit moved the string, so address the CodeRabbit review comment
while it is still topical.

https://claude.ai/code/session_01YCbJaSa8Vpi5tSgU8WRWcS

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants