Skip to content

Conversation

@317787106
Copy link
Contributor

@317787106 317787106 commented Mar 5, 2024

What does this PR do?

Why are these changes required?

This PR has been tested by:

  • Unit Tests
  • Manual Testing

Follow up

Extra details

@317787106 317787106 changed the base branch from develop to release_v4.7.4 March 5, 2024 11:15
@317787106 317787106 requested review from halibobo1205 and jwrct March 5, 2024 12:11
TransactionCapsule trxCap = createTransactionCapsule(trigger,
ContractType.TriggerSmartContract);
trx = triggerConstantContract(trigger, trxCap, trxExtBuilder, retBuilder);
Transaction trx = triggerConstantContract(trigger, trxCap, trxExtBuilder, retBuilder);
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor Author

@317787106 317787106 Mar 5, 2024

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.

Copy link
Contributor Author

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.

@317787106 317787106 merged commit 074e0d6 into tronprotocol:release_v4.7.4 Mar 6, 2024
@halibobo1205 halibobo1205 added this to the GreatVoyage-v4.7.4 milestone Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants