-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add support to 32-byte chainwork to ThinConverter class #354
Add support to 32-byte chainwork to ThinConverter class #354
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Manifest Files |
|
||
class ThinConverterTest { | ||
|
||
private static final BigInteger NEGATIVE_CHAIN_WORK = BigInteger.valueOf(-1); | ||
private static final BigInteger EIGHT_BYTES_WORK_V1 = new BigInteger("ffffffffffffffff", 16); // 8 bytes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why eight? i'd just say something like BELOW_MAX_WORK_V1
. wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
private static final ECKey userKey = ECKey.fromPrivate(BigInteger.valueOf(100)); | ||
|
||
public static Stream<Arguments> validChainWorkArgsProvider() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public static Stream<Arguments> validChainWorkArgsProvider() { | |
public static Stream<Arguments> validChainWorkV2ArgsProvider() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. This includes both formats of chainwork.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how is the too large work v1 valid in v1?
); | ||
} | ||
|
||
public static Stream<Arguments> invalidChainWorkArgsProvider() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public static Stream<Arguments> invalidChainWorkArgsProvider() { | |
public static Stream<Arguments> invalidChainWorkV2ArgsProvider() { |
same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. Including both format
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
- Renamed EIGHT_BYTES_WORK_V1 constant to BELOW_MAX_WORK_V1
8dd18fd
to
877b3ce
Compare
Closing this PR in benefit of #359 using the same branch name as rskj branch |
Description
Add support to 32-byte chainwork to ThinConverter class
How Has This Been Tested?
Unit tests
Types of changes
Checklist: