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

[api] Move generateBlockMeta to grpcserver.go #3303

Merged

Conversation

LuckyPigeon
Copy link
Contributor

@LuckyPigeon LuckyPigeon commented Apr 15, 2022

Description

Move generateBlockMeta to grpcserver.go

Fixes # 3271

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • TestGrpcServer_GetBlockMetasIntegrity
  • TestGrpcServer_GetBlockMetaIntegrity

Test Configuration:

  • Firmware version: Ubuntu 21.04
  • Hardware:
  • Toolchain:
  • SDK:

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@codecov
Copy link

codecov bot commented Apr 15, 2022

Codecov Report

Merging #3303 (95f0364) into master (fd6561a) will increase coverage by 0.01%.
The diff coverage is 94.44%.

@@            Coverage Diff             @@
##           master    #3303      +/-   ##
==========================================
+ Coverage   75.12%   75.13%   +0.01%     
==========================================
  Files         243      243              
  Lines       22503    22506       +3     
==========================================
+ Hits        16906    16911       +5     
+ Misses       4676     4673       -3     
- Partials      921      922       +1     
Impacted Files Coverage Δ
api/grpcserver.go 79.62% <93.75%> (+0.99%) ⬆️
api/coreservice.go 67.65% <100.00%> (-0.82%) ⬇️
consensus/scheme/rolldpos/rolldposctx.go 74.08% <0.00%> (+0.48%) ⬆️

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 fd6561a...95f0364. Read the comment docs.

@LuckyPigeon LuckyPigeon marked this pull request as ready for review April 15, 2022 09:05
@LuckyPigeon LuckyPigeon requested a review from a team as a code owner April 15, 2022 09:05
@Liuhaai
Copy link
Member

Liuhaai commented Apr 19, 2022

this pr is to be reviewed after #3298 is merged

@Liuhaai Liuhaai removed the pending label Jun 1, 2022
@Liuhaai
Copy link
Member

Liuhaai commented Jun 1, 2022

The goal of the issue is to remove BlockMeta from coreservice, which might involve numbers of refactor work. Do you want to continue working on this issue? @LuckyPigeon

@LuckyPigeon
Copy link
Contributor Author

@Liuhaai
Sure!

@Liuhaai Liuhaai added the pending label Jun 2, 2022
@Liuhaai
Copy link
Member

Liuhaai commented Jun 2, 2022

@Liuhaai Sure!

you could remove the pending label when the pr is ready for review

@LuckyPigeon
Copy link
Contributor Author

LuckyPigeon commented Jun 10, 2022

@Liuhaai
Seems generateBlockMeta has already moved to grpcserver.go.
BTY, I have no authority to remove pending tag.

@Liuhaai Liuhaai removed the pending label Jun 20, 2022
@Liuhaai
Copy link
Member

Liuhaai commented Jun 20, 2022

@Liuhaai Seems generateBlockMeta has already moved to grpcserver.go. BTY, I have no authority to remove pending tag.

could you give a link to generateBlockMeta?

@LuckyPigeon
Copy link
Contributor Author

Here you go

func generateBlockMeta(blk *block.Block) *iotextypes.BlockMeta {

@Liuhaai
Copy link
Member

Liuhaai commented Jun 25, 2022

remove BlockMeta from coreservice

BlockMeta in coreservice should be removed to solve this issue as well

@LuckyPigeon
Copy link
Contributor Author

LuckyPigeon commented Jun 25, 2022

Both BlockMetas and BlockMetaByHash seems necessary tocoreservice.go, and they both rely on generateBlockMeta, so I think there might be no func to remove.
Unless we need to combine them with generateBlockMeta.

@Liuhaai
Copy link
Member

Liuhaai commented Jun 27, 2022

Both BlockMetas and BlockMetaByHash seems necessary tocoreservice.go, and they both rely on generateBlockMeta, so I think there might be no func to remove. Unless we need to combine them with generateBlockMeta.

ok, thx for the pr. I will complete remaining work in the following pr.

@dustinxie dustinxie merged commit 40667e5 into iotexproject:master Jun 27, 2022
pocockn added a commit to pocockn/iotex-core that referenced this pull request Jul 4, 2022
* upstream/master: (24 commits)
  account type with zero init nonce (iotexproject#3387)
  [api] Separate Server and Server Handler (iotexproject#3485)
  [ioctl] Build hdwallet derive command line into new ioctl (iotexproject#3418)
  [ioctl] Build hdwallet create command line into new ioctl (iotexproject#3470)
  [makefile] add go mod tidy (iotexproject#3471)
  [api] update chain metrics (iotexproject#3484)
  remove config.EVMNetworkID() (iotexproject#3460)
  [filedao] remove checkMasterChainDBFile() (iotexproject#3463)
  [api] add crashlog (iotexproject#3456)
  [api] Move generateBlockMeta to grpcserver.go (iotexproject#3303)
  [ioctl] Build action hash command line into new ioctl (iotexproject#3425)
  [ioctl] Build hdwallet export command line into new ioctl (iotexproject#3423)
  [ioctl] Refactor nodereward command in new ioctl (iotexproject#3416)
  [ioctl] Cleanup TestNewNodeDelegateCmd (iotexproject#3421)
  [blockchain] Remove BoltDBDaoOption (iotexproject#3465)
  remove InMemDaoOption (iotexproject#3464)
  [action] add evm london test (iotexproject#3402)
  [ioctl] create main for ioctl/newcmd (iotexproject#3296)
  [ioctl] Build block bucket command line into new ioctl (iotexproject#3386)
  [ioctl] Build hdwallet import command line into new ioctl (iotexproject#3419)
  ...
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.

[api] move generateBlockMeta to grpcserver.go
3 participants