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

Export and use core-database-postgres typedefs #1905

Merged
merged 6 commits into from
Dec 25, 2018
Merged

Export and use core-database-postgres typedefs #1905

merged 6 commits into from
Dec 25, 2018

Conversation

paroxysm
Copy link
Contributor

@paroxysm paroxysm commented Dec 24, 2018

Proposed changes

resolves #1791

This refactor has exposed some strange design decisions made. There's some methods that are on the postgres implementation of the Connection interface that can be moved into an abstract class.
PS. We probably should break out the business logic in Connection out into Services that leverage the connection and repositories so we're separating concerns

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (improve a current implementation without adding a new feature or fixing a bug)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Build (changes that affect the build system)
  • Docs (documentation only changes)
  • Test (adding missing tests or fixing existing tests)
  • Other... Please describe:

Checklist

  • I have read the CONTRIBUTING documentation
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

refactor: Remove un-used SPV.connection property
refactor: Remove ConnectionInterface.connection property. This available in the 'options' object that's passed via constructor.
refactor: Use inline-initialization instead of constructor initialization for concise code, unless we're accessing constructor parameters.
refactor: more inline-initialization vs constructor
refactor: Removed some redundant vars in core-api Repositories, use inherited references instead.
@faustbrian
Copy link
Contributor

faustbrian commented Dec 24, 2018

The mentioned issues will be taken core of by #1573. There is still a lot of old code in it written by someone else that will refactored.

In the end the core-database-postgres package will barely overwrite anything and mostly just provide data to the underlying core-database package. That package will then pass the data on to services that specifically handle blocks, transactions, rounds and wallets to clearly separate behaviour and make code SOLID as time goes on now that we finally ditched JavaScript.

There is tons of refactoring and especially improvements to the plugin system and structure in the pipeline now that JavaScript is gone but that will take time.

@faustbrian
Copy link
Contributor

@paroxysm conflicts

…core-database-postgres-typedefs

# Conflicts:
#	packages/core-database-postgres/src/connection.ts
#	packages/core-database-postgres/src/index.ts
#	packages/core-database-postgres/src/spv.ts
#	packages/core-database/src/interface.ts
#	packages/core-database/src/manager.ts
@paroxysm
Copy link
Contributor Author

@faustbrian Great! There's definitely some tech debt that needs to be addressed

@paroxysm
Copy link
Contributor Author

@faustbrian I've addressed the conflicts.
I purposefully left out core-graphql because it was referencing some methods that the PostgresConnection class doesn't define.
I'll need to track those down and formally declare them

@faustbrian faustbrian merged commit c5a235b into ArkEcosystem:develop Dec 25, 2018
@paroxysm paroxysm deleted the feat/export-core-database-postgres-typedefs branch December 26, 2018 23:27
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