Skip to content

refactor(simulator)!: use midnight-js live options - #196

Draft
0xisk wants to merge 2 commits into
mainfrom
refactor/simulator-live-context-types
Draft

0xisk wants to merge 2 commits into
mainfrom
refactor/simulator-live-context-types

Conversation

@0xisk

@0xisk 0xisk commented Sep 25, 2026

Copy link
Copy Markdown
Member

Depends on #195, merge after.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

createLiveContext options become midnight-js's own types, so new midnight-js options need no simulator change. Breaking, so this ships as simulator 0.5.0.

compact-contracts must bump in lockstep: one call site in contracts/test-utils/harness/LiveSimulatorBackend.ts, plus one objectContaining assertion in its harness unit test. The harness isn't type-checked there, so a missed bump fails at the first live call, not at compile time.

FoundContract<C> is erased to DeployedTxHandle with one cast: its typed callTx overloads aren't assignable to the structural handle, which this PR leaves as is.

PR Checklist

  • I have read the Contributing Guide
  • I have added tests that prove my fix is effective or that my feature works
  • I have added documentation of new methods and any new behavior or changes to existing behavior
  • CI Workflows Are Passing

@coderabbitai

coderabbitai Bot commented Sep 25, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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

0xisk added a commit that referenced this pull request Sep 25, 2026
@0xisk
0xisk added this pull request to stack #197 September 25, 2026 07:15
Base automatically changed from feat/simulator-live-enc-key-mappings to main September 25, 2026 07:53
createLiveContext takes FindDeployedContractOptionsExistingPrivateState
and ContractProviders<C> instead of hand-rolled fields, so the contract
type is inferred and new midnight-js options need no simulator change.
The default signer's providers now serve the public-data and
private-state reads.

BREAKING CHANGE: createLiveContext options move to findOptions and
providersFor; contractAddress, compiledContract, privateStateId,
publicDataProvider and privateStateProvider are removed.
@0xisk
0xisk force-pushed the refactor/simulator-live-context-types branch from a5e11cd to 487509c Compare September 25, 2026 07:53

This branch has not been deployed

No deployments
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.

1 participant