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

Add convenience init for Web3HttpProvider #717

Conversation

rinat-enikeev
Copy link
Contributor

Summary of Changes

Adds the ability to initialise Web3HttpProvider sync and non optionally.

Test Data or Screenshots

Motivation: no need to make init sync and optional if client is sure the network provider is working.

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.

Copy link
Collaborator

@yaroslavyaroslav yaroslavyaroslav left a comment

Choose a reason for hiding this comment

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

We're still in our way to include swiftlint checks within ci/cd pipeline, so those checks are yet made manually by us.

Comment on lines 43 to 47
public init(
url: URL,
network: Networks,
keystoreManager: KeystoreManager? = nil
) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

These style doesn't match with all the other code in our project, please format it in more swift way, like init attributes should be in one line and open curly brackets should follow them

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done e893cb3

Copy link
Collaborator

Choose a reason for hiding this comment

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

@yaroslavyaroslav For large long functions and inits I'd break them into multiple lines.
E.g. for the init? of Web3HttpProvider:

public init?(_ httpProviderURL: URL,
             network net: Networks? = nil,
             keystoreManager: KeystoreManager? = nil) async {
                 ...
             }

instead of what we currently have.

@rinat-enikeev Nothing to change for you in this PR, just raising commenting on this topic.

@JeneaVranceanu JeneaVranceanu merged commit ee26d1e into web3swift-team:develop Dec 26, 2022
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.

3 participants