Skip to content

Conversation

@ScottyPoi
Copy link
Contributor

@ScottyPoi ScottyPoi commented Oct 29, 2025

This PR adds a set of Signer objects in the testdata package to be exported for use in tests throughout the monorepo.

Signer is a valid set of privateKey, publicKey, and address.

These imports can replace commonly repeated patterns such as:

const privateKey = "0x...."
const address = createAddressFromPrivateKey(privateKey)

This replaces most instances of signer data usage in tests throughout the monorepo. Remaining hardcoded signer data used in tests involve specific addresses from genesis files or other test setups.

Copilot AI review requested due to automatic review settings October 29, 2025 01:57
@codecov
Copy link

codecov bot commented Oct 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.78%. Comparing base (e062643) to head (9e27ecf).

Additional details and impacted files

Impacted file tree graph

Flag Coverage Δ
block 87.81% <ø> (ø)
blockchain 89.37% <ø> (ø)
common 96.75% <ø> (ø)
evm 72.39% <ø> (ø)
mpt 89.54% <ø> (-0.21%) ⬇️
statemanager 80.21% <ø> (ø)
static 99.77% <ø> (ø)
tx 88.35% <ø> (ø)
util 89.62% <ø> (ø)
vm 57.42% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors test code to use centralized signer constants from @ethereumjs/testdata instead of hardcoded private keys and addresses scattered throughout the test suite. This improves maintainability and consistency.

  • Introduces a new signers.ts file in @ethereumjs/testdata that exports 8 predefined signers (SIGNER_A through SIGNER_H)
  • Replaces inline private key and address definitions across test files with references to these constants
  • Removes unused imports and simplifies test code by eliminating duplicate signer definitions

Reviewed Changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/testdata/src/signers.ts Defines 8 signer constants with address, privateKey, and publicKey
packages/testdata/src/index.ts Exports the new signers module
packages/vm/test/api/*.ts Replace inline signer definitions with SIGNER_A/B/G constants
packages/evm/test/*.ts Update to use SIGNER_G from testdata
packages/client/test/**/*.ts Replace inline signers with SIGNER_A/B/H constants
packages/blockchain/test/clique.spec.ts Replace inline A-F signers with SIGNER_A-F
packages/block/test/clique.spec.ts Replace inline signer A with SIGNER_A

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ScottyPoi ScottyPoi marked this pull request as draft October 29, 2025 04:58
@ScottyPoi
Copy link
Contributor Author

Seems i can't add my own labels 🤔
anyway -- WIP

@holgerd77
Copy link
Member

That's already a nice one! 🙂

What do you mean with "add my own labels"?

@ScottyPoi
Copy link
Contributor Author

That's already a nice one! 🙂

What do you mean with "add my own labels"?

Normally there would be a gear symbol for the label menu:
Screenshot from 2025-10-30 14-53-49

But with PR's in the monorepo I don't have the option:
Screenshot from 2025-10-30 14-53-03

@holgerd77
Copy link
Member

Ah, I had removed you from the committers GitHub team, have readded you (respectively sent an invite to rejoin).

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