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
Implement FreezeService preHandle #5988
Conversation
Signed-off-by: Kim Rader <kim.rader@swirldslabs.com>
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## develop #5988 +/- ##
==============================================
+ Coverage 68.14% 91.34% +23.19%
+ Complexity 21953 16984 -4969
==============================================
Files 1960 1274 -686
Lines 133554 48540 -85014
Branches 7519 4849 -2670
==============================================
- Hits 91013 44339 -46674
+ Misses 41079 3275 -37804
+ Partials 1462 926 -536
... and 921 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Kim Rader <kim.rader@swirldslabs.com>
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 from a hedera-app perspective.
...min-service-impl/src/main/java/com/hedera/node/app/service/admin/impl/FreezeServiceImpl.java
Show resolved
Hide resolved
...vice-impl/src/main/java/com/hedera/node/app/service/admin/impl/ReadableSpecialFileStore.java
Show resolved
Hide resolved
...ervice-impl/src/main/java/com/hedera/node/app/service/admin/impl/handlers/FreezeHandler.java
Show resolved
Hide resolved
Signed-off-by: Michael Heinrichs <netopyr@users.noreply.github.com>
Signed-off-by: Kim Rader <kim.rader@swirldslabs.com>
Signed-off-by: Kim Rader <kim.rader@swirldslabs.com>
SonarCloud Quality Gate failed. |
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 from hedera-app perspective
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
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
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.
Review post merge.
|
||
// FREEZE_ONLY requires a valid start_time | ||
case FREEZE_ONLY -> verifyFreezeStartTimeIsInFuture( | ||
freezeTxn, context.getTxn().transactionID().transactionValidStart()); |
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.
Please use a new variable for context.getTxn().transactionID().transactionValidStart()
on line 82
|
||
FreezeTransactionBody freezeTxn = context.getTxn().freeze(); | ||
|
||
try { |
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.
I would suggest all validation go into a method called validate
or preCheck
or similar. And we call that method as first step in preHandle
|
||
// all checks have passed | ||
context.status(OK); |
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.
I believe the default status is OK if nothing is set. So, I think this is not needed
} catch (PreCheckException e) { | ||
// instead of catching this exception, would like to allow it to propagate up | ||
// this will be implemented in issue #5880 | ||
context.status(e.responseCode()); | ||
} |
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.
We should not be catching any exceptions and setting status on context. It should be thrown as PrecheckException
/** | ||
* Get a {@link ReadableScheduleStore} | ||
* | ||
* @return a new {@link ReadableScheduleStore} | ||
*/ |
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.
Typo ReadableSpecialFileStore
Implement FreezeService preHandle for Admin module
Issue #4464