Skip to content

Fix: change references of shardeum dependencies to shardus #10 and minor fixes to tests to make them run - #11

Open
maher-bta wants to merge 3 commits into
devfrom
change-deps-to-shardus
Open

Fix: change references of shardeum dependencies to shardus #10 and minor fixes to tests to make them run#11
maher-bta wants to merge 3 commits into
devfrom
change-deps-to-shardus

Conversation

@maher-bta

Copy link
Copy Markdown

No description provided.

Signed-off-by: Maher BEN TALEB ALI <maher1.bta@gmail.com>
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Failed to generate code suggestions for PR

Signed-off-by: Maher BEN TALEB ALI <maher1.bta@gmail.com>
@jairajdev

Copy link
Copy Markdown
Contributor

Review Report: change-deps-to-shardus (PR #11)

Review outcome

Request changes. The dependency imports compile, but the src/shardeumsrc/app rename leaves executable scripts and unit tests pointing to deleted paths.

Findings

P1 — Operational scripts import modules from the deleted directory

The branch renames src/shardeum to src/app, but these scripts still import from ../src/shardeum/...:

Each now fails at module resolution before doing any work. scripts/ is excluded from tsconfig.json, so the successful production compile does not detect this regression.

Recommendation: change all four imports to ../src/app/..., and add an explicit script type-check or smoke test so future directory moves cannot evade CI.

P1 — Unit tests retain nine mocks/requires for the deleted src/shardeum path

The moved production imports were updated, but nine jest.mock, jest.doMock, or require calls still reference src/shardeum. They occur in API.test.ts, Data/Collector.test.ts, GlobalAccount.test.ts, LostArchivers.test.ts, calculateAccountHash.test.ts, and checkpoint/ReceiptData.test.ts.

All six affected suites fail before executing their tests with Cannot find module .../src/shardeum/....

Recommendation: update every remaining mock/require to src/app, then run the complete suite.

P2 — queryTransactionByAccountId queries a column absent from the schema

queryTransactionByAccountId executes:

SELECT * FROM transactions WHERE accountId=?

However, the transactions table schema contains no accountId column; it has txId, appReceiptId, timestamp, cycleNumber, data, and originalTxData.

Any use of this new function causes SQLite to throw no such column: accountId. The function catches that error and returns null, making it look like no transaction was found. Its mock-based unit tests do not exercise the real schema.

Recommendation: remove this unused function, query one of the existing indexed identifiers, or add a migration that creates and populates an indexed accountId column.

Validation performed

  • npm run compile — passed.
  • Focused Jest run (with Watchman disabled) for the six suites above — 6 suites failed, all because of the stale src/shardeum references.
  • Full Jest run (with Watchman disabled) — 70 suites passed; 19 suites failed; 2,008 tests passed; 79 failed; 5 skipped. The stale-path failures above are confirmed PR regressions; the remaining failures need separate baseline triage.
  • npm test -- --runInBand could not start Jest in this sandbox because Watchman access is denied; the no-Watchman command was used to obtain the test results above.
  • npm run check could not run because the existing ESLint configuration references missing plugin:no-unsanitized/DOM. This is a validation blocker but was not attributed to this PR.

Review notes

  • The @shardeum-foundation/* dependency imports in tracked source, scripts, tests, package.json, and the lockfile have been migrated to @shardus/*.
  • The PR also includes work beyond the dependency scope: the application-directory rename, new receipt/account helper exports, a database query, test casts, and a dev-dependency range change. Separating the unrelated work would make the dependency migration easier to validate and revert.

…tests

Signed-off-by: Maher BEN TALEB ALI <maher1.bta@gmail.com>
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