-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat(api): check if scalingFactor is bigger than 0 #5746
feat(api): check if scalingFactor is bigger than 0 #5746
Conversation
|
||
try { | ||
TransactionCapsule trxCap = createTransactionCapsule(trigger, | ||
ContractType.TriggerSmartContract); | ||
trx = triggerConstantContract(trigger, trxCap, trxExtBuilder, retBuilder); | ||
Transaction trx = triggerConstantContract(trigger, trxCap, trxExtBuilder, retBuilder); |
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.
Doesn't this need to be handled?
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.
This part is rollback to 4.7.3.
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.
What is the reason for this part of the direct rollback ? I see the previous analysis which is also wrong
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.
Only this part is new added:
if (scalingFactor.compareTo(BigInteger.ZERO) <= 0) {
throw new ContractValidateException("scalingFactor must be positive");
}
Other part is still same as before. Check the condition outside this method is not only easy to understand and but also include all conditions.
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.
@halibobo1205 what's wrong with previous analysis? This optimization is to coverage this additional case: contract and method scalingFactor
are both exist, but it really return 0.
What does this PR do?
Why are these changes required?
This PR has been tested by:
Follow up
Extra details