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-904 Reject Tokens System Contract implementation #16118

Merged
merged 10 commits into from
Oct 28, 2024

Conversation

stoyanov-st
Copy link
Contributor

Description:
This PR aims to implement the Reject Tokens system contract described in https://github.com/hashgraph/hedera-services/pull/15435/files?short_path=03ab1e7#diff-03ab1e73f0ded9a04739c3b1a68c13f779dce416cd2f7b6637b03d8e2e41e105

Related issue(s):

Fixes #15591

Notes for reviewer:
This feature is only enabled for dev and previewnet envs

Checklist

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

Signed-off-by: Stanimir Stoyanov <stanimir.stoyanov@limechain.tech>
Signed-off-by: Stanimir Stoyanov <stanimir.stoyanov@limechain.tech>
@stoyanov-st stoyanov-st added this to the v0.56 milestone Oct 23, 2024
@stoyanov-st stoyanov-st self-assigned this Oct 23, 2024
Copy link

codacy-production bot commented Oct 23, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.05% (target: -1.00%) 98.91%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (6e61aac) 99901 61811 61.87%
Head commit (8fe2f76) 100052 (+151) 61952 (+141) 61.92% (+0.05%)

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 (#16118) 92 91 98.91%

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 Oct 23, 2024

Codecov Report

Attention: Patch coverage is 97.82609% with 2 lines in your changes missing coverage. Please review.

Project coverage is 58.32%. Comparing base (6e61aac) to head (8fe2f76).
Report is 15 commits behind head on develop.

Files with missing lines Patch % Lines
...racts/hts/rejecttokens/RejectTokensTranslator.java 94.11% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##             develop   #16118      +/-   ##
=============================================
+ Coverage      58.27%   58.32%   +0.05%     
- Complexity     19903    19943      +40     
=============================================
  Files           2730     2733       +3     
  Lines         100084   100237     +153     
  Branches       10337    10350      +13     
=============================================
+ Hits           58325    58466     +141     
- Misses         38136    38148      +12     
  Partials        3623     3623              
Files with missing lines Coverage Δ
...p/service/contract/impl/exec/gas/DispatchType.java 100.00% <100.00%> (ø)
...act/impl/exec/processors/HtsTranslatorsModule.java 100.00% <100.00%> (ø)
...ontracts/hts/rejecttokens/RejectTokensDecoder.java 100.00% <100.00%> (ø)
...racts/hts/rejecttokens/RejectTokensTranslator.java 94.11% <94.11%> (ø)

... and 34 files with indirect coverage changes

Impacted file tree graph

Signed-off-by: Stanimir Stoyanov <stanimir.stoyanov@limechain.tech>
Signed-off-by: Stanimir Stoyanov <stanimir.stoyanov@limechain.tech>
Signed-off-by: Stanimir Stoyanov <stanimir.stoyanov@limechain.tech>
…ract

# Conflicts:
#	hedera-node/hedera-smart-contract-service-impl/src/main/java/com/hedera/node/app/service/contract/impl/exec/gas/DispatchType.java
#	hedera-node/hedera-smart-contract-service-impl/src/main/java/com/hedera/node/app/service/contract/impl/exec/processors/HtsTranslatorsModule.java
@stoyanov-st stoyanov-st marked this pull request as ready for review October 24, 2024 10:11
@stoyanov-st stoyanov-st requested review from a team and tinker-michaelj as code owners October 24, 2024 10:11
…ract

# Conflicts:
#	hedera-node/hedera-smart-contract-service-impl/src/main/java/com/hedera/node/app/service/contract/impl/exec/gas/DispatchType.java
#	hedera-node/hedera-smart-contract-service-impl/src/main/java/com/hedera/node/app/service/contract/impl/exec/processors/HtsTranslatorsModule.java
#	hedera-node/test-clients/src/main/java/com/hedera/services/bdd/spec/dsl/contracts/TokenRedirectContract.java
Copy link

Node: HAPI Test (Restart) Results

7 tests   1 ✅  2m 6s ⏱️
8 suites  0 💤
9 files    6 ❌
1 errors

For more details on these parsing errors and failures, see this check.

Results for commit d80872a.

david-bakin-sl
david-bakin-sl previously approved these changes Oct 25, 2024
Copy link
Member

@david-bakin-sl david-bakin-sl left a comment

Choose a reason for hiding this comment

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

Except for the DispatchType thing, no other problems, but improvements could be made to unit tests similarly to the token cancel PR.

Gave the LGTM because I forgot about the DispatchType issue. That seems important enough to fix now?

…ract

# Conflicts:
#	hedera-node/hedera-smart-contract-service-impl/src/main/java/com/hedera/node/app/service/contract/impl/exec/gas/DispatchType.java
#	hedera-node/hedera-smart-contract-service-impl/src/main/java/com/hedera/node/app/service/contract/impl/exec/processors/HtsTranslatorsModule.java
#	hedera-node/test-clients/src/main/java/com/hedera/services/bdd/spec/dsl/contracts/TokenRedirectContract.java
Signed-off-by: Stanimir Stoyanov <stanimir.stoyanov@limechain.tech>
Copy link
Member

@david-bakin-sl david-bakin-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

@stoyanov-st stoyanov-st merged commit 9cc0ab8 into develop Oct 28, 2024
54 of 55 checks passed
@stoyanov-st stoyanov-st deleted the 15591-token-reject-system-contract branch October 28, 2024 16:32
stoyanov-st added a commit that referenced this pull request Oct 28, 2024
Signed-off-by: Stanimir Stoyanov <stanimir.stoyanov@limechain.tech>
Evdokia-Georgieva pushed a commit that referenced this pull request Oct 31, 2024
Signed-off-by: Stanimir Stoyanov <stanimir.stoyanov@limechain.tech>
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.

HIP-904: Token Reject System Contract
3 participants