Skip to content
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

Fix contract deployment with value (0.117) #9703

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

kselveliev
Copy link
Contributor

@kselveliev kselveliev commented Nov 4, 2024

Description:

Cherry pick fix from -> 6a42166

This PR fixes contract deployment when the contract deployment is made with value.

This PR modifies :
Modified ContractCallRequest - change the 'to' validation to check if the call is for contract deployment

BytecodeUtils - Added a new method isInitBytecode which checks if a given data is an init bytecode - needed in ContractCallRequest validation

ContractControllerTest - Added new test and modified a few existing ones based on the new changes to the validation of the to field.

Modified ContractCallAddressThisTest - added tests for deployment of payable contract with and without value
Modified ContractCallServiceERCTokenModificationFunctionsTest - added tests for deployment of non payable contract with and without value.

Related issue(s):

Fixes #9636

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

This PR fixes contract deployment when the contract deployment is made with value.

This PR modifies :
Modified ContractCallRequest - change the 'to' validation to check if the call is for contract deployment

BytecodeUtils - Added a new method isInitBytecode which checks if a given data is an init bytecode - needed in ContractCallRequest validation

ContractControllerTest - Added new test and modified a few existing ones based on the new changes to the validation of the to field.

Modified ContractCallAddressThisTest - added tests for deployment of payable contract with and without value
Modified ContractCallServiceERCTokenModificationFunctionsTest - added tests for deployment of non payable contract with and without value.

---------

Signed-off-by: Kristiyan Selveliev <kristiyan.selveliev@limechain.tech>
@kselveliev kselveliev self-assigned this Nov 4, 2024
@steven-sheehy steven-sheehy added this to the 0.117.0 milestone Nov 4, 2024
@steven-sheehy steven-sheehy added bug Type: Something isn't working web3 Area: Web3 API labels Nov 4, 2024
@steven-sheehy steven-sheehy changed the title 09636-cherry pick Fix contract deployment with value (0.117) Nov 4, 2024
Copy link
Collaborator

@xin-hedera xin-hedera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

codecov bot commented Nov 4, 2024

Codecov Report

Attention: Patch coverage is 85.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 92.22%. Comparing base (3b1bb87) to head (1f4323c).
Report is 1 commits behind head on release/0.117.

Files with missing lines Patch % Lines
...va/com/hedera/mirror/web3/utils/BytecodeUtils.java 83.33% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@                 Coverage Diff                 @@
##             release/0.117    #9703      +/-   ##
===================================================
- Coverage            92.23%   92.22%   -0.01%     
- Complexity            7609     7622      +13     
===================================================
  Files                  933      934       +1     
  Lines                32000    32019      +19     
  Branches              4042     4045       +3     
===================================================
+ Hits                 29515    29530      +15     
- Misses                1536     1537       +1     
- Partials               949      952       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

sonarcloud bot commented Nov 4, 2024

@steven-sheehy steven-sheehy merged commit aaca64d into release/0.117 Nov 4, 2024
32 of 33 checks passed
@steven-sheehy steven-sheehy deleted the 09636-cherry-pick branch November 4, 2024 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Type: Something isn't working web3 Area: Web3 API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants