feat: support Cardano across both address eras - #9
Merged
Merged
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 9 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
2 issues found across 2 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/chains/cardano.ts">
<violation number="1" location="src/chains/cardano.ts:26">
P2: When the Byron payload is truncated, `isByronEnvelope` accepts an inner `0x83` header without any of its three items. `Cardano.assertAddress("5xb5UCMiej")` therefore accepts a malformed Base58 value; require the minimum complete payload and validate the inner items before classifying it as Byron.</violation>
</file>
<file name="test/unit/chains.test.ts">
<violation number="1" location="test/unit/chains.test.ts:469">
P3: The new JSDoc says one of the two added vectors tests a CRC width CBOR cannot encode, but neither vector reaches the CRC-width branch. Both decode to envelopes whose byte 5 is not 0x83 (0xaa and 0x00), so isByronEnvelope returns false at the array(3) opening check and the head/crcBytes branch is never exercised. Make the comment reflect that both vectors are rejected at the payload-array check, or craft an envelope with decoded[5]===0x83 and an invalid CRC width so the claimed branch is actually covered.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
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.
Adds
cardanoto the registry: coin type1815,cip34:1-764824073for CAIP-2, cardanoscan as the explorer, and a validator that takes all three shapes an ADA address actually comes in - Shelleyaddr1, stakestake1, and Byron base58. Every accepted vector in the tests is lifted straight from CIP-19, bounds included: the bech32 data part runs 53 to 98 characters because Cardano waives BIP-173's 90-char cap, so the limits come from the payload sizes instead. Key is the full name, not the ticker - that's the side #8 picked.The fun part is Byron. No CBOR parser needed - the envelope is rigid enough that four fixed bytes plus the length byte tying to the total settles it, and that's what keeps Solana keys and Base58Check addresses out. One honest gap: a Byron testnet address still passes, its network hides in an attribute a format check won't open. Shelley testnet prefixes are rejected the way Bitcoin's testnet versions are.