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: versioning bdd test support with overridden TokenType function #17723

Merged
merged 18 commits into from
Feb 10, 2025

Conversation

lukelee-sl
Copy link
Member

Description:

  • Add ability to define an alternate root directory for contract files
  • Add to the @contract annotation to define a variant system contract location
  • Remove 16c translator/call class for BalanceOf
  • Add translator/call class for TokenType
  • Add a test utilizing the 16c version of TokenType

Related issue(s):

Fixes #17671

Checklist

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

@lukelee-sl lukelee-sl added this to the v0.60 milestone Feb 5, 2025
@lukelee-sl lukelee-sl self-assigned this Feb 5, 2025
@lukelee-sl lukelee-sl requested review from a team and tinker-michaelj as code owners February 5, 2025 03:47
@lukelee-sl lukelee-sl marked this pull request as draft February 5, 2025 03:47
Copy link

codecov bot commented Feb 5, 2025

Codecov Report

Attention: Patch coverage is 73.33333% with 4 lines in your changes missing coverage. Please review.

Project coverage is 68.99%. Comparing base (8590a98) to head (2ae8467).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...s/tokentype/address_0x16c/TokenTypeTranslator.java 57.14% 3 Missing ⚠️
...contract/impl/exec/utils/SystemContractMethod.java 75.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main   #17723      +/-   ##
============================================
+ Coverage     68.97%   68.99%   +0.01%     
- Complexity    22949    22953       +4     
============================================
  Files          2646     2646              
  Lines         99322    99309      -13     
  Branches      10255    10253       -2     
============================================
+ Hits          68512    68516       +4     
+ Misses        26927    26910      -17     
  Partials       3883     3883              
Files with missing lines Coverage Δ
...mpl/exec/processors/Hts0x167TranslatorsModule.java 100.00% <100.00%> (ø)
...mpl/exec/processors/Hts0x16cTranslatorsModule.java 100.00% <ø> (ø)
...act/impl/exec/processors/HtsTranslatorsModule.java 100.00% <ø> (ø)
...contract/impl/exec/processors/ProcessorModule.java 100.00% <ø> (ø)
...emcontracts/hts/balanceof/BalanceOfTranslator.java 100.00% <100.00%> (ø)
...c/systemcontracts/hts/tokentype/TokenTypeCall.java 92.30% <ø> (ø)
...s/tokentype/address_0x167/TokenTypeTranslator.java 100.00% <100.00%> (ø)
...contract/impl/exec/utils/SystemContractMethod.java 86.71% <75.00%> (+0.09%) ⬆️
...s/tokentype/address_0x16c/TokenTypeTranslator.java 75.00% <57.14%> (ø)

Impacted file tree graph

Copy link

codacy-production bot commented Feb 5, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.01% (target: -1.00%) 73.33%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (8590a98) 99105 72243 72.90%
Head commit (2ae8467) 99092 (-13) 72247 (+4) 72.91% (+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 (#17723) 15 11 73.33%

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

david-bakin-sl
david-bakin-sl previously approved these changes Feb 5, 2025
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.

I basically like this a lot and think this versioning approach will really be nice and rather easy going forward.

(I know this is still in draft but I like it already.)

But of course I can't leave well enough alone so I've suggested more work for this PR which you can either agree with or not. !!!

@david-bakin-sl
Copy link
Member

david-bakin-sl commented Feb 5, 2025

BTW the unit test problem is from BalanceOfTranslatorTest.validateNonMatchingContractIDTest - I bet you forgot to revert something there when backing out the BalanceOf method "example".

Signed-off-by: Luke Lee <[email protected]>
Signed-off-by: Luke Lee <[email protected]>
@lukelee-sl
Copy link
Member Author

BTW the unit test problem is from BalanceOfTranslatorTest.validateNonMatchingContractIDTest - I bet you forgot to revert something there when backing out the BalanceOf method "example".

yup

Copy link
Contributor

@stoyanov-st stoyanov-st left a comment

Choose a reason for hiding this comment

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

Thanks @lukelee-sl
I think we are on the right direction here.
Left some comments and you should change the tag of the PR as it is not only adding tests

@lukelee-sl lukelee-sl marked this pull request as ready for review February 7, 2025 15:49
@lukelee-sl lukelee-sl changed the title test: versioning bdd test support feat: versioning bdd test support Feb 7, 2025
@lukelee-sl lukelee-sl changed the title feat: versioning bdd test support feat: versioning bdd test support with overridden TokenType function Feb 7, 2025
Copy link
Contributor

@stoyanov-st stoyanov-st left a comment

Choose a reason for hiding this comment

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

Thanks for this @lukelee-sl !
LGTM 🚀

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 (but I'm leaving a couple of questions open for your consideration anyway)

@lukelee-sl lukelee-sl merged commit caa1996 into main Feb 10, 2025
45 of 46 checks passed
@lukelee-sl lukelee-sl deleted the 17671-versioning-bdd-test branch February 10, 2025 18:44
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.

Add overloaded method and annotations to have alternative places for looking for contract byte code
3 participants