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

opt(licensing): remove hasIpAttachedLicenseTerms check #84

Merged
merged 1 commit into from
Sep 30, 2024

Conversation

sebsadface
Copy link
Member

Description

This PR optimizes IP license attachment by removing the hasIpAttachedLicenseTerms function call and replacing it with a try-catch mechanism when attaching license terms to IPs.

Test Plan

Two new test cases are added to validate the changes:

  1. test_LicenseAttachmentWorkflows_registerPILTermsAndAttach_idempotency: Ensures idempotency is maintained using the try-catch pattern.
  2. test_revert_registerPILTermsAndAttach_DerivativesCannotAddLicenseTerms: Verifies the correct error is thrown when the error is not LicenseRegistry__LicenseTermsAlreadyAttached.

Related Issue

Copy link

@kingster-will kingster-will left a comment

Choose a reason for hiding this comment

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

LGTM.

@sebsadface sebsadface merged commit 53b1e87 into storyprotocol:main Sep 30, 2024
3 checks passed
@sebsadface sebsadface deleted the license-attch-fix branch October 16, 2024 04:25
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.

Optimize Gas Usage by Removing Redundant License Registry Call
2 participants