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

feat: HIP-1028 Implement Create and Update calls with metadata #16135

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

stoyanov-st
Copy link
Contributor

Description:

!!! NOTE: This PR is squashed version of #15136 due to verification issues !!!

This PR aims to add the implementation for CreateToken and UpdateToken system contract calls with the metadata field described in HIP-1028 included.
Also provided E2E tests for validation of the newly added flows.
The feature is behind a feature flag contracts.systemContract.metadataKeyAndFieldSupport.enabled that is only enable on dev and previewnet envs.

Related issue(s):

Fixes #14591 #15126 #14622 #15237

Notes for reviewer:
! In order to completely support getInfo function response types we need to have the System Contract versioning implemented so that we can expose new functions. Thus some of the calls for getInfo are commented for the current state.

Signed-off-by: Stanimir Stoyanov <stanimir.stoyanov@limechain.tech>
Signed-off-by: Valentin Valkanov <valentin.valkanov@limechain.tech>
Co-authored-by: Valentin Valkanov <valentin.valkanov@limechain.tech>
Copy link

codecov bot commented Oct 24, 2024

Codecov Report

Attention: Patch coverage is 80.89888% with 34 lines in your changes missing coverage. Please review.

Project coverage is 58.39%. Comparing base (a0cc065) to head (e178715).
Report is 69 commits behind head on develop.

Files with missing lines Patch % Lines
...exec/systemcontracts/hts/update/UpdateDecoder.java 42.00% 26 Missing and 3 partials ⚠️
...exec/systemcontracts/hts/create/CreateDecoder.java 95.74% 2 Missing ⚠️
...ontracts/hts/create/CreateSyntheticTxnFactory.java 91.66% 0 Missing and 1 partial ⚠️
...stemcontracts/hts/tokenkey/TokenKeyTranslator.java 75.00% 0 Missing and 1 partial ⚠️
...vice/contract/impl/exec/utils/TokenKeyWrapper.java 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##             develop   #16135      +/-   ##
=============================================
+ Coverage      58.05%   58.39%   +0.33%     
- Complexity     19765    19847      +82     
=============================================
  Files           2726     2726              
  Lines          99747    99860     +113     
  Branches       10295    10284      -11     
=============================================
+ Hits           57908    58309     +401     
+ Misses         38233    37927     -306     
- Partials        3606     3624      +18     
Files with missing lines Coverage Δ
...ode/app/hapi/utils/contracts/ParsingConstants.java 96.82% <ø> (ø)
...a/com/hedera/node/config/data/ContractsConfig.java 100.00% <ø> (ø)
...pl/exec/processors/CustomMessageCallProcessor.java 86.91% <100.00%> (ø)
...act/impl/exec/systemcontracts/hts/ReturnTypes.java 92.30% <ø> (ø)
...systemcontracts/hts/create/ClassicCreatesCall.java 58.22% <100.00%> (ø)
...c/systemcontracts/hts/create/CreateTranslator.java 100.00% <100.00%> (+62.96%) ⬆️
...c/systemcontracts/hts/update/UpdateTranslator.java 96.00% <100.00%> (+29.33%) ⬆️
...e/contract/impl/exec/utils/TokenCreateWrapper.java 56.41% <100.00%> (+56.41%) ⬆️
...ontracts/hts/create/CreateSyntheticTxnFactory.java 60.29% <91.66%> (+60.29%) ⬆️
...stemcontracts/hts/tokenkey/TokenKeyTranslator.java 88.46% <75.00%> (+31.93%) ⬆️
... and 3 more

... and 2 files with indirect coverage changes

Impacted file tree graph

Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.35% (target: -1.00%) 83.71%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (a0cc065) 99564 61377 61.65%
Head commit (e178715) 99677 (+113) 61796 (+419) 62.00% (+0.35%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#16135) 178 149 83.71%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

Copy link
Member

@lukelee-sl lukelee-sl 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
Member

@Neeharika-Sompalli Neeharika-Sompalli left a comment

Choose a reason for hiding this comment

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

I will defer to @lukelee-sl or @tinker-michaelj review on smart contract files. Changes to other files LGTM! Thanks @stoyanov-st

@stoyanov-st stoyanov-st merged commit 4f6fd61 into develop Nov 4, 2024
61 of 86 checks passed
@stoyanov-st stoyanov-st deleted the hip-1028-create-update-meta branch November 4, 2024 15:38
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.

Define and implement HTS function call for TokenCreatе
4 participants