Skip to content

Consolidate ExecutionMode type and constants to enum#16

Merged
jeffsmale90 merged 2 commits into
mainfrom
feat/executionModeAsEnum
Jul 9, 2025
Merged

Consolidate ExecutionMode type and constants to enum#16
jeffsmale90 merged 2 commits into
mainfrom
feat/executionModeAsEnum

Conversation

@jeffsmale90

@jeffsmale90 jeffsmale90 commented Jul 1, 2025

Copy link
Copy Markdown
Collaborator

📝 Description

Previously ExecutionMode was a type, which was implemented as multiple constant literals. Now we combine those two into a single enum ExecutionMode.

🔄 What Changed?

  • type ExecutionMode = {...} and const SINGLE_DEFAULT_MODE = '0x.... etc becomes enum ExecutionMode = { SINGLE_DEFAULT = '0x...' ... }
  • Update all references to use enum
  • Moved from /utils export to main root export

🚀 Why?

The ExecutionMode was required by a number of interfaces in the root export. This meant that a caller would have to import the function from the root export, and the ExecutionMode constants from the /utils export. Additionally, the caller may have to import the type (by name), and each of the constants (by name). Allowing the caller to import only the enum, makes calling these functions much easier.

🧪 How to Test?

Sufficient automated testing in unit tests, and e2e integration tests. Review the integration tests to see the new interface. Take special note of the imports.

⚠️ Breaking Changes

List any breaking changes:

  • No breaking changes
  • Breaking changes (describe below):

ExecutionMode becomes an enum and moves from @metamask/delegation-toolkit/utils to `@metamask/delegation-toolkit.

📋 Checklist

Check off completed items:

  • Code follows the project's coding standards
  • Self-review completed
  • Documentation updated (if needed)
  • Tests added/updated
  • Changelog updated (if needed)
  • All CI checks pass

🔗 Related Issues

Link to related issues:
Closes #
Related to #

📚 Additional Notes

Any additional information, concerns, or context:

@jeffsmale90 jeffsmale90 requested a review from a team as a code owner July 1, 2025 06:16
@jeffsmale90 jeffsmale90 force-pushed the feat/executionModeAsEnum branch from e7ba7df to 7384a0e Compare July 1, 2025 07:19
hanzel98
hanzel98 previously approved these changes Jul 9, 2025
@jeffsmale90 jeffsmale90 merged commit 2ccf30d into main Jul 9, 2025
15 checks passed
@jeffsmale90 jeffsmale90 deleted the feat/executionModeAsEnum branch July 9, 2025 21:39
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