TS: Query for DepositRevealed events#457
Merged
Merged
Conversation
The Event type will be extended by specific events definition to include common properties that exist on each chain event.
A common function to query events from contract.
This was referenced Jan 4, 2023
Merged
We agreed in #457 (comment) that this name is better for our usecase.
The generic interface for Bridge contracts should define getDepositRevealedEvents function. We added a generic GetEventsFunction that should be used by other events getting functions.
The TransactionHash type expects to hold a hash in the same order as block explorers (RPC order). But the Bridge contract expects a hash in the format that is used by bitcoin natively (internal byte order). The event emitts the hash in the internal byte order, so we need to reverse it.
The function is required by the interface.
The chain interface expects hexadecimal values to be stores as un-prefixed strings. The Ethereum handles such values with `0x` prefix by default. We need to convert the values to conform with the interface. TODO: To make dveloment easier and prevent from unexpected runtime errors we need to handle the properties with Hex type.
lukasz-zimnoch
approved these changes
Jan 23, 2023
nkuba
added a commit
that referenced
this pull request
Jan 23, 2023
…equestedEvents This change is made based on the agreements from #457
lukasz-zimnoch
added a commit
that referenced
this pull request
Jan 24, 2023
mswilkison
added a commit
that referenced
this pull request
May 26, 2026
Codex review on PR #457 caught two P1s that I'm addressing here in PR #971: P1 #1: workflows in .github/workflows/ are monorepo-coupled, won't run in canonical - ci-formal-verification.yml + nightly-formal-invariants.yml both use: - `pnpm install --frozen-lockfile` (canonical has no pnpm-lock.yaml, isn't a pnpm workspace) - `pnpm --filter @keep-network/tbtc-v2 run test:formal-invariants` (canonical isn't a pnpm workspace) - `npm run formal:vectors:check` (canonical root package.json has no such script) - Manifest update PR #457 reclassifies these from allowlisted-divergence to excluded. Canonical tbtc-v2 already has its own CI matrix (contracts.yml, etc.). If formal-verification CI belongs in canonical, it can be added as canonical-native workflows in a follow-up — not ports of monorepo-coupled YAML. P1 #2: P2TR script rootDir mis-resolves under solidity/ - Scripts use `path.resolve(scriptDir, "../..")` to compute rootDir - Under canonical layout (scripts at solidity/scripts/formal/), that resolves to `solidity/`, not canonical repo root - Vector path `docs/test-vectors/p2tr-signature-fraud-v0.json` then joins to `solidity/docs/test-vectors/...` which doesn't exist (vectors live at canonical root's docs/test-vectors/) - Fix: change rootDir to `path.resolve(scriptDir, "../../..")` so it escapes solidity/ and resolves to canonical root. Contract path references (already prefixed solidity/contracts/...) and vector path (docs/test-vectors/...) both resolve correctly relative to canonical root. Net change to PR #971 - 2 files modified: rootDir fix in both retained P2TR scripts - 2 files deleted: ci-formal-verification.yml + nightly-formal-invariants.yml Source manifest PR #457 is being updated separately: - ci-formal-verification.yml + nightly-formal-invariants.yml reclassified from allowlisted-divergence to excluded - expectedTargetSha256 for the 2 fixed P2TR scripts recomputed against the new content Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
mswilkison
added a commit
that referenced
this pull request
May 26, 2026
Codex P1 re-review on PR #457 caught that the path-normalization commit b0b8841 (rootDir fix) left a stale issue: scripts still reference vectors under docs/rfc/frost-migration/ which is where my earlier blanket `docs/frost-migration/` → `docs/rfc/frost-migration/` sed rewrite put them. But the source manifest maps the actual vector files to docs/test-vectors/: - docs/frost-migration/test-vectors/p2tr-signature-fraud-v0.json → docs/test-vectors/p2tr-signature-fraud-v0.json - docs/frost-migration/p2tr-signature-fraud-spend-type-closure.json → docs/test-vectors/p2tr-signature-fraud-spend-type-closure.json So scripts looked for vectors at docs/rfc/frost-migration/test-vectors/ ... but vectors actually live at docs/test-vectors/... in canonical. Fix - check_p2tr_signature_fraud_vectors.mjs: vector path docs/rfc/frost-migration/test-vectors/p2tr-signature- fraud-v0.json → docs/test-vectors/p2tr-signature-fraud-v0.json - check_p2tr_spend_type_closure.mjs (3 references): - spend-type closure manifest: docs/rfc/frost-migration/p2tr-signature-fraud-spend-type-closure.json → docs/test-vectors/p2tr-signature-fraud-spend-type-closure.json - vector path (2 occurrences): docs/rfc/frost-migration/test-vectors/p2tr-signature-fraud-v0.json → docs/test-vectors/p2tr-signature-fraud-v0.json References to docs/rfc/frost-migration/p2tr-signature-fraud-execution-spec.md remain (the execution spec IS a doc that lives at docs/rfc/ frost-migration/ in canonical, per the manifest classifier — this reference is correct). PR #457 (manifest update) will be updated with the new expectedTargetSha256 values: - check_p2tr_signature_fraud_vectors.mjs: 3c21279e43... → 5b88c84d174c9ddcd27eb3350cb6c5755c4c29db21252bf70fc27693d17fe186 - check_p2tr_spend_type_closure.mjs: 64e41cc057... → 116d16ebdea93f466a6f0c7b7d34448e5c6440a42254f53b959ceb9affa339e9 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In this PR we add a function to query for
DepositRevealedevents emitted by theBridgecontract.Depends on #454