Set bitcoinj-thin and bitcoinj dependencies to versions that support BTC testnet4 - #654
Open
marcos-iov wants to merge 2 commits into
Open
Set bitcoinj-thin and bitcoinj dependencies to versions that support BTC testnet4#654marcos-iov wants to merge 2 commits into
marcos-iov wants to merge 2 commits into
Conversation
8 tasks
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
marcos-iov
force-pushed
the
testnet2-integration
branch
from
July 27, 2026 20:09
f2b2144 to
4242051
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 4 changed files in this pull request and generated no new comments.
Suppressed comments (4)
src/main/java/co/rsk/federate/signing/hsm/config/NetworkDifficultyCap.java:19
- NetworkDifficultyCap has inconsistent indentation inside the constructor and getter (method bodies are not indented like the rest of the enum), which hurts readability and deviates from the style used elsewhere in this repo.
NetworkDifficultyCap(BigInteger difficultyCap) {
this.difficultyCap = difficultyCap;
}
public BigInteger getDifficultyCap() {
return difficultyCap;
}
src/main/java/co/rsk/federate/signing/hsm/config/NetworkDifficultyCap.java:9
- The new enum constant name TESTNET2 is now used to represent NetworkParameters.ID_TESTNET4. This is confusing (name doesn’t match the bitcoinj network id) and it duplicates TESTNET with the same numeric cap value; consider either mapping ID_TESTNET4 to the existing TESTNET cap, or renaming the constant to something like TESTNET4 so the code/doc match the intent.
This issue also appears on line 13 of the same file.
MAINNET(new BigInteger("7000000000000000000000")),
TESTNET2(BigInteger.valueOf(3000000000L)),
TESTNET(BigInteger.valueOf(3000000000L)),
REGTEST(BigInteger.valueOf(20L));
src/test/java/co/rsk/federate/signing/hsm/config/PowHSMConfigTest.java:159
- This newly reformatted test block uses indentation and wrapping that doesn’t match the surrounding style in this file (2-space indent, compact assert formatting). Keeping it consistent makes diffs smaller and the tests easier to scan.
void getDifficultyCap_whenGivenNetwork_shouldMatchExpectedDifficultyCap(
String networkId,
NetworkDifficultyCap expectedNetworkDifficultyCap
) {
assertEquals(
expectedNetworkDifficultyCap.getDifficultyCap(),
powHsmConfig.getDifficultyCap(networkId)
);
}
src/main/java/co/rsk/federate/signing/hsm/config/PowHSMConfig.java:133
- In PowHSMConfig, the newly edited Javadoc/method block is indented differently than the surrounding methods (extra leading spaces and deeper switch indentation). Please reformat this block to match the file’s existing indentation style to keep the codebase consistent.
/**
* Retrieves the difficulty cap for a given network parameter.
* The difficulty cap is determined based on the network type (mainnet, testnet,
* or regtest). This value will be used to determine the maximum allowed
* difficulty for any given block.
*
* @param networkParameter the network parameter identifier, which can be one of the following:
* <ul>
* <li>{@link NetworkParameters#ID_MAINNET} - Mainnet network</li>
* <li>{@link NetworkParameters#ID_TESTNET4} - Testnet4 network</li>
* <li>{@link NetworkParameters#ID_TESTNET} - Testnet network</li>
* <li>{@link NetworkParameters#ID_REGTEST} - Regtest network</li>
* </ul>
* @return the difficulty cap as a {@link BigInteger} for the specified network.
* @throws IllegalArgumentException if the provided network parameter is invalid.
*/
public BigInteger getDifficultyCap(String networkParameter) {
switch (networkParameter) {
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Motivation and Context
How Has This Been Tested?
Types of changes
Checklist:
rskj:testnet2-integration