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

Merge latest Lisk Server #63

Merged
merged 1,212 commits into from
Oct 23, 2023
Merged
Changes from 1 commit
Commits
Show all changes
1212 commits
Select commit Hold shift + click to select a range
5a2bc6b
🚀 Moved sqlite3 to framework and applied suggestions
vardan10 Jul 24, 2023
8918e4c
Refactor implementation to export transaction history to excel
nagdahimanshu Jul 24, 2023
fee0362
Merge pull request #1749 from LiskHQ/1736-integrate-semgrep-to-ci
vardan10 Jul 24, 2023
0521296
🔄 Moved requestAll functionality to framework
vardan10 Jul 25, 2023
1cd6535
⚡Updated framework in all services
vardan10 Jul 25, 2023
fb81802
🔍 Snapshot URL validation and applied suggestions
vardan10 Jul 25, 2023
04a08cb
✅ Adds unit tests to framework
vardan10 Jul 25, 2023
fc556a3
✅ Adds unit tests to connector
vardan10 Jul 25, 2023
1df39e2
Applied suggestions
nagdahimanshu Jul 25, 2023
e09f8d4
🔄 Removed requestAll functionality from framework
vardan10 Jul 25, 2023
195d0ac
⚡Updated framework in all services
vardan10 Jul 25, 2023
c9da369
:hammer: Code refactoring
nagdahimanshu Jul 25, 2023
d57fe78
🚀 Fixed linting issues and updated Readme
vardan10 Jul 25, 2023
d39267e
Add unit tests
nagdahimanshu Jul 26, 2023
a608c29
Update PR
nagdahimanshu Jul 26, 2023
d2b4032
Applied suggestions from code review
vardan10 Jul 26, 2023
50aa0c9
Applied suggestions
nagdahimanshu Jul 26, 2023
659e069
Merge pull request #1753 from LiskHQ/1742-add-support-for-MySQL-snaps…
nagdahimanshu Jul 26, 2023
65b384c
Merge branch 'release/0.7.0' into 1116-update-transaction-exports-pro…
nagdahimanshu Jul 26, 2023
67689c0
Applied suggestions
nagdahimanshu Jul 26, 2023
8036d3f
Align snippets in source setup
Tschakki Jul 26, 2023
af80372
Align snippets in docker setup
Tschakki Jul 26, 2023
faef3e6
Align snippets in source mgmnt
Tschakki Jul 26, 2023
c2bb4be
Add logic for rewards
nagdahimanshu Jul 26, 2023
b0057aa
:bug: Fix getAllDirectories and rename to getDirectoryNamesInPath
sameersubudhi Jul 26, 2023
bbff245
Revert change
nagdahimanshu Jul 26, 2023
726934f
📚 Fix documentation
vardan10 Jul 26, 2023
8445df6
Merge branch 'release/0.7.0' into 1732-update-documentation
vardan10 Jul 26, 2023
731c4d7
📚 Update documentation
vardan10 Jul 27, 2023
c019129
Code cleanup
nagdahimanshu Jul 27, 2023
5709269
:pencil: Update documentation
sameersubudhi Jul 27, 2023
124f8e9
Align snippets in mgmnt and config
Tschakki Jul 27, 2023
a43658b
Apply suggestions from code review
sameersubudhi Jul 27, 2023
86a8605
Merge pull request #1765 from LiskHQ/1732-update-documentation
sameersubudhi Jul 27, 2023
a2a638e
Fix connector crash on timeout error
priojeetpriyom Jul 27, 2023
57b5826
:art: Remove unused import
priojeetpriyom Jul 27, 2023
0ef2c25
Merge branch 'release/0.7.0' into 1758-connector-crashes-on-request-t…
priojeetpriyom Jul 27, 2023
2e6181d
:art: Refactor
priojeetpriyom Jul 27, 2023
407e2de
:hammer: Refactor code
sameersubudhi Jul 27, 2023
67d232f
Merge pull request #1743 from LiskHQ/1116-update-transaction-exports-…
vardan10 Jul 27, 2023
96bdf13
Refactor error handling in connector
priojeetpriyom Jul 27, 2023
ce090b9
Merge pull request #1766 from LiskHQ/1758-connector-crashes-on-reques…
nagdahimanshu Jul 27, 2023
93168cd
Add support for strict flag for dryrun transaction
nagdahimanshu Jul 28, 2023
3f3a5ed
Add unit tests
nagdahimanshu Jul 28, 2023
c9df353
Add integration tests
nagdahimanshu Jul 28, 2023
cee9194
Apply suggestions from code review
Tschakki Jul 28, 2023
1231ce7
Apply feedback from review
Tschakki Jul 28, 2023
3ecbd58
Apply feedback from review
Tschakki Jul 28, 2023
31d7ab0
Uncomment line
Tschakki Jul 28, 2023
db2763a
Applied suggestions from code review
nagdahimanshu Jul 28, 2023
04c8ff6
Merge pull request #1767 from LiskHQ/1763-dryrun-does-not-validate-pr…
sameersubudhi Jul 28, 2023
40535f2
:hammer: Refactor business logic for token module methods
nagdahimanshu Jul 28, 2023
33f77c3
Cache token information in connector
nagdahimanshu Jul 28, 2023
d9fb5e0
:zap: Sanitizatize code
sameersubudhi Jul 28, 2023
3fc226c
Fix swagger specs
nagdahimanshu Jul 31, 2023
9d73abe
Fix codeQL issue
nagdahimanshu Jul 31, 2023
d5b1fdc
Applied suggestions from code review
nagdahimanshu Jul 31, 2023
b3aec64
Apply suggestions from code review
nagdahimanshu Jul 31, 2023
f5dfec6
:zap: Paginate DB queries when checking for missing blocks
sameersubudhi Jul 31, 2023
c314999
Merge pull request #1770 from LiskHQ/1769-cache-token-summary-informa…
nagdahimanshu Jul 31, 2023
bb8a0fa
:twisted_rightwards_arrows: Merge branch 'release/0.7.0' into 1752-no…
sameersubudhi Jul 31, 2023
69b2326
Merge branch 'release/0.7.0' into 1755-fix-codeql-reported-issues
nagdahimanshu Jul 31, 2023
553dc1e
Update MySQL to Use 'whereILike' from knex
nagdahimanshu Aug 1, 2023
91cc458
Update escapeUserInput method
nagdahimanshu Aug 1, 2023
ac59b42
Publish framework
nagdahimanshu Aug 1, 2023
35d5359
:arrow_up: Update dependencies
nagdahimanshu Aug 1, 2023
92c1351
:bug: Fix config
sameersubudhi Aug 1, 2023
d63fb9b
⚡Updated mysqlKvStore's getByPattern function to use db transaction a…
vardan10 Aug 2, 2023
270719e
♻️ Update framework in all services
vardan10 Aug 2, 2023
1b3d73a
Merge pull request #1773 from LiskHQ/1755-fix-codeql-reported-issues
sameersubudhi Aug 2, 2023
9eb64fd
:hammer: syncWithRemoteRepo must use DB transaction
sameersubudhi Aug 2, 2023
648183c
Merge branch 'release/0.7.0' into 1752-no-response-on-blockchain-apps…
sameersubudhi Aug 2, 2023
2d8b7af
Update transaction dry run and estimate fee implementation
priojeetpriyom Aug 3, 2023
e0ce579
Fix dry run and estimate fees bugs
priojeetpriyom Aug 3, 2023
14c00cc
Add integration test coverage for transaction estimate fees
priojeetpriyom Aug 3, 2023
9186bb6
Fix unit tests
priojeetpriyom Aug 3, 2023
a1e42ab
:bug: Fix response mappings
sameersubudhi Aug 3, 2023
c403206
Update unit test coverage for estimateTransactionFees
priojeetpriyom Aug 3, 2023
b6c7e66
Update unit test coverage
priojeetpriyom Aug 3, 2023
aa62dda
✅ Update integration tests
vardan10 Aug 3, 2023
466ebda
Apply suggestions
priojeetpriyom Aug 3, 2023
3815666
:art: Cleanup
priojeetpriyom Aug 3, 2023
d679cac
Merge branch 'release/0.7.0' into 1762-event-logs-not-emitted-when-dr…
priojeetpriyom Aug 3, 2023
75b40ff
Apply suggestions from code review
sameersubudhi Aug 3, 2023
122e722
Merge pull request #1764 from LiskHQ/1724-align-code-snippets
sameersubudhi Aug 3, 2023
0106439
Merge branch 'release/0.7.0' into 1752-no-response-on-blockchain-apps…
sameersubudhi Aug 3, 2023
b3646b1
:arrow_up: Upgrade mysql2 to v3.5.2
sameersubudhi Aug 3, 2023
5c823d7
:arrow_up: Upgrade Lisk Service Framework to v1.4.23
sameersubudhi Aug 3, 2023
a34e3d5
Fix estimate fee implementation
nagdahimanshu Aug 4, 2023
e138fa7
Fix unit tests
nagdahimanshu Aug 4, 2023
7d0b35b
:closed_lock_with_key: Fixed semgrep warrings and errors
vardan10 Aug 4, 2023
4220329
Update docs
nagdahimanshu Aug 4, 2023
bb3c7ac
✅ Add unit tests
vardan10 Aug 4, 2023
665cbd4
🎨 Removed disabling lint comment
vardan10 Aug 4, 2023
aed033a
Fix message fee calculation
nagdahimanshu Aug 4, 2023
d8ae4ff
Merge pull request #1778 from LiskHQ/1762-event-logs-not-emitted-when…
sameersubudhi Aug 4, 2023
6baccdd
:recycle: Refactored package imports
vardan10 Aug 4, 2023
e8e9465
Merge pull request #1780 from LiskHQ/1760-fix-semgrep-reported-issues
vardan10 Aug 4, 2023
777755c
Merge branch 'release/0.7.0' into 1752-no-response-on-blockchain-apps…
sameersubudhi Aug 4, 2023
1c58c9e
Paginate missed blocks queries
nagdahimanshu Aug 7, 2023
cfdaef2
Missing blocks queries are not triggered until genesis block is fully…
nagdahimanshu Aug 7, 2023
7292f97
🔨 Corrected skipped integration tests
vardan10 Aug 7, 2023
f231cfd
Merge branch 'release/0.7.0' into 1738-improve-gateway-test-suite
vardan10 Aug 7, 2023
52f23ee
Apply suggestions from code review
nagdahimanshu Aug 8, 2023
48e83bf
Fix eslint error
nagdahimanshu Aug 8, 2023
cb36372
Applied suggestion
nagdahimanshu Aug 8, 2023
7c01a24
Merge pull request #1782 from LiskHQ/1781-paginate-missed-blocks-queries
sameersubudhi Aug 8, 2023
a51d251
:twisted_rightwards_arrows: Merge branch 'release/0.7.0' into 1752-no…
sameersubudhi Aug 8, 2023
052fb0c
:bug: Fixed transactions and invoke tests
vardan10 Aug 8, 2023
b41b5c1
📝 Updated error messages in transaction fee estimates
vardan10 Aug 8, 2023
3a08dc1
🔬 Added unit tests for transactions dry run and fee estimates
vardan10 Aug 8, 2023
12550c9
🔄 Refactored imports, updated test descriptions and swagger
vardan10 Aug 9, 2023
1fc240e
Merge pull request #1779 from LiskHQ/1738-improve-gateway-test-suite
sameersubudhi Aug 9, 2023
413b666
:twisted_rightwards_arrows: Merge branch 'release/0.7.0' into 1752-no…
sameersubudhi Aug 9, 2023
4c59dc0
Fix transaction minFee logic
nagdahimanshu Aug 9, 2023
c1aa3fe
:hammer: Move constants to constants.js file
nagdahimanshu Aug 9, 2023
be8ee5a
:hammer: Code refactoring and add unit tests
nagdahimanshu Aug 9, 2023
1052fa7
Applied suggestions
nagdahimanshu Aug 9, 2023
339f7fa
Add unit tests
nagdahimanshu Aug 9, 2023
088ef0c
Add integration tests
nagdahimanshu Aug 9, 2023
dbd9e3e
Update swagger specs
nagdahimanshu Aug 9, 2023
c9b63a8
🌐 Added keepAliveTimeout to gateway
vardan10 Aug 9, 2023
e655cb7
📚 Updated documentation
vardan10 Aug 9, 2023
4006166
Add method to fetch chainRegistrationFee
nagdahimanshu Aug 9, 2023
fc692bb
Handle chain registration transaction
nagdahimanshu Aug 10, 2023
39d8185
🔍 Added condition to check if reverse proxy is present is gateway
vardan10 Aug 10, 2023
a7e1380
Fix unit tests
nagdahimanshu Aug 10, 2023
cabbfe3
📚 Fix documentation
vardan10 Aug 10, 2023
8f4d024
Apply suggestions from code review
sameersubudhi Aug 10, 2023
01746c6
Merge pull request #1785 from LiskHQ/1599-adjusting-keepAliveTimeout-…
sameersubudhi Aug 10, 2023
064cced
Applied suggestions
nagdahimanshu Aug 10, 2023
2c059c0
Merge pull request #1784 from LiskHQ/1783-transaction-minimum-fee-is-…
sameersubudhi Aug 10, 2023
fed2d94
:arrow_up: Update dependencies
nagdahimanshu Aug 10, 2023
5bae1a6
Update getMainchainID method
nagdahimanshu Aug 11, 2023
33b0dfb
Update gateway service
TalhaMaliktz Aug 14, 2023
a8c4211
:bug: Fixed deleted block logic and incorrect totalCommision
vardan10 Aug 14, 2023
016cba6
Update connector service
TalhaMaliktz Aug 14, 2023
7038b18
⚙ Updated default configuration
vardan10 Aug 14, 2023
9144682
Update connector service
TalhaMaliktz Aug 15, 2023
258794b
Update Makefile
nagdahimanshu Aug 15, 2023
a0e29d7
Applied suggestions
nagdahimanshu Aug 15, 2023
5479fcb
update in source.adoc
chris529 Aug 15, 2023
3b2524e
update in source.adoc
chris529 Aug 15, 2023
dc9da15
Merge pull request #1787 from LiskHQ/1776-update-lisk-sdk-to-v6-0-0-b…
sameersubudhi Aug 15, 2023
5b1fdd7
Update indexer service
TalhaMaliktz Aug 15, 2023
ae8e9a5
Update application registry service
TalhaMaliktz Aug 15, 2023
07b2fb0
🔨 Corrected variable names and added logs
vardan10 Aug 15, 2023
113095c
Update services/blockchain-indexer/shared/indexer/blockchainIndex.js
sameersubudhi Aug 15, 2023
8fa62e7
Update fee estimator service
TalhaMaliktz Aug 16, 2023
123423d
Update Transaction Statistics service
TalhaMaliktz Aug 16, 2023
ee0c931
Update Market Service
TalhaMaliktz Aug 16, 2023
f0d5a82
📝 Updated todo
vardan10 Aug 16, 2023
0d87dd8
update in source.adoc
chris529 Aug 16, 2023
5444f46
:art: Update terminologies
nagdahimanshu Aug 16, 2023
20982e0
Merge branch 'release/0.7.0' into 1800-update-terminologies
nagdahimanshu Aug 16, 2023
6748eed
Update API docs
nagdahimanshu Aug 16, 2023
4f3e697
Applied suggestions
nagdahimanshu Aug 16, 2023
951b070
🐛 Corrected logs and validator table update after delete of block
vardan10 Aug 16, 2023
3bd3a98
Update export & mySQL conf
TalhaMaliktz Aug 16, 2023
598763d
Improve tables' outlook
TalhaMaliktz Aug 16, 2023
52580dd
🔄 Optimized to fetch address from transaction instead of generating f…
vardan10 Aug 16, 2023
c660930
Update PR with the suggestions
nagdahimanshu Aug 16, 2023
cfe5cfe
Merge pull request #1796 from LiskHQ/1788-incorrect-totalCommision-value
nagdahimanshu Aug 16, 2023
7982a5c
Merge branch 'release/0.7.0' into 1800-update-terminologies
nagdahimanshu Aug 16, 2023
92ffc84
:shirt: Fix linting issues
sameersubudhi Aug 16, 2023
ccf1c19
Update services/gateway/apis/http-version3/swagger/parameters/transac…
sameersubudhi Aug 16, 2023
d27184f
Update services/blockchain-indexer/tests/unit/shared/dataservice/tran…
sameersubudhi Aug 16, 2023
9708d01
Merge pull request #1801 from LiskHQ/1800-update-terminologies
sameersubudhi Aug 16, 2023
f691f16
:twisted_rightwards_arrows: Merge branch 'release/0.7.0' into 1752-no…
sameersubudhi Aug 16, 2023
d1db5de
Proofread version
TalhaMaliktz Aug 17, 2023
5712096
Merge branch 'release/0.7.0' into 1757-Update-Lisk-Service-Configurat…
TalhaMaliktz Aug 17, 2023
0721028
Re-order export service variables
TalhaMaliktz Aug 17, 2023
7e44972
Remove redundant variables from gateway service
TalhaMaliktz Aug 17, 2023
13fc023
Apply suggestions from Sameer's review
TalhaMaliktz Aug 17, 2023
a6afae5
Replace localhost with IP
TalhaMaliktz Aug 17, 2023
207ef65
Add TODO
TalhaMaliktz Aug 17, 2023
c679a66
Remove depreciated variables
TalhaMaliktz Aug 17, 2023
aad8d23
Update docs/antora/modules/ROOT/pages/configuration/index.adoc
TalhaMaliktz Aug 17, 2023
10f07f5
:bug: Fix transaction estimate fees
nagdahimanshu Aug 17, 2023
66ff10a
:art: Rename files
nagdahimanshu Aug 17, 2023
bead594
Add note, re-order properties
TalhaMaliktz Aug 17, 2023
0ed347d
Apply suggestions from Chris' review
TalhaMaliktz Aug 17, 2023
1ca6619
Merge pull request #1799 from LiskHQ/1757-Update-Lisk-Service-Configu…
sameersubudhi Aug 17, 2023
8c9c37f
Merge pull request #1797 from LiskHQ/1768-bump-node-version-to-18-in-…
sameersubudhi Aug 17, 2023
39dd99d
Add unit test
nagdahimanshu Aug 17, 2023
2d55c42
Merge pull request #1805 from LiskHQ/1804-transaction-estimate-fees-t…
vardan10 Aug 17, 2023
5a68969
:pencil: Update swagger documentation for transactions dryrun
sameersubudhi Aug 18, 2023
a81b952
:arrow_up: Upgrade Lisk SDK to v6.0.0-beta.7
sameersubudhi Aug 21, 2023
46cea87
:hammer: Update 'localhost' to '127.0.0.1' instead
sameersubudhi Aug 21, 2023
d427a49
Fix lint issues
nagdahimanshu Aug 21, 2023
10d31bf
Apply suggestions from code review
sameersubudhi Aug 21, 2023
6eaa5e3
Merge pull request #1810 from LiskHQ/1809-update-lisk-sdk-to-v6-0-0-b…
sameersubudhi Aug 21, 2023
470c47f
:arrow_up: Version bump to 0.7.0-beta.4
sameersubudhi Aug 21, 2023
82e17b5
:twisted_rightwards_arrows: Merge branch 'release/0.7.0' into 1752-no…
sameersubudhi Aug 21, 2023
960e00f
:bug: Fix typo
sameersubudhi Aug 21, 2023
c2c3bcc
:bug: Set transaction fee when using transaction dryrun
sameersubudhi Aug 22, 2023
5ad14c6
Merge pull request #1814 from LiskHQ/1813-token-summary-returns-incor…
sameersubudhi Aug 22, 2023
b3cadf9
Fix gateway does not return response on upstream error
priojeetpriyom Aug 23, 2023
d52bbfb
Merge pull request #1818 from LiskHQ/1817-gateway-does-not-return-res…
sameersubudhi Aug 24, 2023
793f5be
🔀 Migrated codebase from npm to yarn
vardan10 Aug 29, 2023
12a0a06
Update column order
nagdahimanshu Aug 29, 2023
a75117c
🔧 Fixed inconsistencies in blockchain apps and POS APIs
vardan10 Aug 30, 2023
ff1ead9
Add utility method
nagdahimanshu Aug 30, 2023
9816b69
Merge branch 'release/0.7.0' into 1752-no-response-on-blockchain-apps…
nagdahimanshu Aug 30, 2023
1f25dd7
📝 Fixed documentation, swagger and incorrect min in API params
vardan10 Aug 31, 2023
622f470
:hammer: Refactor export implementation to update filename
nagdahimanshu Sep 4, 2023
073b88d
📝 Updated documentation and swagger
vardan10 Sep 4, 2023
b27f6cb
Update docs
nagdahimanshu Sep 4, 2023
6d26c24
🔨 Code refactoring and optimization
vardan10 Sep 4, 2023
24d82e3
📚 Updated swagger and docs to add 400 bad request status to market API
vardan10 Sep 4, 2023
940f651
Merge pull request #1834 from LiskHQ/1827-fix-API-documentation-and-s…
nagdahimanshu Sep 4, 2023
97d15a6
Merge branch 'release/0.7.0' into 1772-update-transaction-history-exp…
nagdahimanshu Sep 4, 2023
564425f
Merge branch 'release/0.7.0' into 1752-no-response-on-blockchain-apps…
nagdahimanshu Sep 4, 2023
289ee36
Merge branch 'release/0.7.0' into 1825-fix-inconsistencies-with-block…
vardan10 Sep 4, 2023
b8651d2
🔨 Code refactoring and optimization
vardan10 Sep 4, 2023
b082bcd
:hammer: Refactor code for metadata sheet
nagdahimanshu Sep 4, 2023
d3f8bba
Update docs
nagdahimanshu Sep 4, 2023
7552851
Fix unit tests
nagdahimanshu Sep 4, 2023
a960aa5
:art: Code cleanup
nagdahimanshu Sep 4, 2023
b96dc2b
Optimize code
nagdahimanshu Sep 4, 2023
bdc3f97
Update docs
nagdahimanshu Sep 4, 2023
c9fd05a
Fix eslint error
nagdahimanshu Sep 4, 2023
837e295
Add support for block reward
nagdahimanshu Sep 5, 2023
320e19c
Add unit tests
nagdahimanshu Sep 5, 2023
4359e54
Merge pull request #1833 from LiskHQ/1825-fix-inconsistencies-with-bl…
nagdahimanshu Sep 5, 2023
46d563f
Applied suggestions from code review
nagdahimanshu Sep 5, 2023
3e8a889
Applied suggestions from code review
nagdahimanshu Sep 5, 2023
56de562
Merge pull request #1836 from LiskHQ/1772-update-transaction-history-…
nagdahimanshu Sep 5, 2023
69427f3
Merge branch 'release/0.7.0' into 1752-no-response-on-blockchain-apps…
nagdahimanshu Sep 5, 2023
0a73c04
Optimize implementation
nagdahimanshu Sep 6, 2023
5822366
Fix unit tests
nagdahimanshu Sep 7, 2023
66af0d8
🔧 Updated yarn install command
vardan10 Sep 7, 2023
40e5477
Updated table of contents from contributing
vardan10 Sep 7, 2023
d9844ab
:white_check_mark: Added unit test to export microservice
vardan10 Sep 7, 2023
b1a2cd8
Merge pull request #1831 from LiskHQ/1754-migrate-from-npm-to-yarn
sameersubudhi Sep 7, 2023
19e2642
Update services/transaction-statistics/config.js
sameersubudhi Sep 7, 2023
1641e19
Merge branch 'release/0.7.0' into 1752-no-response-on-blockchain-apps…
nagdahimanshu Sep 7, 2023
c731e4a
Merge remote-tracking branch 'refs/remotes/origin/1752-no-response-on…
nagdahimanshu Sep 7, 2023
987dc87
Applied suggestions
nagdahimanshu Sep 7, 2023
d85d40f
:arrow_up: Update dependencies
nagdahimanshu Sep 7, 2023
6d5f6f5
Update Readme
nagdahimanshu Sep 7, 2023
13d105e
Fix variable name
nagdahimanshu Sep 7, 2023
2244fe6
Add unit tests
nagdahimanshu Sep 7, 2023
76585db
Merge pull request #1774 from LiskHQ/1752-no-response-on-blockchain-a…
sameersubudhi Sep 7, 2023
7565367
Merge branch 'release/0.7.0' into 1840-update-lisk-sdk-to-v6-0-0-rc-0
nagdahimanshu Sep 7, 2023
edb8271
Merge pull request #1841 from LiskHQ/1840-update-lisk-sdk-to-v6-0-0-rc-0
sameersubudhi Sep 7, 2023
15bc1bb
:arrow_up: Version bump to 0.7.0-rc.0
sameersubudhi Sep 8, 2023
ec3ad00
Merge branch service-v7 into merge-latest-lisk-server
reyraa Sep 11, 2023
86606e5
Merge latest Lisk Server Version 0.7.0-rc.1
curvesy Oct 9, 2023
f836ba9
Disable codcov and codeQL
reyraa Oct 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
✅ Adds unit tests to connector
vardan10 committed Jul 25, 2023

Unverified

This user has not yet uploaded their public signing key.
commit fc556a345e2b89a0e14edbc2f97ffa71387c5415
76 changes: 76 additions & 0 deletions services/blockchain-connector/tests/unit/fs.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
* LiskHQ/lisk-service
* Copyright © 2022 Lisk Foundation
*
* See the LICENSE file at the top-level directory of this distribution
* for licensing information.
*
* Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
* no part of this software, including this file, may be copied, modified,
* propagated, or distributed except according to the terms contained in the
* LICENSE file.
*
* Removal or modification of this copyright notice is prohibited.
*
*/

const fs = require('fs');
const tar = require('tar');
const { extractTarBall } = require('../../shared/utils/fs'); // Replace './your-module' with the actual path to your module.

// Mock the 'fs' and 'tar' modules
jest.mock('fs');
jest.mock('tar');

describe('extractTarBall function', () => {
const filePath = '/path/to/archive.tar';
const directoryPath = '/path/to/extract';

beforeEach(() => {
// Clear mock function calls and reset mock implementation before each test
fs.createReadStream.mockClear();
tar.extract.mockClear();
});

it('should extract tarball successfully', async () => {
// Mock fs.createReadStream to return a readable stream
const fileStreamMock = {
pipe: jest.fn(),
on: jest.fn((event, callback) => {
if (event === 'end') {
callback(); // Simulate the 'end' event to trigger the resolve() path
}
}),
};
fs.createReadStream.mockReturnValue(fileStreamMock);

await expect(extractTarBall(filePath, directoryPath)).resolves.toBeUndefined();

// Verify fs.createReadStream is called with the correct arguments
expect(fs.createReadStream).toHaveBeenCalledWith(filePath);

// Verify tar.extract is called with the correct arguments
expect(tar.extract).toHaveBeenCalledWith({ cwd: directoryPath });

// Verify pipe is called with the correct argument
expect(fileStreamMock.pipe).toHaveBeenCalledWith(tar.extract({ cwd: directoryPath }));
});

it('should reject with an error when fs.createReadStream encounters an error', async () => {
// Mock fs.createReadStream to return a readable stream
const fileStreamMock = {
pipe: jest.fn(),
on: jest.fn((event, callback) => {
if (event === 'error') {
callback(new Error('Some error'));
}
}),
};
fs.createReadStream.mockReturnValue(fileStreamMock);

await expect(extractTarBall(filePath, directoryPath)).rejects.toThrowError('Some error');

// Verify fs.createReadStream is called with the correct arguments
expect(fs.createReadStream).toHaveBeenCalledWith(filePath);
});
});