You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Possible Bug: The isAccountOwner method in Account.php merges arrays $publicKey, $walletAccounts, and $others incorrectly. $publicKey is a single string, not an array, which could lead to errors when attempting to merge. This should be wrapped in an array or handled differently.
Code Clarity: The isAccountOwner method uses a variable $others which is a string. The method signature and the comment should clarify if $others can be multiple values and how they are expected to be passed to the function.
Correct the array merging to prevent runtime errors
Modify the isAccountOwner method to correctly merge arrays. Currently, the method attempts to merge a string ($others) with arrays, which will cause an error. Instead, ensure that all elements being merged are arrays.
Why: This suggestion addresses a potential runtime error by ensuring that all elements being merged are arrays, which is crucial for the correct functioning of the isAccountOwner method.
9
Add a null check for the owner's public key to prevent exceptions
Add a null check for $collection->owner before accessing its public_key property to avoid potential null reference exceptions.
Why: Adding a null check for $collection->owner->public_key is important to prevent potential null reference exceptions, enhancing the robustness of the code.
8
Enhancement
Update the method used for address comparison to a more current version
Replace the deprecated SS58Address::isSameAddress method with a more current and supported method if available, or update its implementation to ensure compatibility.
Why: While updating deprecated methods is generally good practice, the suggestion lacks specificity about the new method to use, which reduces its immediate applicability.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Type
Enhancement, Bug fix
Description
SS58Address::isSameAddress
withAccount::isAccountOwner
.$walletAccounts
in theAccount
class.isAccountOwner
in theAccount
class to check if an account is the owner.Changes walkthrough 📝
IsCollectionOwner.php
Update collection owner validation logic
src/Rules/IsCollectionOwner.php
SS58Address::isSameAddress
withAccount::isAccountOwner
forowner validation.
SS58Address
.IsCollectionOwnerOrApproved.php
Update collection owner or approval validation logic
src/Rules/IsCollectionOwnerOrApproved.php
SS58Address::isSameAddress
withAccount::isAccountOwner
forowner or approval validation.
SS58Address
.Account.php
Add wallet accounts and account owner validation method
src/Support/Account.php
$walletAccounts
.isAccountOwner
to check if an account is the owner.