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

[BUG] Duplicate function can be removed #70

Closed
Tracked by #59
sisyphusSmiling opened this issue Jun 12, 2023 · 1 comment · Fixed by #79
Closed
Tracked by #59

[BUG] Duplicate function can be removed #70

sisyphusSmiling opened this issue Jun 12, 2023 · 1 comment · Fixed by #79
Assignees
Labels
bug Something isn't working

Comments

@sisyphusSmiling
Copy link
Collaborator

Description

In contracts/HybridCustody.cdc:279, the getAddresses() function performs the same action as getChildAddresses(). This is inefficient because calling both functions returns the same functionality and result.

pub fun getAddresses(): [Address] {
    return self.accounts.keys
}
pub fun getChildAddresses(): [Address] {
    return self.accounts.keys
}

Recommendation

We recommend removing the unused function.

@sisyphusSmiling sisyphusSmiling added the bug Something isn't working label Jun 12, 2023
@austinkline austinkline self-assigned this Jun 13, 2023
@austinkline
Copy link
Collaborator

Looks like pub fun getAddresses() is a remnant before we had owned account implemented. I think we should remove that one since we have these two methods that go along each other:

        pub fun getChildAddresses(): [Address] {
            return self.accounts.keys
        }

        pub fun getOwnedAddresses(): [Address] {
            return self.ownedAccounts.keys
        }

sisyphusSmiling pushed a commit that referenced this issue Jun 14, 2023
Resolves #70 

Also found some minor test fixes I had to resolve
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants