Skip to content

Refactor service classes to reuse common service setup code #4994

@Gudahtt

Description

@Gudahtt

Each of our services that follow the pattern outlined in https://github.com/MetaMask/decisions/blob/main/decisions/core/0002-external-api-integrations.md have a chunk of boilerplate that is identical for each service. We can make services easier to write by refactoring our existing services to use a common function for these boilerplate setup steps.

This would also dramatically simplify the effort needed to test new services. The base service policy we have is complex to test, and we're re-testing various conditions over and over with each new service. If we implemented the basic service pattern in a shared function, we could test it exhaustively just in that function, and focus on service-specific logic in our tests for each service.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestteam-wallet-frameworkDeprecated: Please use `team-core-platform` instead.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions