-
Notifications
You must be signed in to change notification settings - Fork 37
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
feat(jellyfish-api-core): add blockchain getChainTxStats RPC #1051
Conversation
Code Climate has analyzed commit bd21937 and detected 1 issue on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
Codecov Report
@@ Coverage Diff @@
## main #1051 +/- ##
==========================================
+ Coverage 93.20% 96.02% +2.82%
==========================================
Files 161 168 +7
Lines 4913 5009 +96
Branches 647 654 +7
==========================================
+ Hits 4579 4810 +231
+ Misses 314 192 -122
+ Partials 20 7 -13
Continue to review full report at Codecov.
|
d676195
to
721fe09
Compare
packages/jellyfish-api-core/__tests__/category/blockchain/getChainTxStats.test.ts
Outdated
Show resolved
Hide resolved
packages/jellyfish-api-core/__tests__/category/blockchain/getChainTxStats.test.ts
Outdated
Show resolved
Hide resolved
packages/jellyfish-api-core/__tests__/category/blockchain/getChainTxStats.test.ts
Outdated
Show resolved
Hide resolved
we can include another negative test for when the blockNumber exceeds the blockNumber of the blockHash and we try to |
- remove redundant type checking - change to test window_final_block_hash against block hash
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some failed test to test
getChainTxStats(num, '0') // expect 'blockhash must be of length 64'
getChainTxStats(num, '0',repeat(64)) // expect 'Block not found'
expect(stats.txcount).toStrictEqual(12) | ||
expect(stats.window_final_block_hash).toStrictEqual(blockHash) | ||
expect(stats.window_final_block_height).toStrictEqual(3) | ||
expect(stats.window_block_count).toStrictEqual(2) | ||
expect(stats.window_tx_count).toStrictEqual(2) | ||
expect(stats.window_interval).toStrictEqual(2) | ||
expect(stats.txrate).toStrictEqual(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expect(stats).toStrictEqual({
txcount: 12,
...
})
btw this works too and might be cleaner
What this PR does / why we need it:
/kind feature
Which issue(s) does this PR fixes?:
Implemented type for RPC: #48