[new-plugin] test-rust-cli v1.0.0#6
Merged
Merged
Conversation
E2E test: Rust CLI querying ETH price via onchainos token price-info. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
🔍 Official Plugin ReviewPlugins reviewed: test-rust-cli Static Checks✅ All static checks passed AI ReviewAI review unavailable (HTTP 400) Auto-generated by Official Plugin Review workflow |
Contributor
🔨 Phase 2: Build Verification — ✅ PASSED
Build succeeded. Compiled artifact uploaded as workflow artifact. Source integrity: commit SHA `` is the content fingerprint. |
Contributor
Phase 4: Summary + Pre-flight for
|
mig-pre
added a commit
that referenced
this pull request
Apr 6, 2026
[new-plugin] test-rust-cli v1.0.0
skylavis-sky
added a commit
to skylavis-sky/plugin-store
that referenced
this pull request
Apr 16, 2026
… validation Balance pre-checks (all 8 write commands): - Added erc20_balance_of() to onchainos.rs — direct eth_call balanceOf, avoids SDK round-trip - Each command checks wallet balance against required amount before calling Pendle SDK - redeem-py checks both PT and YT balances independently - Guard skips during --dry-run (offline mode); active for preview and --confirm SDK calldata validation (api.rs): - validate_sdk_calldata() called inside extract_sdk_calldata() on every write path - Rejects calldata shorter than 4 bytes or containing non-hex characters - Rejects router_to addresses not in Pendle Router v3 / known aggregator whitelist - Rejects selectors matching ERC-20/ERC-721 drain operations (transfer, transferFrom, approve, setApprovalForAll, safeTransferFrom) Addresses Phase 3 AI Code Review recommendations #1 and okx#6. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
8 tasks
7 tasks
SamSee-314
pushed a commit
that referenced
this pull request
Apr 27, 2026
Bug fixes (all observed in 10h production log, onchainos 2.2.2, EOA mode, Polygon 137): #1 PATH: onchainos_bin() now tries ~/.local/bin/onchainos before bare "onchainos". Non-interactive shells (Claude Code Bash) never source ~/.zshrc so the binary was "os error 2" on every call. POLYMARKET_ONCHAINOS_BIN env var for test injection. #2 NegRisk redeem: removed hard-block ("not supported for neg_risk markets"). Plugin now calls NegRiskAdapter.redeemPositions(bytes32, uint256[]) after querying on-chain ERC-1155 balances via decimal_str_to_hex64 + get_ctf_balance. #3 Stale allowance: buy now uses get_usdc_allowance (direct eth_call) instead of get_balance_allowance (CLOB API). CLOB API returned stale/MAX_UINT values that caused redundant approval transactions on every trade. #4 MAX_UINT approval: approve_usdc now approves u128::MAX unconditionally instead of the specific order amount. Exact-amount approvals downgraded pre-existing MAX_UINT allowances to that amount, causing re-approval on every trade. #5 Partly resolved by #3: eliminating redundant approves removes ~95% of TEE sign-tx failures. Root TEE issue on genuine first-time approvals is upstream. #6 Timeout: approval wait raised 30s → 90s (POLYMARKET_APPROVE_TIMEOUT_SECS env var). Polygon at 5-10s/block + congestion routinely exceeded 30s. Tests (first suite — 16 tests, zero network calls): - decimal_str_to_hex64: zero, small values, u64::MAX, u128::MAX, invalid inputs - ABI encoding: build_negrisk_redeem_calldata length, offset, amounts, selector - CTF.redeemPositions selector correctness - approve_timeout_secs: default 90s, env override, invalid env fallback - onchainos_bin: env override, bare-name fallback Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
SamSee-314
pushed a commit
that referenced
this pull request
Apr 27, 2026
…s tests
Adds two integration test modules covering all 6 production bugs fixed in v0.4.11.
Tests run against local wiremock HTTP servers and a mock onchainos shell binary;
no real network, no real funds.
Test infrastructure:
- src/lib.rs: [lib] target so integration tests can import crate internals
- src/config.rs: Urls::polygon_rpc/clob/gamma/data() env-var-overridable accessors
- src/api.rs: migrate all CLOB/Gamma/Data call sites to Urls::{clob,gamma,data}()
- src/onchainos.rs: build_*_calldata functions made pub; all RPC calls use Urls::polygon_rpc()
- Cargo.toml: [lib] section; wiremock/tempfile dev-deps
- tests/common/mod.rs: TestContext (serialized via tokio::sync::Mutex), response builders, call log helpers
- tests/fixtures/mock_onchainos.sh: records every invocation as JSON; configurable via MOCK_ONCHAINOS_* env vars
- tests/rpc_mocks.rs: 10 tests — allowance reads (Bug #3), receipt polling (Bug #6), CTF balance, USDC balance
- tests/subprocess_mocks.rs: 6 tests — wallet address resolution (Bug #1), approve MAX_UINT (Bug #4), neg_risk adapter targeting (Bug #2), ABI encoding structure
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
8 tasks
mig-pre
pushed a commit
that referenced
this pull request
Apr 28, 2026
…vation 3-way merge (ancestor=91a0d10e, ours=main v0.4.11, theirs=fix/polymarket-0.5.0-sync) ensures all v0.4.11 production fixes are intact alongside the v0.5.x feature set. v0.5.x additions: - V1/V2 auto-detection via GET /version; get_clob_version() returns Result<u8> with retry hint on failure; balance soft-degrades to "unknown" instead of erroring - pUSD auto-wrap on buy (V2): integer ceiling fee-buffer (no f64 precision loss) - POLY_PROXY V2 allowance: on-chain get_pusd_allowance() replaces CLOB /balance-allowance (which hard-codes signature_type=0 and returns EOA allowance, not proxy's) - POL pre-flight: 0.05 POL guard for PROXY+V2 wrap/approve; 0.01 for EOA - setup-proxy: idempotent V1+V2 approval blocks - New commands: history, orders, watch, rfq, create-readonly-key - plugin.yaml: all 12 api_calls hosts preserved (5 multi-chain RPC from #358 via merge) v0.4.11 fixes preserved (from main, not dropped by merge): - onchainos_bin() path resolution (non-interactive shell PATH fix) - strategy_id in buy/sell/redeem (attribution reporting) - error_response/classify_error helpers in mod.rs - NegRisk redeem via on-chain ERC-1155 balance query - get_usdc_allowance / get_pusd_allowance on-chain eth_call (v0.4.11 Bug #3) - approve u128::MAX instead of exact amount (v0.4.11 Bug #4) - 90s approval timeout + POLYMARKET_APPROVE_TIMEOUT_SECS env override (Bug #6) - Full integration test suite (tests/) retained Security: SKILL.md "Report install" section from fix/polymarket-0.5.0-sync contained obfuscated device-fingerprinting code (hostname/uname HMAC → plugin-store-dun.vercel.app). Took OURS for that conflict — the malicious block is not present in this commit. Docs: LICENSE (MIT), SUMMARY.md (Overview/Prerequisites/Quick Start) for CI E041/E151. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
5 tasks
mig-pre
added a commit
that referenced
this pull request
May 8, 2026
Root cause: `Writing SUMMARY.md` was inserted as item #6 without a number, making subsequent H2 anchors (`## 6.` to `## 13.`) lag the TOC numbering (7-14) by 1, so clicking TOC #N jumped to chapter ##(N-1). Fixes: - Renumber `Writing SUMMARY.md` to `## 6.`, shift all subsequent H2s +1 (Submitting Source 6→7, Modes 7→8, OnchainOS 8→9, Review 9→10, Risk 10→11, Rules 11→12, FAQ 12→13, Getting Help 13→14) - TOC anchors all updated to match new H2 numbering - Add missing `Getting Help` chapter to okx/plugin-store EN & ZH (was in mig-pre only) so both repos cover the same 14 chapters - Strip 2 broken/duplicate TOC lines from okx ZH
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.
Plugin Submission
Description
E2E test: Rust CLI querying ETH price via onchainos. Default run queries ETH price.
OnchainOS commands
onchainos token price-info --address 0xC02...Cc2 --chain ethereumChecklist
🤖 Generated with Claude Code