refactor(core-database): block and transaction history services#3644
Merged
faustbrian merged 62 commits intodevelopfrom Apr 20, 2020
Merged
refactor(core-database): block and transaction history services#3644faustbrian merged 62 commits intodevelopfrom
faustbrian merged 62 commits intodevelopfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #3644 +/- ##
========================================
Coverage 85.21% 85.21%
========================================
Files 505 505
Lines 11536 11536
Branches 1460 1460
========================================
Hits 9830 9830
Misses 1702 1702
Partials 4 4 Continue to review full report at Codecov.
|
…em/core into refactor/core-database/search
faustbrian
reviewed
Apr 13, 2020
| typeGroup: 1, | ||
| fee: "0", | ||
| amount: "300000000000000", | ||
| blockId: expect.anything(), // ? how is that blockId isn't constant |
Contributor
There was a problem hiding this comment.
Block IDs used to be BigInt but are now hex, that is why.
Contributor
Author
There was a problem hiding this comment.
I feel that this assertion isn't right. I added it as stub. Block id is changing from run to run and it's integer. This is transaction.blockId, should it be hex?
faustbrian
approved these changes
Apr 20, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two new services are introduced to query historical data.
BlockHistoryServiceto query previously forged blocks, returnsInterfaces.IBlockData.TransactionHistoryServiceto query previously forged transactions, returnsInterfaces.ITransactionData.Interfaces are defined in
Contracts.Sharednamespace (core-kernel). Implementation is provided bycore-databasepackage. Code that previously directly referencedBlockRepositoryandTransactionRepositoryfromcore-databasepackage to get historical data is updated to use those services.Criteria
Most of the methods accept
criteriaparameter describing filter condition. It's strictly typed and its syntax naturally describes both simple and complex conditions:AND.OR.OR.=operator.vendorField) are matched usingLIKEoperator.asset) are matched using@>operator.>=or<=or both.Here is an example:
description in progress
Fixes #3637
Checklist