Fix preprod blockers: indexer v3 URLs, ledger parser for chain readers, circuit assets#57
Fix preprod blockers: indexer v3 URLs, ledger parser for chain readers, circuit assets#57
Conversation
Agent-Logs-Url: https://github.com/SpyCrypto/AutoDiscovery/sessions/45d911c9-f3a6-4c0c-82b1-d626cb3540ad Co-authored-by: SpyCrypto <226600115+SpyCrypto@users.noreply.github.com>
…s, circuit assets - Fix default indexer URL from /api/v1/ to /api/v3/ in contracts/index.ts - Fix frontend-demoland .env.realdeal: network=preprod, indexer v3, add VITE_INDEXER_WS - Update demoland discovery-core-reader.ts from mocked stubs to real ledger parser - Update frontend-realdeal getOnChainStepStatus and isAttestationOnChain to use ledger parser - Add public/contracts/ to .gitignore (generated circuit assets) - Run copy-contracts to copy circuit assets to public/ Agent-Logs-Url: https://github.com/SpyCrypto/AutoDiscovery/sessions/45d911c9-f3a6-4c0c-82b1-d626cb3540ad Co-authored-by: SpyCrypto <226600115+SpyCrypto@users.noreply.github.com>
Agent-Logs-Url: https://github.com/SpyCrypto/AutoDiscovery/sessions/45d911c9-f3a6-4c0c-82b1-d626cb3540ad Co-authored-by: SpyCrypto <226600115+SpyCrypto@users.noreply.github.com>
…t methods - Replace `new WalletFacade(...)` with `WalletFacade.init()` (v3 factory pattern) - Replace `wallet.balanceTransaction()` with `wallet.balanceUnprovenTransaction()` (v3 API) - Replace `dust.walletBalance()` with `dust.balance()` (v3 DustWalletState API) - Replace `wallet.finalizeTransaction(recipe)` with `wallet.finalizeRecipe(recipe)` (v3 recipe pattern) - Fix logFinalizedTxData to handle both FinalizedCallTxData (.public/.private) and FinalizedTxData shapes - Add ledger v6/v8 cross-version casts for ZswapSecretKeys and transaction types - Add console/globalThis to ESLint globals for CLI scripts - Prefix unused params with _ in deploy_preprod.ts buildProviders Agent-Logs-Url: https://github.com/SpyCrypto/AutoDiscovery/sessions/43822f45-bb4e-4a53-98d3-048d84b7bd0a Co-authored-by: SpyCrypto <226600115+SpyCrypto@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR addresses multiple preprod deployment/runtime blockers across the CLI and both frontends by updating indexer endpoints, adapting to Wallet SDK v3 APIs, and improving contract state parsing in browser chain readers.
Changes:
- Update default preprod indexer URLs to
/api/v3/graphql(and add WS where needed) plus refresh deploy instructions in env files. - Add/extend ledger-parser-based lookups in the discovery-core chain readers with heuristic fallbacks.
- Update autodiscovery-cli wallet integration to WalletFacade v3 APIs (init/balance/finalize/dust balance) and align linting/globals/unused param conventions.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| package-lock.json | Removes an outdated pino entry from a workspace devDependency block in the lockfile. |
| frontend-realdeal/src/providers/realdeal/chain/discovery-core-reader.ts | Uses ledger parser for step/attestation lookups with heuristic fallback. |
| frontend-realdeal/src/contracts/index.ts | Switches default preprod indexer URL from v1 to v3. |
| frontend-realdeal/.gitignore | Ignores generated contract circuit assets under public/contracts/. |
| frontend-realdeal/.env.realdeal | Updates deploy instructions to the preprod deploy script (with mnemonic). |
| frontend-demoland-vite-react/src/providers/realdeal/chain/discovery-core-reader.ts | Adds dynamic ledger parser import and implements case/step/attestation lookups with fallback. |
| frontend-demoland-vite-react/.env.realdeal | Moves config to preprod + v3 indexer URLs and adds WS endpoint. |
| autodiscovery-cli/src/deploy_preprod.ts | Prefixes unused parameters to satisfy linting conventions. |
| autodiscovery-cli/src/api.ts | Migrates wallet initialization/balancing/finalization/dust balance calls to Wallet SDK v3. |
| autodiscovery-cli/eslint.config.mjs | Adds console and globalThis to ESLint globals. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Prefer the compiled ledger parser when available | ||
| if (_ledgerParser) { | ||
| try { | ||
| const parsed = _ledgerParser(rawState) as { | ||
| completionAttestationHashes: { |
There was a problem hiding this comment.
Same issue as above: _ledgerParser(rawState) is being invoked with rawState as a string, but DiscoveryCore.ledger expects StateValue | ChargedState (autodiscovery-contract/src/managed/discovery-core/contract/index.d.ts:90). Convert the GraphQL data field into bytes and wrap as StateValue before calling the parser so the attestation check can use the typed map instead of always falling back.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Spy <mespycrypto@gmail.com>
…overy-core-reader.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Spy <mespycrypto@gmail.com>
|
@copilot resolve the merge conflicts in this pull request |
1 similar comment
|
@copilot resolve the merge conflicts in this pull request |
|
@copilot apply changes based on the comments in this thread |
wallet.balanceTransaction()doesn't exist in WalletFacade v3WalletFacadeconstructor is private in v3,dust.walletBalance()renamed tobalance(),finalizeTransactionneedsfinalizeRecipefor recipesinitWalletWithSeed(): replacenew WalletFacade(...)withWalletFacade.init()factorycreateWalletAndMidnightProvider(): replacebalanceTransaction()withbalanceUnprovenTransaction()using v3 API signatureregisterNightForDust():walletBalance()→balance(),finalizeTransaction()→finalizeRecipe()logFinalizedTxData()to handle v3 FinalizedTxData shape (no .public/.private wrapper)