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

Autonamespace fix #1305

Merged
merged 9 commits into from
Feb 14, 2024
Merged

Autonamespace fix #1305

merged 9 commits into from
Feb 14, 2024

Conversation

llbartekll
Copy link
Contributor

Description

fixes a bug with required chains validation

Resolves # (issue)

How Has This Been Tested?

Due Dilligence

  • Breaking change
  • Requires a documentation update

Copy link
Contributor

@quetool quetool left a comment

Choose a reason for hiding this comment

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

LGTM! Just a minor comment 👌

@@ -11,8 +11,12 @@ final class SessionProposalInteractor {

let supportedRequiredChains = proposal.requiredNamespaces["eip155"]?.chains
let supportedOptionalChains = proposal.optionalNamespaces?["eip155"]?.chains ?? []
let supportedChains = (supportedRequiredChains ?? []).union(supportedOptionalChains) ?? []

var supportedChains = (supportedRequiredChains ?? []).union(supportedOptionalChains) ?? []
Copy link
Contributor

Choose a reason for hiding this comment

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

Prolly a nitpick but, would be useful to make supportedChains a Set in case supportedRequiredChains and supportedOptionalChains have repeated chains? Like [eip155:1, eip155:137, eip155:10] and [eip155:137, eip155:10, eip155:56, .....]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

union is a Set method :D

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice! I've told you I'm rusty :D

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it applies to every language

Copy link
Contributor

Choose a reason for hiding this comment

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

To every language that has it maybe :P

Copy link
Member

@arein arein left a comment

Choose a reason for hiding this comment

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

LGTM!

@llbartekll llbartekll merged commit c0849b0 into develop Feb 14, 2024
8 checks passed
@llbartekll llbartekll deleted the autonamespace-fix branch February 14, 2024 07:09
case unsupportedChains
case unsupportedMethods
case unsupportedAccounts
case upsupportedEvents
Copy link
Contributor

Choose a reason for hiding this comment

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

upsupportedEvents misspelled word

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.

4 participants