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

added the new function hashes and updated the precompiles and tests #4067

Merged
merged 8 commits into from
Oct 27, 2022

Conversation

georg-getz
Copy link
Collaborator

Signed-off-by: Georgi Georgiev georgi.getz@outlook.com

Description:
Follow-up PR to the changes made in the smart contracts repo in order to remove uints from selectors.
It adds new versions in the AbiConstants for the smart contract functions. Precompiles and tests are updated accordingly. Due to the Expiry struct in the smart contracts repo having its numeric values changed combined with the fact that the HederaToken struct contains an Expiry type a lot of functions required a new decoding logic to be added which introduced new versions of functions being added as well.

Related issue(s):
hashgraph/hedera-smart-contracts#99
hashgraph/hedera-protobufs#235

Checklist

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

@codecov
Copy link

codecov bot commented Oct 17, 2022

Codecov Report

Base: 85.53% // Head: 96.54% // Increases project coverage by +11.01% 🎉

Coverage data is based on head (5e43497) compared to base (1af0868).
Patch coverage: 95.91% of modified lines in pull request are covered.

Additional details and impacted files
@@              Coverage Diff               @@
##             develop    #4067       +/-   ##
==============================================
+ Coverage      85.53%   96.54%   +11.01%     
- Complexity     13513    14719     +1206     
==============================================
  Files            982      982               
  Lines          47263    42021     -5242     
  Branches        5045     4251      -794     
==============================================
+ Hits           40426    40571      +145     
+ Misses          6107      714     -5393     
- Partials         730      736        +6     
Impacted Files Coverage Δ
...om/hedera/services/contracts/ParsingConstants.java 96.87% <ø> (ø)
...vices/store/contracts/precompile/AbiConstants.java 100.00% <ø> (ø)
...ore/contracts/precompile/codec/DecodingFacade.java 97.72% <ø> (ø)
...ecompile/impl/UpdateTokenExpiryInfoPrecompile.java 96.77% <90.00%> (-3.23%) ⬇️
...tore/contracts/precompile/impl/BurnPrecompile.java 96.72% <90.90%> (-1.36%) ⬇️
...tore/contracts/precompile/impl/MintPrecompile.java 97.05% <91.66%> (-1.25%) ⬇️
...tracts/precompile/impl/WipeFungiblePrecompile.java 96.66% <92.30%> (-3.34%) ⬇️
...e/contracts/precompile/HTSPrecompiledContract.java 97.56% <100.00%> (ø)
...ntracts/precompile/impl/TokenCreatePrecompile.java 97.77% <100.00%> (+0.08%) ⬆️
...ntracts/precompile/impl/TokenUpdatePrecompile.java 95.34% <100.00%> (-0.49%) ⬇️
... and 255 more

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 at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@IvanKavaldzhiev IvanKavaldzhiev left a comment

Choose a reason for hiding this comment

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

Try to extract the common logic from all decoding methods. For most of them, the only difference is passing different method signature for Tuple decode. From there, the creation of the Wrapper records follow the same logic for a given method (e.g. burn, mint, token create).

@Nana-EC
Copy link
Contributor

Nana-EC commented Oct 17, 2022

@georg-getz please note this related upcoming change also. You can add the new selector support for int64 in this case

Copy link
Collaborator

@IvanKavaldzhiev IvanKavaldzhiev left a comment

Choose a reason for hiding this comment

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

LG

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>
Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>
Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>
Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>
Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>
…y version 2

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>
Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>
Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>
@sonarcloud
Copy link

sonarcloud bot commented Oct 27, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

96.4% 96.4% Coverage
0.0% 0.0% Duplication

@georg-getz georg-getz merged commit 7a9fdad into develop Oct 27, 2022
@georg-getz georg-getz deleted the 03916-fix-uint-selectors branch October 27, 2022 17:46
lukelee-sl pushed a commit that referenced this pull request Oct 28, 2022
…4067)

Signed-off-by: Georgi Georgiev <georgi.getz@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Remove use of uints from IHederaTokenService precompile selectors
5 participants