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

getByBlockNumber replaced by getByBlockHeader on tests #5259

Merged

Conversation

gfukushima
Copy link
Contributor

@gfukushima gfukushima commented Mar 23, 2023

PR description

This PR removes the getByBlockNumber from tests and replace it's usage by getByBlockHeader.

Fixed Issue(s)

Fixes #5165

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
# Conflicts:
#	ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/ProtocolScheduleBuilderTest.java
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
@github-actions
Copy link

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.
  • I have considered running ./gradlew acceptanceTestNonMainnet locally if my PR affects non-mainnet modules.
  • I thought about the changelog and included a changelog update if required.

Copy link
Contributor

@siladu siladu left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -27,6 +30,8 @@

public class MergeProtocolScheduleTest {

final BlockDataGenerator blockDataGenerator = new BlockDataGenerator();
Copy link
Contributor

Choose a reason for hiding this comment

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

redundant now?

Copy link
Contributor Author

@gfukushima gfukushima Mar 23, 2023

Choose a reason for hiding this comment

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

Removed. Thanks!

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
@@ -256,4 +257,8 @@ private BftConfigOptions createBftConfig(

return bftConfig;
}

private BlockHeader blockHeader(final long number) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is used a lot in tests, might be nice to have this as a static method in the BlockHeaderTestFixture

@gfukushima gfukushima enabled auto-merge (squash) March 23, 2023 06:03
@gfukushima gfukushima merged commit 0e36f66 into hyperledger:main Mar 23, 2023
@gfukushima gfukushima deleted the getbyblocknumber_removed_from_tests branch March 23, 2023 22:59
@gfukushima gfukushima self-assigned this Mar 24, 2023
@gfukushima gfukushima added the TeamGroot GH issues worked on by Groot Team label Mar 24, 2023
elenduuche pushed a commit to elenduuche/besu that referenced this pull request Aug 16, 2023
)

* Replace getByBlockNumber by getByBlockHeader

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>

* Replace getByBlockNumber by getByBlockHeader

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>

* Replace BlockDataGenerator by BlockHeaderTestFixture

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>

* Replace BlockDataGenerator by BlockHeaderTestFixture

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>

* Add final to method param

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>

* Replace BlockDataGEnerator by BlockHeaderTestFixture

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>

* Replace BlockDataGenerator by BlockHeaderTestFixture

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>

* Remove BlockDataGenerator

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>

---------

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
eum602 pushed a commit to lacchain/besu that referenced this pull request Nov 3, 2023
)

* Replace getByBlockNumber by getByBlockHeader

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>

* Replace getByBlockNumber by getByBlockHeader

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>

* Replace BlockDataGenerator by BlockHeaderTestFixture

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>

* Replace BlockDataGenerator by BlockHeaderTestFixture

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>

* Add final to method param

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>

* Replace BlockDataGEnerator by BlockHeaderTestFixture

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>

* Replace BlockDataGenerator by BlockHeaderTestFixture

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>

* Remove BlockDataGenerator

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>

---------

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TeamGroot GH issues worked on by Groot Team
Projects
None yet
3 participants