Skip to content

Conversation

@bpolania
Copy link
Contributor

@bpolania bpolania commented Feb 6, 2025

Description

This PR adds edge cases and more complex tests to the ipAsset module integration tests.

let parentIpId: Hex;

before(async () => {
client = getStoryClient();
Copy link
Contributor

Choose a reason for hiding this comment

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

isn't this already created in the outer describe?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. I needed to reset the scope to force some errors.

const res = await client.license.registerNonComSocialRemixingPIL({
txOptions: { waitForTransaction: true },
});
noCommercialLicenseTermsId = res.licenseTermsId!;
Copy link
Contributor

Choose a reason for hiding this comment

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

we should try to reuse items like this and ips when possible to reduce the run time of our integration tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ideally, we should try, but in some cases, since we are trying multiple configurations, they need to be reset anyway. In other cases, they are out of scope.

Copy link
Contributor

@DracoLi DracoLi Feb 7, 2025

Choose a reason for hiding this comment

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

in this case, shouldn't noCommercialLicenseTermsId be the same ID as the one you have in the outer scope? Since the terms are the same, the POC should return the same license id i believe. So we can avoid doing multical rpc calls here just to fetch the same id.

tokenId: tokenId!,
txOptions: { waitForTransaction: true },
});
parentIpId = parentIpResponse.ipId!;
Copy link
Contributor

Choose a reason for hiding this comment

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

we can probably reuse the parent ip created earlier

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The previous parentIpId is out of scope, i.e., not in the same describe

Copy link
Contributor

Choose a reason for hiding this comment

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

we do have a parentIpId in the most outer scope IP Asset Functions. I understand if we need a brand new IP with a clean state. But if we don't or can avoid it, then lets try to reuse.

Copy link
Contributor

@DracoLi DracoLi left a comment

Choose a reason for hiding this comment

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

Tests look great. my comments on reducing RPC usage if possible is not blocking but a general item we should be considering whenever we add more tests.

@bpolania bpolania merged commit 2ff7e2d into dev Feb 7, 2025
17 checks passed
@bpolania bpolania deleted the bp/tests/integration/ipAsset/coverage/1 branch February 7, 2025 19:09
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.

3 participants