Skip to content

refactor(cli): migrate releasecelo, validator, validatorgroup to viem [8/8]#773

Open
pahor167 wants to merge 4 commits intopahor/viem-D4-cli-commands-2from
pahor/viem-D5-cli-final
Open

refactor(cli): migrate releasecelo, validator, validatorgroup to viem [8/8]#773
pahor167 wants to merge 4 commits intopahor/viem-D4-cli-commands-2from
pahor/viem-D5-cli-final

Conversation

@pahor167
Copy link
Copy Markdown
Contributor

@pahor167 pahor167 commented Apr 1, 2026

Stack

A β†’ B β†’ C β†’ D1 β†’ D2 β†’ D3 β†’ D4 β†’ D5 ← CI must be green

Changes

Replace web3-based transaction patterns with viem equivalents across releasecelo/, validator/, and validatorgroup/ CLI commands and their tests.

This is the final PR in the stack β€” CI must pass here before merging any of the chain.


PR-Codex overview

This PR focuses on refactoring the codebase to replace instances of displaySendTx with displayViemTx, updating the transaction handling mechanism to use a new client. It also modifies test cases to use a provider instead of Web3, enhancing compatibility with a new connection method.

Detailed summary

  • Replaced displaySendTx with displayViemTx in various command files.
  • Updated transaction handling to use publicClient.
  • Modified test cases to use provider instead of web3.
  • Changed newKitFromWeb3 to newKitFromProvider in tests.
  • Adjusted transaction hash handling for better compatibility.

The following files were skipped due to too many changes: packages/cli/src/commands/releasecelo/set-account.test.ts, packages/cli/src/commands/validator/affilliate.test.ts, packages/cli/src/commands/releasecelo/refund-and-finalize.test.ts, packages/cli/src/commands/validatorgroup/member.test.ts, packages/cli/src/commands/releasecelo/admin-revoke.ts, packages/cli/src/commands/validatorgroup/rpc-urls.test.ts, packages/cli/src/commands/releasecelo/set-beneficiary.test.ts, packages/cli/src/commands/validatorgroup/deregister.test.ts, packages/cli/src/commands/releasecelo/authorize.test.ts, packages/cli/src/commands/releasecelo/transfer-dollars.test.ts, packages/cli/src/commands/releasecelo/withdraw.test.ts, packages/cli/src/commands/releasecelo/admin-revoke.test.ts, packages/cli/src/commands/validator/deregister.test.ts

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

…s to viem

Replace web3-based transaction patterns with viem equivalents across
releasecelo/, validator/, and validatorgroup/ CLI commands and their tests.
@pahor167 pahor167 requested a review from a team as a code owner April 1, 2026 09:08
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 1, 2026

⚠️ No Changeset found

Latest commit: 0db402d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

size-limit report πŸ“¦

Path Size
import * from '@celo/core' (csj) 1.81 KB (0%)
import * from '@celo/core' (esm) 1.56 KB (0%)

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

βœ… All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (pahor/viem-D4-cli-commands-2@289b880). Learn more about missing BASE report.

Additional details and impacted files
@@                       Coverage Diff                       @@
##             pahor/viem-D4-cli-commands-2     #773   +/-   ##
===============================================================
  Coverage                                ?   66.69%           
===============================================================
  Files                                   ?      167           
  Lines                                   ?     8200           
  Branches                                ?     1369           
===============================================================
  Hits                                    ?     5469           
  Misses                                  ?     2660           
  Partials                                ?       71           
Components Coverage Ξ”
celocli 58.89% <0.00%> (?)
sdk 66.09% <0.00%> (?)
wallets 73.02% <0.00%> (?)
viem-sdks 94.15% <0.00%> (?)
πŸš€ New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • πŸ“¦ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Pavel Hornak added 3 commits April 1, 2026 12:04
…shot

- SimpleHttpProvider.request: add replacer to JSON.stringify that converts
  bigint to hex string, fixing "Do not know how to serialize a BigInt" when
  viem passes bigint blockNumber params via the provider
- election/activate.test.ts: update inline snapshots to reflect correct
  sequential tx log order (finishNextEpoch txHash arrives before activate starts)
- Remove extra trailing txHash entry from two activate --wait snapshots
  (displayViemTx only emits one txHash per call, not two)
- Increase reorders member beforeEach/test timeouts from 30s to 60s
- Add 60s timeout to epoch block information tests (viem adds pre-flight
  gas estimation making each write ~50% more RPC calls than web3)
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