Repository navigation
feat: add keyless Robinhood public head read - #12
Merged
Merged
Conversation
Add a read-only public head example that validates the chain directory and public endpoint before two serial JSON-RPC calls. Cover exact endpoint and method checks, credential-free headers, bounded streamed bodies, explicit QA user agent, CLI output, and offline mocked tests.
Race fetch, body reads, and cleanup against the same request signal so injected streams and hanging cancels cannot block rejection or retain the reader. Cancel non-2xx and redirected bodies without reading them, and add bounded offline regressions for pending work and cleanup.
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.
Owner: market Leader 01a133d7-789f-7241-af41-185e49fc0fed
概要
新增明确无凭据、只读的 Robinhood 首次使用示例,保持既有开户、钱包、鉴权、余额与主流程不变。
验收项: keyless-first-read
变更内容
src/public-read.ts:校验链目录及robinhood_mainnet公开端点后,串行调用eth_chainId与eth_blockNumber,返回精确的十进制区块号字符串。src/public-read-cli.ts与npm run read:public:成功输出结果 JSON;失败输出固定且不含上游内容的错误,退出码为 1。tests/public-read.test.ts:使用注入的 fetch mock 覆盖目录拒绝、错误链、HTTP 错误、非法 JSON、重试错误、128 KiB 流式上限、超安全整数高度、UA 开关及凭据隔离。边界与验证
npm run typecheck通过;独审 B1/B2 经原会话修复后 APPROVE;npm test通过,134 项、0 失败;39 项 public-read 聚焦用例。