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

4. change(rpc): Refactor RPCs using a state tip height function #5540

Merged
merged 1 commit into from
Nov 4, 2022

Conversation

teor2345
Copy link
Contributor

@teor2345 teor2345 commented Nov 3, 2022

Motivation

We call the same code 4 times to get the state tip height, so I made a function for it.

Review

This is a tiny refactor, anyone can review it.

Reviewer Checklist

  • Will the PR name make sense to users?
    • Does it need extra CHANGELOG info? (new features, breaking changes, large changes)
  • Are the PR labels correct?
  • Does the code do what the ticket and PR says?
  • How do you know it works? Does it have tests?

@teor2345 teor2345 requested a review from a team as a code owner November 3, 2022 04:27
@teor2345 teor2345 requested review from dconnolly and removed request for a team November 3, 2022 04:27
@teor2345 teor2345 self-assigned this Nov 3, 2022
@github-actions github-actions bot added the C-enhancement Category: This is an improvement label Nov 3, 2022
@teor2345 teor2345 added C-cleanup Category: This is a cleanup P-Medium ⚡ A-rpc Area: Remote Procedure Call interfaces C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG and removed C-enhancement Category: This is an improvement labels Nov 3, 2022
@teor2345 teor2345 changed the title 4. change(rpc): Refactor using a state tip height function 4. change(rpc): Refactor RPCs using a state tip height function Nov 3, 2022
@codecov
Copy link

codecov bot commented Nov 3, 2022

Codecov Report

Merging #5540 (3cbe5ea) into main (34313b8) will decrease coverage by 0.07%.
The diff coverage is 93.75%.

❗ Current head 3cbe5ea differs from pull request most recent head b6a557a. Consider uploading reports for the commit b6a557a to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5540      +/-   ##
==========================================
- Coverage   78.76%   78.69%   -0.08%     
==========================================
  Files         305      305              
  Lines       38114    38122       +8     
==========================================
- Hits        30022    30001      -21     
- Misses       8092     8121      +29     

arya2
arya2 previously approved these changes Nov 3, 2022
Copy link
Contributor

@arya2 arya2 left a comment

Choose a reason for hiding this comment

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

Looks good to me, thank you for the cleanup.

zebra-rpc/src/methods.rs Show resolved Hide resolved
Base automatically changed from mempool-fee-sigops to main November 3, 2022 17:03
@mergify mergify bot requested a review from a team as a code owner November 3, 2022 17:03
@mergify mergify bot requested review from oxarbitrage and removed request for a team November 3, 2022 17:03
@dconnolly
Copy link
Contributor

hm this may need a rebase
image

@teor2345
Copy link
Contributor Author

teor2345 commented Nov 3, 2022

hm this may need a rebase

GitHub does this when the workflows are different for PRs targeting main. Seems like a CI bug we should fix.

This PR will get rebased anyway, after we fix main branch failures in PR #5549.

@teor2345
Copy link
Contributor Author

teor2345 commented Nov 4, 2022

hm this may need a rebase

GitHub does this when the workflows are different for PRs targeting main. Seems like a CI bug we should fix.

I opened PR #5550 which should fix this.

@teor2345
Copy link
Contributor Author

teor2345 commented Nov 4, 2022

@Mergifyio update

@mergify
Copy link
Contributor

mergify bot commented Nov 4, 2022

update

✅ Branch has been successfully updated

@github-actions github-actions bot added the C-enhancement Category: This is an improvement label Nov 4, 2022
@teor2345 teor2345 removed the C-enhancement Category: This is an improvement label Nov 4, 2022
@teor2345 teor2345 force-pushed the refactor-tip-height branch from b9a0aff to 3cbe5ea Compare November 4, 2022 02:59
@github-actions github-actions bot added the C-enhancement Category: This is an improvement label Nov 4, 2022
@teor2345
Copy link
Contributor Author

teor2345 commented Nov 4, 2022

This PR conflicts with PR #5526, so I pushed a merge commit, and set it to merge after that PR merges.

@teor2345 teor2345 requested a review from arya2 November 4, 2022 03:00
@teor2345 teor2345 force-pushed the refactor-tip-height branch from 3cbe5ea to b6a557a Compare November 4, 2022 04:31
mergify bot added a commit that referenced this pull request Nov 4, 2022
@mergify mergify bot merged commit 75f83fc into main Nov 4, 2022
@mergify mergify bot deleted the refactor-tip-height branch November 4, 2022 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rpc Area: Remote Procedure Call interfaces C-cleanup Category: This is a cleanup C-enhancement Category: This is an improvement C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants