Skip to content

fix: add wit_split_card_index to queryWitnesses (follow-up to #8) - #9

Merged
Yiakman merged 1 commit into
v2from
fix/query-witness-split-card
Jun 13, 2026
Merged

Yiakman merged 1 commit into
v2from
fix/query-witness-split-card

Conversation

@Yiakman

@Yiakman Yiakman commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #8.

#8 added wit_split_card_index to actionWitnesses, but the node constructs the Midnight contract in two places, each with its own witnesses object:

The compiled contract's constructor validates that every declared witness has an implementation, so initializeQueryContract (midnight-query.ts:122) was still throwing on the missing wit_split_card_index → the node kept crash-looping after #8.

Added as a throwing stub, matching the other queryWitnesses entries — the query contract only reads ledger state and never runs circuits, so it should never actually invoke this witness (and fails loudly if it somehow does).

Verified the crash trace points here:

CompactError: ... does not contain a function-valued field named wit_split_card_index
  at new Contract (.../managed/contract/index.js:168)
  at initializeQueryContract (.../midnight-query.ts:122)

After this merges I'll pull it on the box and confirm the node stays up.

🤖 Generated with Claude Code

Follow-up to #8. The node constructs the Midnight contract in two places —
actionWitnesses (midnight-actions.ts, fixed in #8) and queryWitnesses
(midnight-query.ts, missed). Both must declare every witness the compiled
contract requires, or `new Contract(...)` throws and the node crash-loops.

initializeQueryContract was still dying on the missing wit_split_card_index.
Added as a throwing stub matching the other query witnesses (the query
contract only reads ledger state, never runs circuits).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Yiakman
Yiakman merged commit f9a5208 into v2 Jun 13, 2026
@Yiakman
Yiakman deleted the fix/query-witness-split-card branch June 13, 2026 00:10
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