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

Add HTS Precompile Acceptance Tests for Expiry Info methods #467

Merged

Conversation

georgi-l95
Copy link
Collaborator

@georgi-l95 georgi-l95 commented Aug 24, 2022

Signed-off-by: georgi-l95 glazarov95@gmail.com

Description:
Adds tests for:

  • getTokenExpiryInfo(address)
  • updateTokenExpiryInfo(address, Expiry)

Related issue(s):

Fixes #408

Notes for reviewer:
Version of network node is bumped to 0.30.0-alpha.2 . Some adjustments before starting the node, so that acceptance tests can run. This unblocks all other PRs open for HTS Precompile tests.

Checklist

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

@georgi-l95 georgi-l95 added enhancement New feature or request limechain P2 labels Aug 24, 2022
@georgi-l95 georgi-l95 added this to the 0.7.0 milestone Aug 24, 2022
@georgi-l95 georgi-l95 self-assigned this Aug 24, 2022
@georgi-l95 georgi-l95 linked an issue Aug 24, 2022 that may be closed by this pull request
@georgi-l95 georgi-l95 changed the title add tests for expiryInfo Add HTS Precompile Acceptance Tests for Expiry Info methods Aug 24, 2022
@georgi-l95 georgi-l95 marked this pull request as ready for review August 24, 2022 11:17
Copy link
Collaborator

@Nana-EC Nana-EC left a comment

Choose a reason for hiding this comment

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

LG.
Layout suggestion.
Once addressed please move this to a draft PR.
I'd prefer to not check in turned of tests so we don't forget but rather just hold off till we get the 0.30.0 services tag next sprint.

const tokenExpiryInfo = (await getTokenExpiryInfoTx.wait()).events.filter(e => e.event === 'TokenExpiryInfo')[0].args.expiryInfo;

expect(responseCode).to.equal(TX_SUCCESS_CODE);
expect(tokenExpiryInfo.autoRenewPeriod).to.equal(7776000);
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: add check for second also here and below

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

expect(tokenExpiryInfo.autoRenewAccount).to.equal(NftHTSTokenContractAddress);
});

it('should be able to update fungible token expiry info', async function() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Improvement suggestion.
Change these 4 tests into 2 tests

Test 1 ( combines your current test 1 and 3)

  • confirm getTokenExpiryInfoPublic() for FT
  • update expiry info using updateTokenExpiryInfoPublic()
  • confirm updated info

Test 2 ( combines your current test 2 and 4)

  • confirm getTokenExpiryInfoPublic() for NFT
  • update expiry info using updateTokenExpiryInfoPublic()
  • confirm updated info

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done. Updated the flow.

@Nana-EC Nana-EC modified the milestones: 0.7.0, 0.8.0 Aug 24, 2022
@georgi-l95
Copy link
Collaborator Author

Moving this PR to draft, until we get the 0.30.0 services tag next sprint.

@georgi-l95 georgi-l95 marked this pull request as draft August 25, 2022 06:45
@codecov-commenter
Copy link

codecov-commenter commented Aug 25, 2022

Codecov Report

Merging #467 (9c9e790) into main (26d110c) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #467   +/-   ##
=======================================
  Coverage   76.38%   76.38%           
=======================================
  Files          12       12           
  Lines         923      923           
  Branches      144      144           
=======================================
  Hits          705      705           
  Misses        165      165           
  Partials       53       53           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@georgi-l95 georgi-l95 force-pushed the 408-htsprecompile-acceptance-test-for-auto-renew-methods branch from 7f14fc3 to 0aa1909 Compare September 7, 2022 14:30
Signed-off-by: georgi-l95 <glazarov95@gmail.com>

update flow

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

Enable tests

Signed-off-by: Nana Essilfie-Conduah <nana@swirldslabs.com>

test refactor

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

test

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

revert some changes

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

revert some changes

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

Acceptance test index rework

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

remove typo

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

test

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

test

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

x

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

x

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

x

Signed-off-by: georgi-l95 <glazarov95@gmail.com>
@georgi-l95 georgi-l95 force-pushed the 408-htsprecompile-acceptance-test-for-auto-renew-methods branch from e5b1e86 to bbd6115 Compare September 9, 2022 07:16
Signed-off-by: georgi-l95 <glazarov95@gmail.com>
Signed-off-by: georgi-l95 <glazarov95@gmail.com>
Signed-off-by: georgi-l95 <glazarov95@gmail.com>
@sonarcloud
Copy link

sonarcloud bot commented Sep 9, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@georgi-l95 georgi-l95 marked this pull request as ready for review September 9, 2022 09:50
Copy link
Collaborator

@Nana-EC Nana-EC left a comment

Choose a reason for hiding this comment

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

LG
Please open a ticket to track us coming back and removing this workaround.
Thanks

@georgi-l95 georgi-l95 merged commit c85f187 into main Sep 9, 2022
@georgi-l95 georgi-l95 deleted the 408-htsprecompile-acceptance-test-for-auto-renew-methods branch September 9, 2022 14:10
dimitrovmaksim pushed a commit that referenced this pull request Sep 12, 2022
* add tests for expiryInfo

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

update flow

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

Enable tests

Signed-off-by: Nana Essilfie-Conduah <nana@swirldslabs.com>

test refactor

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

test

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

revert some changes

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

revert some changes

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

Acceptance test index rework

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

remove typo

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

test

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

test

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

x

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

x

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

x

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

* change

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

* bump services version and activate some tests

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

* revert some changes

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

Signed-off-by: georgi-l95 <glazarov95@gmail.com>
Signed-off-by: Maksim Dimitrov <dimitrov.maksim@gmail.com>
dimitrovmaksim pushed a commit that referenced this pull request Sep 16, 2022
* add tests for expiryInfo

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

update flow

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

Enable tests

Signed-off-by: Nana Essilfie-Conduah <nana@swirldslabs.com>

test refactor

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

test

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

revert some changes

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

revert some changes

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

Acceptance test index rework

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

remove typo

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

test

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

test

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

x

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

x

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

x

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

* change

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

* bump services version and activate some tests

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

* revert some changes

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

Signed-off-by: georgi-l95 <glazarov95@gmail.com>
Signed-off-by: Maksim Dimitrov <dimitrov.maksim@gmail.com>
dimitrovmaksim pushed a commit that referenced this pull request Sep 16, 2022
* add tests for expiryInfo

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

update flow

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

Enable tests

Signed-off-by: Nana Essilfie-Conduah <nana@swirldslabs.com>

test refactor

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

test

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

revert some changes

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

revert some changes

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

Acceptance test index rework

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

remove typo

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

test

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

test

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

x

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

x

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

x

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

* change

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

* bump services version and activate some tests

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

* revert some changes

Signed-off-by: georgi-l95 <glazarov95@gmail.com>

Signed-off-by: georgi-l95 <glazarov95@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request limechain P2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add htsPrecompile acceptance test support for expiry methods
3 participants