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

Refactor QbftExtraDataCodec from new instance to injection #2645

Merged
merged 4 commits into from
Aug 18, 2021

Conversation

lucassaldanha
Copy link
Member

@lucassaldanha lucassaldanha commented Aug 17, 2021

PR description

  • Updated RoundChange and ProposalPayload decode() methods to accept a BftExtraDataCodec implementation (instead of creating a new instance of QbftExtraDataCodec.
  • A bit of plumbing work all the way to QbftBesuControllerBuilder, where we choose the concrete codec instance to use.
  • For the tests, we are using the QbftExtraDataCodec (to keep the previous behaviour)

fixes #2648

Changelog

Signed-off-by: Lucas Saldanha <lucascrsaldanha@gmail.com>
Signed-off-by: Lucas Saldanha <lucascrsaldanha@gmail.com>
@lucassaldanha lucassaldanha requested a review from jframe August 17, 2021 11:10
@@ -47,6 +49,7 @@
import com.google.common.collect.Lists;

public class RoundSpecificPeers {
private static final BftExtraDataCodec bftExtraDataCodec = new QbftExtraDataCodec();
Copy link
Contributor

Choose a reason for hiding this comment

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

Be better to pass in the constructor from TestContext so we can write PKI integration tests

Signed-off-by: Lucas Saldanha <lucascrsaldanha@gmail.com>
Signed-off-by: Lucas Saldanha <lucascrsaldanha@gmail.com>
Copy link
Contributor

@jframe jframe left a comment

Choose a reason for hiding this comment

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

LGTM

@lucassaldanha lucassaldanha merged commit 6039730 into hyperledger:main Aug 18, 2021
@lucassaldanha lucassaldanha deleted the RefactorCodecInjection branch August 18, 2021 02:23
eum602 pushed a commit to lacchain/besu that referenced this pull request Nov 3, 2023
…er#2645)

* Removed static codec on RoundChange
* Removed static codec on ProposalPayload

Signed-off-by: Lucas Saldanha <lucascrsaldanha@gmail.com>
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.

Refactor QbftExtraDataCodec from new instance to injection
2 participants