Skip to content

[new-plugin] test-rust-cli v1.0.0#5

Closed
mig-pre wants to merge 1 commit into
okx:mainfrom
mig-pre:submit/test-rust-cli
Closed

[new-plugin] test-rust-cli v1.0.0#5
mig-pre wants to merge 1 commit into
okx:mainfrom
mig-pre:submit/test-rust-cli

Conversation

@mig-pre
Copy link
Copy Markdown
Collaborator

@mig-pre mig-pre commented Apr 5, 2026

Plugin Submission

  • Plugin name: test-rust-cli
  • Version: 1.0.0
  • Type: new-plugin

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 ethereum

Checklist

  • plugin-store lint passes
  • .claude-plugin/plugin.json included
  • SKILL.md has YAML frontmatter
  • LICENSE included

🤖 Generated with Claude Code

E2E test: Rust CLI querying ETH price via onchainos token price-info.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 5, 2026

Phase 4: Summary + Pre-flight for test-go-cli

Review below. AI Code Review is in a separate check.



Generated by Plugin Store CI after maintainer approval.

@mig-pre
Copy link
Copy Markdown
Collaborator Author

mig-pre commented Apr 5, 2026

Recreating as branch directly on okx/plugin-store

@mig-pre mig-pre closed this Apr 5, 2026
skylavis-sky added a commit to skylavis-sky/plugin-store that referenced this pull request Apr 12, 2026
….md scenario hints

- config: add clear_credentials() that removes ~/.config/polymarket/creds.json
- buy/sell: detect NOT AUTHORIZED / UNAUTHORIZED from CLOB, auto-clear cached
  creds and bail with "run again to re-derive" (stale credential recovery okx#9)
- buy: accepting_orders guard in resolve_market_token — bails early with clear
  error for closed/resolved markets before any wallet calls (#2)
- SKILL.md: six targeted one-liners for common deviation scenarios:
  URL slug extraction (#1), short-lived market warning (#3),
  amount-vs-shares clarification (okx#5), no-Polymarket-deposit note (okx#10),
  cancel open-orders-only note (okx#11), price=probability clarification (okx#12)
- SKILL.md: credential rotation section updated to mention auto-clear

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants