-
Notifications
You must be signed in to change notification settings - Fork 24
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
Avoid possible NPE when searching for event in past blocks #249
Conversation
pipeline:run |
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.
nice, well done
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.
Remember to rebase with master. |
src/main/java/co/rsk/federate/signing/hsm/message/ReleaseCreationInformationGetter.java
Show resolved
Hide resolved
src/main/java/co/rsk/federate/signing/hsm/message/ReleaseCreationInformationGetter.java
Outdated
Show resolved
Hide resolved
src/main/java/co/rsk/federate/signing/hsm/message/ReleaseCreationInformationGetter.java
Outdated
Show resolved
Hide resolved
src/main/java/co/rsk/federate/signing/hsm/message/ReleaseCreationInformationGetter.java
Show resolved
Hide resolved
src/test/java/co/rsk/federate/signing/hsm/message/ReleaseCreationInformationGetterTest.java
Outdated
Show resolved
Hide resolved
src/test/java/co/rsk/federate/signing/hsm/message/ReleaseCreationInformationGetterTest.java
Outdated
Show resolved
Hide resolved
src/test/java/co/rsk/federate/signing/hsm/message/ReleaseCreationInformationGetterTest.java
Outdated
Show resolved
Hide resolved
src/test/java/co/rsk/federate/signing/hsm/message/ReleaseCreationInformationGetterTest.java
Outdated
Show resolved
Hide resolved
src/test/java/co/rsk/federate/signing/hsm/message/ReleaseCreationInformationGetterTest.java
Outdated
Show resolved
Hide resolved
src/test/java/co/rsk/federate/signing/hsm/message/ReleaseCreationInformationGetterTest.java
Show resolved
Hide resolved
pipeline:run |
pipeline:run |
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
831a755
to
0f26e5c
Compare
0f26e5c
to
6a18a50
Compare
|
Summary
The method
receiptStore.getInMainChain(transaction.getHash().getBytes(), blockStore)
returns anOptional
. The code is not currently checking if the value is present in the returnedOptional
.There is no reason really for the transaction to not be in the storage, if it’s part of the block then the transaction should exist. But avoiding this check is what’s causing a code smell.
Note: Added minor refactor.
Test Plan
Added unit test, and verified with
./gradlew test