Update missing-owner-check lint to ignore if the key of the account is compared #73
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.
The PR updates the lint to check if key of account is compared against some value. if the key is compared then the account is ignored by the lint and is not reported.
The update to the lint is as follows:
Given list of
account_expr
where eachaccount_expr
returns AccountInfoaccount_expr
==
or!=
account_expr
.key()
for Anchor and.key
for Solana AccountInfo..key()
or is a field access expression accessing.key
.The PR also makes some of the functions generic and removes redundant code.