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

update acceptance tests to use new signatures. Create new acceptance… #510

Merged
merged 8 commits into from
Sep 14, 2022

Conversation

lukelee-sl
Copy link
Member

… test to exercise old create token function signatures

Signed-off-by: lukelee-sl luke.lee@swirldslabs.com

Description:
The following pull requests updated the type signatures for functions and structures to better match protobuf and documentation.

hashgraph/hedera-smart-contracts#59
hashgraph/hedera-services#3910

Modify the solidity files to reflect the changes in the smart contracts repo.
Ensure that the acceptance tests run as expected with the new type signatures.
Create a new acceptance test to ensure that the old signature also work as expected.

Related issue(s):

Fixes #509

Notes for reviewer:

Checklist

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

…test to exercise old create token function signatures

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>
@lukelee-sl lukelee-sl self-assigned this Sep 10, 2022
@codecov-commenter
Copy link

codecov-commenter commented Sep 10, 2022

Codecov Report

Base: 76.38% // Head: 76.38% // No change to project coverage 👍

Coverage data is based on head (137b029) compared to base (c85f187).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #510   +/-   ##
=======================================
  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.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>
Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>
Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>
Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>
Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>
@Nana-EC Nana-EC self-requested a review September 12, 2022 18:38
@Nana-EC Nana-EC added enhancement New feature or request P1 process Build, test and deployment-process related tasks labels Sep 12, 2022
@Nana-EC Nana-EC added this to the 0.8.0 milestone Sep 12, 2022
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
I think we can rearrange the dir structure and tests case setup

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>
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.

I think we should reorganize to ensure tests are more contained and easy to follow but also not rely on sequential ordering

packages/server/tests/acceptance/htsPrecompile_v1.spec.ts Outdated Show resolved Hide resolved
});
const txReceipt = await tx.wait();
const { tokenAddress } = txReceipt.events.filter(e => e.event === 'CreatedToken')[0].args;

return tokenAddress;
}

it('should deploy baseHTSContract', 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.

I guess what i meant was you could create the the token, instantiate the contract from the address and associate in one test for the 3 scenarios.

Basically

  • should createHTSToken & should associate to a token would merge
  • should createNftHTSToken & should associate to a nft would merge
  • should createHTSTokenWithCustomFees & should associate to a token with custom fees would merge

should finsh setting up contracts shouldn't really be a thing.
The first parts can go into the tests where the Address is used and the wallet creations would be in the beforeAll

Just trying to make things contained but also ensure that it doesn't matter in what order tests are run

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>
@sonarcloud
Copy link

sonarcloud bot commented Sep 14, 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

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

@lukelee-sl lukelee-sl merged commit 44c4164 into main Sep 14, 2022
@lukelee-sl lukelee-sl deleted the 509-test-create-tokens branch September 14, 2022 13:57
dimitrovmaksim pushed a commit that referenced this pull request Sep 16, 2022
…#510)

* update acceptance tests to use new signatures.  Create new acceptance test to exercise old create token function signatures

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>

* increase fees for account

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>

* update description of HTS Precompile V1 test

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>

* adjust fees

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>

* increase fee for v1 acceptance tests

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>

* increase fee for v1 acceptance tests once more

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>

* address review comments

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>

* refactor tests

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>
Signed-off-by: Maksim Dimitrov <dimitrov.maksim@gmail.com>
dimitrovmaksim pushed a commit that referenced this pull request Sep 16, 2022
…#510)

* update acceptance tests to use new signatures.  Create new acceptance test to exercise old create token function signatures

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>

* increase fees for account

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>

* update description of HTS Precompile V1 test

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>

* adjust fees

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>

* increase fee for v1 acceptance tests

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>

* increase fee for v1 acceptance tests once more

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>

* address review comments

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>

* refactor tests

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.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 P1 process Build, test and deployment-process related tasks
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add tests to cover the updated type signatures for HederaToken and createToken functions
3 participants