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

Add getChainTips rpc #205

Merged
merged 5 commits into from
May 12, 2021
Merged

Add getChainTips rpc #205

merged 5 commits into from
May 12, 2021

Conversation

jingyi2811
Copy link
Contributor

/kind feature

Add getChainTips rpc

@netlify
Copy link

netlify bot commented May 11, 2021

Deploy preview for jellyfish-defi ready!

Built with commit db1724e

https://deploy-preview-205--jellyfish-defi.netlify.app

@github-actions
Copy link

github-actions bot commented May 11, 2021

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
packages/jellyfish/dist/jellyfish.umd.js 18.92 KB (+0.11% 🔺) 379 ms (+0.11% 🔺) 154 ms (-0.36% 🔽) 532 ms

@codecov
Copy link

codecov bot commented May 11, 2021

Codecov Report

Merging #205 (0bc82a0) into main (afa9c0c) will increase coverage by 0.12%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #205      +/-   ##
==========================================
+ Coverage   96.14%   96.27%   +0.12%     
==========================================
  Files          64       64              
  Lines        1558     1612      +54     
  Branches      217      217              
==========================================
+ Hits         1498     1552      +54     
  Misses         60       60              
Impacted Files Coverage Δ
...ages/jellyfish-api-core/src/category/blockchain.ts 100.00% <100.00%> (ø)
...ages/jellyfish-transaction/src/script/constants.ts 100.00% <100.00%> (ø)
...ckages/jellyfish-transaction/src/script/mapping.ts 97.82% <100.00%> (ø)
...ackages/jellyfish-transaction/src/script/crypto.ts 100.00% <0.00%> (ø)

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 72031ff...0bc82a0. Read the comment docs.

@fuxingloh fuxingloh marked this pull request as draft May 12, 2021 05:28
@jingyi2811 jingyi2811 marked this pull request as ready for review May 12, 2021 07:23
Comment on lines 248 to 252
data.status === 'invalid' ||
data.status === 'headers-only' ||
data.status === 'valid-headers' ||
data.status === 'valid-fork' ||
data.status === 'active'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use .includes to be cleaner

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise, .includes has the same problem like .toContain

Fuxing: It must always be like this, testing is like reading a narrative.
expect (actual) to be (expected)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expect(['invalid', 'headers-only', ...].includes(data.status)).toBe(true)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems similar to the code I wrote earlier.

expect(['invalid', 'headers-only', 'valid-headers', 'valid-fork', 'active']).toContain(data.status)

I followed what was taught here https://jestjs.io/docs/expect#tocontainitem

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay I shall use this -> expect(['invalid', 'headers-only', ...].includes(data.status)).toBe(true). Will commit and push before end of today

@fuxingloh fuxingloh enabled auto-merge (squash) May 12, 2021 11:34
@fuxingloh fuxingloh disabled auto-merge May 12, 2021 11:45
@fuxingloh fuxingloh requested a review from canonbrother May 12, 2021 11:46
@fuxingloh fuxingloh merged commit f37cfe7 into main May 12, 2021
@fuxingloh fuxingloh deleted the jimmy/getchaintips branch May 12, 2021 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants