Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code-Update blockchain-data.js #4904

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

romashka-btc
Copy link

Fix: Replaced switch statement with if for improved readability

Changes

  • Replaced the unnecessary switch statement in lib.commonjs_tests/blockchain-data.js with an if statement to enhance code readability.

    • Before:

      function networkFeatureAtBlock(feature, block) {
          switch (feature) {
              case "byzantium":
                  return block >= 4370000;
              default:
                  break;
          }
          throw new Error(`unknown feature: ${feature}`);
      }
    • After:

      function networkFeatureAtBlock(feature, block) {
          if (feature === "byzantium") {
              return block >= 4370000;
          }
          throw new Error(`unknown feature: ${feature}`);
      }

Purpose

  • Improved code readability and maintainability.

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