-
Notifications
You must be signed in to change notification settings - Fork 100
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
TRST-R-4 Remove unused LicenseRegistry.setExpireTime() function #166
TRST-R-4 Remove unused LicenseRegistry.setExpireTime() function #166
Conversation
WalkthroughThe recent changes primarily revolve around transitioning the functionality of setting expiration times from the Changes
Sequence Diagram(s)sequenceDiagram
participant Test as Test Suite
participant Harness as LicenseRegistryHarness
participant Registry as LicenseRegistry
Test->>Harness: setExpirationTime(ipId, expireTime)
Harness->>Registry: call set expiration logic
Registry->>Harness: expiration set confirmed
Harness->>Test: expiration set confirmed
Poem
TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- contracts/interfaces/registries/ILicenseRegistry.sol (1 hunks)
- test/foundry/mocks/module/LicenseRegistryHarness.sol (1 hunks)
- test/foundry/registries/LicenseRegistry.t.sol (7 hunks)
- test/foundry/utils/BaseTest.t.sol (3 hunks)
Additional comments not posted (3)
test/foundry/mocks/module/LicenseRegistryHarness.sol (1)
6-12
: The implementation ofLicenseRegistryHarness
extendsLicenseRegistry
and introduces a new methodsetExpirationTime
. This method directly interacts with a presumably internal function_setExpirationTime
, which is not shown here. Ensure that the internal function properly handles permissions and state changes securely.contracts/interfaces/registries/ILicenseRegistry.sol (1)
Line range hint
1-1
: The removal ofsetExpireTime
fromILicenseRegistry
aligns with the PR's objective to clean up unused functionality. This change should simplify the interface and reduce the attack surface, provided that all dependencies and references to this function have been updated accordingly.test/foundry/registries/LicenseRegistry.t.sol (1)
6-6
: The updates in the test file correctly reflect the new structure and functionality introduced byLicenseRegistryHarness
. However, ensure comprehensive test coverage for the newsetExpirationTime
method, especially focusing on edge cases and failure modes to ensure robustness.Also applies to: 20-20, 266-392
Verification successful
The test coverage for the
setExpirationTime
method inLicenseRegistry.t.sol
appears to be present, as indicated by the multiple instances oflrHarness.setExpirationTime
found in the test file.
test/foundry/registries/LicenseRegistry.t.sol
:
- Lines containing
lrHarness.setExpirationTime
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the comprehensive test coverage for `setExpirationTime`. # Test: Search for test cases specifically targeting `setExpirationTime`. rg --type solidity --files-with-matches 'test.*setExpirationTime' test/foundry/registries/Length of output: 125
Script:
#!/bin/bash # Description: Verify the comprehensive test coverage for `setExpirationTime`. # Test: Search for test cases specifically targeting `setExpirationTime` in Solidity files. rg 'setExpirationTime' test/foundry/registries/ --type-add 'solidity:*.sol'Length of output: 660
Remove
LicenseRegistry
setExpireTime
since it's not used.Summary by CodeRabbit
New Features
LicenseRegistryHarness
(only used in tests) to mock license expiration time starts, while removingsetExpireTime
.Bug Fixes
Refactor
setExpireTime
function fromILicenseRegistry
.LicenseRegistryHarness
for setting expiration time.Tests
LicenseRegistryHarness
into license expiration scenarios.