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: Implements HIP-632 isAuthorized method #16364

Merged
merged 3 commits into from
Nov 5, 2024

Conversation

david-bakin-sl
Copy link
Member

Description:

Implements isAuthorized method of HIP-632.

(Better PR description forthcoming.)

Related issue(s):

Fixes #16092

Notes for reviewer:

Adding a constructor argument to HasCallAttempt - the SignatureVerifier - had effects on a lot of unrelated unit tests. Because: A new argument had to be mocked and supplied to all instantiations of that class. But in nearly all cases 5 of the 7 arguments are simply passing in mocks, which mostly don't even have givens). So the next time we add an argument to such a constructor maybe we could refactor all those calls ... or do it as a cleanup sometime sooner just in case...

Checklist

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

@david-bakin-sl david-bakin-sl added the Hedera Smart Contract Service Issues related to the Hedera Smart Contract Service. label Oct 31, 2024
@david-bakin-sl david-bakin-sl added this to the v0.56 milestone Oct 31, 2024
@david-bakin-sl david-bakin-sl self-assigned this Oct 31, 2024
Copy link

codecov bot commented Oct 31, 2024

Codecov Report

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

Project coverage is 63.38%. Comparing base (828edeb) to head (3b3b6f5).
Report is 2 commits behind head on develop.

Files with missing lines Patch % Lines
...racts/has/isauthorized/IsAuthorizedTranslator.java 88.88% 1 Missing and 1 partial ⚠️
...emcontracts/has/isauthorized/IsAuthorizedCall.java 97.61% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##             develop   #16364      +/-   ##
=============================================
+ Coverage      63.36%   63.38%   +0.02%     
- Complexity     20081    20099      +18     
=============================================
  Files           2524     2526       +2     
  Lines          93590    93655      +65     
  Branches        9801     9808       +7     
=============================================
+ Hits           59301    59366      +65     
  Misses         30689    30689              
  Partials        3600     3600              
Files with missing lines Coverage Δ
...a/com/hedera/node/config/data/ContractsConfig.java 100.00% <ø> (ø)
...act/impl/exec/processors/HasTranslatorsModule.java 100.00% <100.00%> (ø)
.../impl/exec/systemcontracts/has/HasCallAttempt.java 56.00% <100.00%> (+3.82%) ⬆️
.../impl/exec/systemcontracts/has/HasCallFactory.java 100.00% <100.00%> (ø)
...racts/has/isauthorizedraw/IsAuthorizedRawCall.java 34.34% <100.00%> (+0.66%) ⬆️
...act/impl/exec/systemcontracts/hts/ReturnTypes.java 92.30% <ø> (ø)
...emcontracts/has/isauthorized/IsAuthorizedCall.java 97.61% <97.61%> (ø)
...racts/has/isauthorized/IsAuthorizedTranslator.java 88.88% <88.88%> (ø)

... and 1 file with indirect coverage changes

Impacted file tree graph

Copy link

codacy-production bot commented Oct 31, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.02% (target: -1.00%) 96.92%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (828edeb) 96409 62763 65.10%
Head commit (3b3b6f5) 96474 (+65) 62828 (+65) 65.12% (+0.02%)

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 (#16364) 65 63 96.92%

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

Fixes #16092

Signed-off-by: David S Bakin <117694041+david-bakin-sl@users.noreply.github.com>
... and fix up 'isAuthorizedRaw' BDDs that failed due to an (undetermined) gas change

Signed-off-by: David S Bakin <117694041+david-bakin-sl@users.noreply.github.com>
@david-bakin-sl david-bakin-sl force-pushed the 16092-implement-hip632-isAuthorized branch from 939146d to 8f17af3 Compare November 5, 2024 19:19
Signed-off-by: David S Bakin <117694041+david-bakin-sl@users.noreply.github.com>
@david-bakin-sl david-bakin-sl marked this pull request as ready for review November 5, 2024 19:56
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. Just some comments for future cleanup

Copy link
Member

@kimbor kimbor left a comment

Choose a reason for hiding this comment

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

lgtm!

@david-bakin-sl david-bakin-sl merged commit c636e8f into develop Nov 5, 2024
61 of 62 checks passed
@david-bakin-sl david-bakin-sl deleted the 16092-implement-hip632-isAuthorized branch November 5, 2024 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hedera Smart Contract Service Issues related to the Hedera Smart Contract Service.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: implement HIP-632 isAuthorized
3 participants