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

chore: error description+refactoring #841

Conversation

JeneaVranceanu
Copy link
Collaborator

Note

Before starting the review of this PR make sure the following is merged: #839

Summary of Changes

  • Web3Error: added descriptions to make errors more meaningful;
  • Refactored APIRequests+Methods.swift, ENSBaseRegistrar, ENSRegistry, ENSResolver, ENSReverseRegistrar, ETHRegistrarController.
By submitting this pull request, you are confirming the following:
  • I have reviewed the Contribution Guidelines.
  • I have performed a self-review of my own code.
  • I have updated my repository to match the develop branch.
  • I have included test data or screenshots that prove my fix is effective or that my feature works.
  • I have checked that all tests work and swiftlint is not throwing any errors/warnings.

performed refactoring of APIRequests+Methods.swift, ENSBaseRegistrar, ENSRegistry, ENSResolver, ENSReverseRegistrar, ETHRegistrarController,
@JeneaVranceanu JeneaVranceanu changed the title Chore/error description+refactoring chore: error description+refactoring Jan 16, 2024
}

internal init(urlSession: URLSessionProxy, apiKey: String) {
self.urlSession = urlSession
self.apiKey = apiKey
self.apiKey = apiKey.trim()
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd purpose to switch all such string functions as a properties. e.g. apiKey.trimed, function.selector.hexPrefixAdded.lowercased. I mean to add such as a separate issue for further work.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I do not mind but what is the benefit or reason for it?

Copy link
Collaborator

Choose a reason for hiding this comment

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

This way it would better fits with clean code rules. Actually this way it wouldn't violates the rule of in-depth abstraction layers mixing as it is with chain function calls.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

To be handled in a separate PR.

@JeneaVranceanu JeneaVranceanu dismissed yaroslavyaroslav’s stale review February 7, 2024 10:50

The merge-base changed after approval.

@yaroslavyaroslav
Copy link
Collaborator

I'd purpose to switch all such string functions as a properties. e.g. apiKey.trimmed, function.selector.hexPrefixAdded.lowercased. I mean to add such as a separate issue for further work.

@JeneaVranceanu
Copy link
Collaborator Author

I'd purpose to switch all such string functions as a properties. e.g. apiKey.trimmed, function.selector.hexPrefixAdded.lowercased. I mean to add such as a separate issue for further work.

@yaroslavyaroslav I'll update the codebase to this style in a separate PR so there's no need to re-review this one.

@JeneaVranceanu JeneaVranceanu merged commit b455811 into web3swift-team:develop-4.0 Feb 14, 2024
1 check passed
@JeneaVranceanu
Copy link
Collaborator Author

I'd purpose to switch all such string functions as a properties. e.g. apiKey.trimmed, function.selector.hexPrefixAdded.lowercased. I mean to add such as a separate issue for further work.

Screenshot 2024-02-14 at 16 20 21

Hmm, it looks like I haven't used Swift for a while and forgot that we actually have lowercased() function and not a property. So I'm not sure we should actually implement that.
I'd rather replace properties with functions where it actually makes sense.

@JeneaVranceanu JeneaVranceanu deleted the chore/error-description+refactoring branch February 14, 2024 14:22
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