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: Add TokenUpdateNFTs as a smart contract operation v2 #15445

Merged
merged 4 commits into from
Sep 13, 2024

Conversation

stoyanov-st
Copy link
Contributor

@stoyanov-st stoyanov-st commented Sep 12, 2024

Description:
NOTE: This PR is copied from PR
Due to DCO issues we had to open this one with the exact changes and linked issues.

Original description from initial PR

  • Add TokenUpdateNFTs as a smart contract operation - updateNFTsMetadata(address, int64[], bytes)
  • Add numeric validation test for the serial numbers of the new smart contract operation.
  • Create UpdateTokenMetadataTest.java and add success cases. Since we want to add new metadata-related operations soon, this test class can be used for them as well.
  • Add unit tests for new classes.

Related issue(s):

Fixes #14589 #14620

Notes for reviewer:

TODO

  • After confirmation of all the changes in this PR, I will open one in smart-contracts repo, to apply the changes to IHederaTokenService.sol and HederaTokenService.sol

Signed-off-by: Stanimir Stoyanov <stanimir.stoyanov@limechain.tech>
Signed-off-by: Stanimir Stoyanov <stanimir.stoyanov@limechain.tech>
Copy link

codacy-production bot commented Sep 12, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.01% (target: -1.00%) 95.45%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (1a31fa6) 109074 67377 61.77%
Head commit (88ad865) 109095 (+21) 67397 (+20) 61.78% (+0.01%)

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 (#15445) 22 21 95.45%

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

codecov bot commented Sep 12, 2024

Codecov Report

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

Project coverage is 58.24%. Comparing base (1a31fa6) to head (88ad865).
Report is 2 commits behind head on develop.

Files with missing lines Patch % Lines
...racts/hts/update/UpdateNFTsMetadataTranslator.java 77.77% 1 Missing and 1 partial ⚠️
...ce/token/impl/handlers/TokenUpdateNftsHandler.java 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             develop   #15445   +/-   ##
==========================================
  Coverage      58.23%   58.24%           
- Complexity     21602    21609    +7     
==========================================
  Files           2779     2780    +1     
  Lines         109257   109278   +21     
  Branches       11180    11181    +1     
==========================================
+ Hits           63630    63649   +19     
- Misses         41770    41771    +1     
- Partials        3857     3858    +1     
Files with missing lines Coverage Δ
...a/com/hedera/node/config/data/ContractsConfig.java 100.00% <ø> (ø)
...p/service/contract/impl/exec/gas/DispatchType.java 100.00% <100.00%> (ø)
...act/impl/exec/processors/HtsTranslatorsModule.java 100.00% <100.00%> (ø)
...exec/systemcontracts/hts/update/UpdateDecoder.java 59.84% <100.00%> (+3.29%) ⬆️
...ce/token/impl/handlers/TokenUpdateNftsHandler.java 91.42% <0.00%> (ø)
...racts/hts/update/UpdateNFTsMetadataTranslator.java 77.77% <77.77%> (ø)

Impacted file tree graph

lukelee-sl
lukelee-sl previously approved these changes Sep 12, 2024
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

# Conflicts:
#	hedera-node/configuration/dev/application.properties
#	hedera-node/hedera-config/src/main/java/com/hedera/node/config/data/ContractsConfig.java
lukelee-sl
lukelee-sl previously approved these changes Sep 13, 2024
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.

LGTM from hedera-base

# Conflicts:
#	hedera-node/hedera-config/src/main/java/com/hedera/node/config/data/ContractsConfig.java
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

@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.

LGTM!

@lukelee-sl lukelee-sl merged commit aaff32c into develop Sep 13, 2024
54 of 56 checks passed
@lukelee-sl lukelee-sl deleted the 14670-token-update-nft-metadata branch September 13, 2024 22:34
netopyr added a commit that referenced this pull request Sep 19, 2024
* develop: (22 commits)
  test: New HAPI test for TokenAirdrop transaction (#15348)
  test: unit test verifySyncInvalidEd25519() is not stable (#15534)
  chore: add `TracerBinding` interface for `TransactionExecutors`. (#15480)
  chore: Add missing javadocs in Consensus Service (#15299)
  fix: Validate `CustomFees` input arrays in `UpdateTokenCustomFeesDecoder` (#15520)
  feat: migrate event serialization to protobuf (#15417)
  fix: 15494: Improve VirtualLeafRecord serialization to bytes during flushes (#15512)
  docs: tss block signing proposal (#15160)
  fix: 15438: Eliminate busy loop in HalfDiskHashMap.endWriting() (#15439)
  build: cleanup settings.gradle.kts / remove build.gradle.kts (#15470)
  test: fix CryptographyTests (#15529)
  fix: recreate block hash from state (#15444)
  docs: Proposal Process Update - Specify post-acceptance non-material update procedure (#15447)
  chore: testnet event hashing (#15432)
  fix: 15167: Remove timeout from reconnect/rehash Iterators (#15468)
  chore: remove snapshot ops (#15462)
  feat: Add TokenUpdateNFTs as a smart contract operation v2 (#15445)
  feat: introduce PbjRecordHasher and RosterUtils.hash(Roster) (#15457)
  fix: Precision loss for gas calculation of HTS system contracts v2 (#15446)
  chore: correct the variable name in roster.proto (#15465)
  ...

# Conflicts:
#	hedera-node/hedera-smart-contract-service-impl/src/main/java/com/hedera/node/app/service/contract/impl/exec/scope/HandleHederaOperations.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants