Skip to content

Filter smart contracts from EVM account list#35

Merged
YoshiyukiSakura merged 2 commits into
crossagentfrom
worktree/task_447aaf19c4b849c6
May 25, 2026
Merged

Filter smart contracts from EVM account list#35
YoshiyukiSakura merged 2 commits into
crossagentfrom
worktree/task_447aaf19c4b849c6

Conversation

@crossagent-production-app
Copy link
Copy Markdown
Contributor

Refs #16

Summary

  • Filter /api/plugin/evm/accounts so EVM smart-contract addresses already present in evm_contracts are not returned as EOA accounts.
  • Add a sqlite cursor regression test that seeds the mixed evm_accounts + evm_contracts state and verifies only the EOA remains visible.

Verification

  • go test $(find plugins/evm/dao -maxdepth 1 -name '*.go' ! -name '*_test.go' | sort) plugins/evm/dao/api_cursor_test.go -run '^TestAccountsCursor' -count=1 -> ok command-line-arguments 2.024s

Delivery Evidence Summary

Change:
Backend DAO change for /api/plugin/evm/accounts: the account cursor query now joins evm_contracts and excludes matching contract addresses, while preserving balance/cursor ordering for real EOA rows.

Objective Evidence:
Focused sqlite DAO validation passed: go test $(find plugins/evm/dao -maxdepth 1 -name '*.go' ! -name '*_test.go' | sort) plugins/evm/dao/api_cursor_test.go -run '^TestAccountsCursor' -count=1 -> ok command-line-arguments 2.024s. The new TestAccountsCursorExcludesSmartContracts reproduces the issue by inserting one EOA and one smart-contract address into evm_accounts, inserting the contract into evm_contracts, and asserting the accounts endpoint cursor returns only the EOA and returns no row when filtering by the contract address.

Visual Evidence:
n.a. Backend DAO/API behavior only; no UI, browser, or visual behavior was changed.

Reviewer:
@repo Intake Reviewer

Risks / Not Covered:
Full package command go test ./plugins/evm/dao -run '^TestAccountsCursor' -count=1 is blocked by existing external dao_test bootstrap requiring ../../../configs/config.yaml plus live MySQL/Redis before test filtering. The executed validation isolates the changed DAO code and regression test with an in-memory sqlite database.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
subscan-essentials Ready Ready Preview, Comment May 25, 2026 9:54am
subscan-essentials-ui-react Ready Ready Preview, Comment May 25, 2026 9:54am

Request Review

@crossagent-production-app
Copy link
Copy Markdown
Contributor Author

Change:
Backend DAO change for /api/plugin/evm/accounts: the account cursor query now joins evm_contracts and excludes matching contract addresses, while preserving balance/cursor ordering for real EOA rows.

Objective Evidence:
Focused sqlite DAO validation passed: go test $(find plugins/evm/dao -maxdepth 1 -name '*.go' ! -name '*_test.go' | sort) plugins/evm/dao/api_cursor_test.go -run '^TestAccountsCursor' -count=1 -> ok command-line-arguments 2.024s. The new TestAccountsCursorExcludesSmartContracts reproduces the issue by inserting one EOA and one smart-contract address into evm_accounts, inserting the contract into evm_contracts, and asserting the accounts endpoint cursor returns only the EOA and returns no row when filtering by the contract address.

Visual Evidence:
n.a.

Reviewer:
@repo Intake Reviewer

Risks / Not Covered:
Backend-only change, so no screenshot evidence is applicable. Full package command go test ./plugins/evm/dao -run '^TestAccountsCursor' -count=1 is blocked by existing external dao_test bootstrap requiring ../../../configs/config.yaml plus live MySQL/Redis before test filtering. The executed validation isolates the changed DAO code and regression test with an in-memory sqlite database.

@crossagent-production-app
Copy link
Copy Markdown
Contributor Author

crossagent-production-app Bot commented May 25, 2026

Delivery Evidence Summary

Change:

  • Backend DAO/API change for /api/plugin/evm/accounts: account cursor results now exclude addresses that are present in evm_contracts, keeping real EOA accounts separate from smart-contract accounts.

Objective Evidence:

  • go test -v -count=1 -run TestAccountsRouteExcludesSmartContracts ./plugins/evm/http exit code 0, passed: POST /api/plugin/evm/accounts with seeded mixed evm_accounts and evm_contracts returned only EOA 0x0000000000000000000000000000000000000001 with balance 10 and omitted contract 0x0000000000000000000000000000000000000002.
  • Playwright browser validation for http://localhost:3001/ homepage EVM Contract overview exit code 0, passed: Loaded the real Heima Explorer Next.js frontend, confirmed title Heima Explorer, no framework overlay, 200 responses from live Heima metadata/token/EVM transactions endpoints, and rendered homepage EVM Contract overview panel text EVM Contract Block 9,652,929, Transaction 2,122, EVM Account 1,318, EVM Contract 22.

Visual Evidence:

  • Heima homepage EVM Contract overview cards
  • Source Screenshot Match: same product surface as the original issue screenshot: Heima homepage overview section titled EVM Contract, with visible cards EVM Contract Block, Transaction, EVM Account, and EVM Contract. The captured product section shows those same anchors and card layout.

Reviewer:

Risks / Not Covered:

  • The homepage counts are live Heima data and can change between captures; the visual proof is tied to the matching surface and labels rather than fixed counts.
  • Full DAO package command remains constrained by the repository's external config/service bootstrap; the focused HTTP regression test exercises the changed behavior with an in-memory sqlite fixture.

Generated at: 2026-05-25T11:46:00+08:00

@YoshiyukiSakura
Copy link
Copy Markdown
Contributor

Temporary host for corrected CrossAgent visual evidence upload. This will be removed after the App evidence comment is updated.

subscan-issue16-real-product-route-evidence.png

@YoshiyukiSakura YoshiyukiSakura merged commit 479b002 into crossagent May 25, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants