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

HandleBroadcast use message.(type) directly #3604

Merged
merged 3 commits into from
Aug 22, 2022

Conversation

huangzhiran
Copy link
Member

Description

replace msgType, err := goproto.GetTypeFromRPCMsg(message) with switch (msg).(type) {}

Fixes #3575

Type of change

Please delete options that are not relevant.

  • Code refactor or improvement

How Has This Been Tested?

  • make test

Test Configuration:

  • Firmware version: macOS Monterey arm64
  • 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

@huangzhiran huangzhiran requested a review from a team as a code owner August 22, 2022 02:17
@CLAassistant
Copy link

CLAassistant commented Aug 22, 2022

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Aug 22, 2022

Codecov Report

Merging #3604 (946fd60) into master (a20e489) will decrease coverage by 1.51%.
The diff coverage is 60.87%.

❗ Current head 946fd60 differs from pull request most recent head 8ac4c3b. Consider uploading reports for the commit 8ac4c3b to get more accurate results

@@            Coverage Diff             @@
##           master    #3604      +/-   ##
==========================================
- Coverage   75.43%   73.91%   -1.52%     
==========================================
  Files         247      258      +11     
  Lines       22845    23488     +643     
==========================================
+ Hits        17233    17362     +129     
- Misses       4685     5210     +525     
+ Partials      927      916      -11     
Impacted Files Coverage Δ
action/action_deserializer.go 57.14% <ø> (ø)
action/protocol/poll/nativestaking.go 41.08% <0.00%> (-0.65%) ⬇️
action/protocol/poll/staking_command.go 10.71% <0.00%> (ø)
action/protocol/staking/read_state.go 15.38% <0.00%> (ø)
action/protocol/vote/probationlist.go 87.50% <ø> (ø)
api/blocklistener.go 70.73% <0.00%> (ø)
api/websocket.go 5.17% <0.00%> (-0.19%) ⬇️
blockchain/block/block_deserializer.go 71.15% <ø> (ø)
blockchain/blockchain.go 0.89% <0.00%> (ø)
blockchain/filedao/filedao_legacy.go 85.80% <ø> (ø)
... and 103 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@sonarcloud
Copy link

sonarcloud bot commented Aug 22, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@huangzhiran huangzhiran merged commit e95fb86 into iotexproject:master Aug 22, 2022
@huangzhiran huangzhiran deleted the remove_GetTypeFromRPCMsg branch August 22, 2022 12:27
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.

Remove GetTypeFromRPCMsg in dispatcher.go
4 participants