Skip to content

Fix stale @starknet-react/core imports and cairo test arity mismatch - #22

Merged
tu11aa merged 1 commit into
step-3from
fix/step-3-frontend-and-cairo-test
Jul 31, 2026
Merged

Fix stale @starknet-react/core imports and cairo test arity mismatch#22
tu11aa merged 1 commit into
step-3from
fix/step-3-frontend-and-cairo-test

Conversation

@tu11aa

@tu11aa tu11aa commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • app/page.tsx:8 imported useBlockNumber from @starknet-react/core, the old package name (identical fix and byte-identical line to PR Fix stale @starknet-react/core import and cairo test arity mismatch #21 on step-2, verified character-for-character).
  • app/vesu/page.tsx:11 imported useAccount from the same old package. Repointed to ~~/hooks/useAccount — the local wrapper every other standalone useAccount consumer in the codebase uses (ConnectedAddress.tsx, WriteOnlyFunctionForm.tsx, FaucetButton.tsx, useAutoConnect.ts, useTargetNetwork.ts, CustomConnectButton/index.tsx). This file only destructures .address, matching that convention (the two exceptions using the raw package, Header.tsx and NetworkOptions.tsx, do so because they import multiple hooks — useNetwork/useProvider/useSwitchChain — in one line).
  • contracts/tests/test_contract.cairo:110 — same arity fix as step-2 (byte-identical content, verified via diff).

No refactors, no unrelated cleanup. deployedContracts.ts untouched (D1, out of scope).

Proof (pasted command output)

Compile: ⏭️ Skipping compilation - all contracts are up to date

Test:

Collected 5 test(s) from contracts package
Running 5 test(s) from tests/
[PASS] contracts_integrationtest::test_contract::test_withdraw_not_owner
[PASS] contracts_integrationtest::test_contract::test_set_greetings
[PASS] contracts_integrationtest::test_contract::test_set_greeting_no_allowance
[PASS] contracts_integrationtest::test_contract::test_transfer_eth
[PASS] contracts_integrationtest::test_contract::test_transfer_strk
Running 0 test(s) from src/
Tests: 5 passed, 0 failed, 0 ignored, 0 filtered out

Compile-clean (E2030 gone) and full pass, including the 3 #[fork("SEPOLIA_LATEST")] tests.

yarn format:check / scarb fmt --check: both clean, exit 0 — no reformatting needed.

next:check-types / yarn build: fail, both pre- and post-deploy, but due to a separate, pre-existing defect unrelated to this fix — a symbol-typed index-signature error in ContractUI.tsx/DebugContracts.tsx/useDeployedContractInfo.ts/contract.ts:56, traced to a contract-name union mismatch (likely vStrk/mainnetFork missing from predeployedContracts.ts relative to scaffold.config.ts's targetNetworks: [chains.mainnetFork]). Verified via git stash that this failure is present identically with or without this PR's changes — it is not a regression from this fix and is out of this PR's scope (D2/D3 only).

next dev (port 3002):

curl / -> HTTP_STATUS:200
curl /vesu -> HTTP_STATUS:200

Both routes render — the actual proof the frontend works, independent of the strict-build type error above.

Test plan

  • yarn compile
  • yarn test (5/5 pass)
  • yarn format:check (clean)
  • next dev on port 3002, curl / → 200, curl /vesu → 200
  • yarn next:check-types / yarn build — fails on a pre-existing, unrelated defect (see above), not introduced or fixed by this PR

app/page.tsx and app/vesu/page.tsx still imported from the old
@starknet-react/core package name; the repo migrated to
@starknet-start/react (or the local ~~/hooks/useAccount wrapper used
by every other standalone useAccount consumer). test_set_greeting_no_allowance
called set_greeting with 2 args instead of the 3 the contract requires,
failing compilation (E2030) before tests could even run.
@tu11aa
tu11aa merged commit 4953e1d into step-3 Jul 31, 2026
1 check failed
@tu11aa
tu11aa deleted the fix/step-3-frontend-and-cairo-test branch July 31, 2026 14:14
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.

1 participant