Skip to content

Conversation

@rainydio
Copy link
Contributor

@rainydio rainydio commented Mar 12, 2020

Summary

Requires new github CI check to setup postgresql database.

Migrations

Migrations are executed back and forth to check that they apply and undo properly. Many didn't had down migration implemented. Some undo issues were fixed. All IF EXISTS were removed from queries, because they masked undo problems.

BlockRepository

  • findByHeightRangeWithTransactions now sets block.transactions to empty array if no transactions were found.
  • findCommon is removed and usages are replaced with otherwise equivalent findByIds.
  • saveBlocks does not attempt to reorder transactions within some exceptional blocks anymore. It was done incorrectly reversing the actual list within configuration (.reverse() mutated configuration array). Besides findByHeightRangeWithTransactions re-orders transactions back by transaction.sequence.
  • deleteBlocks now does not allow to remove blocks in the middle.

TransactionRepository

  • Queries containing hardcoded type and type_group are refactored to use Enums.TransactionTypeGroup and Enums.TransactionType.
  • findForged is removed and getForgedTransactionsIds is refactored not to use it.
  • findByIdAndType is removed and single usage in api is refactored to use findById and throw if type doesn't match.
  • findByHtlcLocks query is fixed (type IN (:...lockIds) doesn't make any sense).
  • getOpenHtlcLocks instead of returning all locks with additional boolean open field now as name suggests returns only open htlc locks. HTLC Lock transaction handler and tests are updated.
  • getClaimedHtlcLockBalances, getRefundedHtlcLockBalances, and usages were refactored to emphasize that not transactions, but aggregated statistics is returned.

@rainydio rainydio changed the base branch from master to develop March 12, 2020 21:24
@codecov
Copy link

codecov bot commented Mar 12, 2020

Codecov Report

Merging #3597 into develop will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #3597   +/-   ##
========================================
  Coverage    87.84%   87.84%           
========================================
  Files          509      509           
  Lines        11691    11691           
  Branches      1471     1471           
========================================
  Hits         10270    10270           
  Misses        1419     1419           
  Partials         2        2           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8765df0...8765df0. Read the comment docs.

@rainydio rainydio changed the title test(core-database): increase coverage to 100% test(core-database): increase coverage Apr 27, 2020
@rainydio rainydio marked this pull request as ready for review April 27, 2020 13:48
@faustbrian faustbrian merged commit 1f57a85 into develop Apr 27, 2020
@ghost ghost deleted the test/core-database branch April 27, 2020 14:45
@ghost ghost removed the Status: Needs Review label Apr 27, 2020
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