You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test: Cardano Shelley pointer addresses, header/prefix mismatches and network-policy options are untested #3
Uncovered: cardano.ts 23, 26, 30–31, 41–44 (the pointer varint parser and the tag/HRP checks). There are also no tests for network: 'auto', allowTestnet: false, or the details returned on NETWORK_MISMATCH. tests/cardano_debug.test.ts is a single leftover debug case.
Proposed fix (PR to follow): added the CIP-19 pointer and enterprise vectors and 12 crafted rejection cases (non-minimal or unterminated varints, a cert index above 16 bits, trailing bytes, reserved header type, wrong HRP for the network tag, Bech32m). Added tests/network-policy.test.ts, merged the debug test into cardano.test.ts, and added Aptos format tests and Base58Check error-path tests.
Added CIP-19 pointer/enterprise vectors, 12 Shelley rejection cases and tests/network-policy.test.ts (commit f0962c9). The cardano_debug test is folded into cardano.test.ts.
I’d narrow this to the assertions we’re missing. tests/regressions.test.ts already runs all 20 CIP-19 vectors, including pointer addresses, and checks allowTestnet: false for Cardano. The differential suite also rejects malformed pointer fields and header/network prefix mismatches. Both suites passed on main.
The useful additions are a reserved network-tag rejection in Vitest and a public-result assertion that NETWORK_MISMATCH retains the decoded Cardano network and format. An explicit network: 'auto' case can sit beside those. Another copy of the positive vectors adds little.
Activity
Dhananjay-alt commentedon Nov 21, 2026
Fixed in #10.
Added CIP-19 pointer/enterprise vectors, 12 Shelley rejection cases and tests/network-policy.test.ts (commit f0962c9). The cardano_debug test is folded into cardano.test.ts.
Samarth208P commentedon Nov 21, 2026
I’d narrow this to the assertions we’re missing.
tests/regressions.test.tsalready runs all 20 CIP-19 vectors, including pointer addresses, and checksallowTestnet: falsefor Cardano. The differential suite also rejects malformed pointer fields and header/network prefix mismatches. Both suites passed onmain.The useful additions are a reserved network-tag rejection in Vitest and a public-result assertion that
NETWORK_MISMATCHretains the decoded Cardano network and format. An explicitnetwork: 'auto'case can sit beside those. Another copy of the positive vectors adds little.test: assert Cardano reserved network tags and mismatch details (Sama…