Conversation
Integrate pyth_price validator
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
price verification CLI
withdraw script handling, refactor
- Move lazer/contracts/cardano/sdk to lazer/contracts/cardano/cli - Fix all path references in pnpm-workspace.yaml, Cargo.toml, README.md - Create new user-facing SDK at lazer/contracts/cardano/sdk/js - Implement getWithdrawScriptHash(policyId, network, provider) function - SDK uses Evolution SDK internally without exposing it to users Co-Authored-By: Matej Nižník <matej@dourolabs.xyz>
| pnpm tsx scripts/manage_cardano_governance.ts -c "cardano_$CARDANO_NETWORK" \ | ||
| test-update-trusted-signer \ |
There was a problem hiding this comment.
🟡 README governance command builds an unsupported chain value for devnet
The documented workflow sets CARDANO_NETWORK="devnet" and then passes -c "cardano_$CARDANO_NETWORK", which expands to cardano_devnet. However, the governance CLI only accepts cardano_mainnet, cardano_preprod, and cardano_preview, so this command fails argument validation and users cannot follow the documented self-managed/devnet flow (contract_manager/scripts/manage_cardano_governance.ts:45-49).
Prompt for agents
Update lazer/contracts/cardano/README.md lines 52-53 and 75-76 (and the equivalent command blocks later in the file) so the documented `-c` value matches what `contract_manager/scripts/manage_cardano_governance.ts` actually accepts. Either (a) change the docs to use one of `cardano_mainnet|cardano_preprod|cardano_preview` for governance payload targeting, or (b) if devnet targeting is intended, add `cardano_devnet` support consistently in contract_manager/scripts/manage_cardano_governance.ts option choices and in governance/xc_admin/packages/xc_admin_common/src/chains.ts before keeping the current README command pattern.
Was this helpful? React with 👍 or 👎 to provide feedback.
|
I've moved contract management CLI to |
…atej/cardano-governance
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
| expect( | ||
| upgradeCardanoSpendScriptBuffer.equals( | ||
| Buffer.from([ | ||
| 80, 84, 71, 77, 3, 2, 234, 192, 52, 175, 120, 123, 102, 232, 177, 8, |
There was a problem hiding this comment.
🔴 Wrong chain ID in JS test expectations for all Cardano governance payloads
All three new Cardano-related test expectations in the GovernancePayload.test.ts use chain ID 60096 (bytes [234, 192] = 0xEAC0) instead of 60097 (bytes [234, 193] = 0xEAC1) for cardano_mainnet. The cardano_mainnet chain ID is defined as 60097 in governance/xc_admin/packages/xc_admin_common/src/chains.ts:130, so PythGovernanceHeader.encode() will produce 0xEAC1 for the chain field, but the tests assert against 0xEAC0. This affects the UpgradeCardanoSpendScript test (line 316), UpgradeCardanoWithdrawScript test (line 334), and UpdateTrustedSigner256Bit test (line 368). All three tests will fail because the actual encoded byte at the chain ID low-byte position will be 193, not 192.
Prompt for agents
In governance/xc_admin/packages/xc_admin_common/src/__tests__/GovernancePayload.test.ts, fix the chain ID byte in all three Cardano test expectations. The chain ID for cardano_mainnet is 60097 (0xEAC1), not 60096 (0xEAC0). In each Buffer.from([...]) assertion for the Cardano tests, change byte 192 to 193 in the chain ID position (the 8th byte, at index 7 in the array):
1. Line 316: Change 234, 192 to 234, 193
2. Line 334: Change 234, 192 to 234, 193
3. Line 368: Change 234, 192 to 234, 193
Was this helpful? React with 👍 or 👎 to provide feedback.
| let action = | ||
| parser.run( | ||
| governance_action(), | ||
| #"5054474d0302eac034af787b66e8b108a5d7dd7f912230166079d9f5b30b68cf020f25f2", |
There was a problem hiding this comment.
🔴 Wrong chain ID in Aiken test data causes test failures with env/default.ak chain_id
Both Aiken governance parser tests use hex data containing chain ID eac0 (60096), but env/default.ak:1 defines chain_id: Int = 60097 (0xEAC1). The governance_action() parser at lazer/contracts/cardano/lib/pyth/governance.ak:51 checks expect u16.as_int(chain) == env.chain_id, which will fail because 60096 ≠ 60097. This causes aiken check -D to fail in CI (.github/workflows/ci-lazer-cardano-contract.yml:24). Both can_parse_upgrade_spend_script (line 84) and can_parse_update_trusted_signer (line 95) are affected.
Prompt for agents
In lazer/contracts/cardano/lib/pyth/governance.ak, fix the chain ID bytes in both test hex strings. The chain ID for env/default.ak (cardano_mainnet) is 60097 = 0xEAC1, not 60096 = 0xEAC0.
1. Line 84: In the hex literal, change 'eac0' to 'eac1' so the full string becomes:
#"5054474d0302eac134af787b66e8b108a5d7dd7f912230166079d9f5b30b68cf020f25f2"
2. Line 95: In the hex literal, change 'eac0' to 'eac1' so the full string becomes:
#"5054474d0301eac174313a6525edf99936aa1477e94c72bc5cc617b21745f5f03296f3154461f2140000000000002a2a"
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
This is a big PR, merging Cardano work that was previously in a separate branch to
main. There's more to do when it comes to SDK and building transactions off-chain, but contract itself should be in a place where the design is set and implemented.How has this been tested?