Skip to content

Make the CoreClient really dumb #19

@hug-dev

Description

@hug-dev

This is just an issue to think about it. I am sorry to not have mentionned it earlier in a PR.

I think the CoreClient should not contain any abstraction, that is any structure that is not created in the interface or any logic more than executing the operation.

I propose then the following changes:

  1. put a provider_id field inside the CoreClient (ProviderID type), which is the exact number used to send the operation on the wire protocol. Add setters and getters for that field. Use that field when sending operation and not the Provider parameter of the methods.
  2. do not restrict the core operations to be executed only on the core providers: I think that the "intelligence" needed to know which operation is executable on which provider should not be part of the core client but at a higher level. It should be possible to send operations with the CoreClient that are not supported. It should be possible to do anything with the CoreClient
  3. move the Provider structure out of the CoreClient. I think this structure is our first abstraction over the core client and should be in its own module, like providers.rs. I think that the logic needed to retrieve the provider ID of a known provider should not be part of the CoreClient

CC @ionut-arm what do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions