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

Namespaces sample app #218

Merged
merged 8 commits into from
May 23, 2022
Merged

Namespaces sample app #218

merged 8 commits into from
May 23, 2022

Conversation

llbartekll
Copy link
Contributor

@llbartekll llbartekll commented May 19, 2022

  • fix sample apps
  • reenable apps builds
  • remove unused types and extensions

@llbartekll llbartekll changed the base branch from main to develop May 19, 2022 08:58
Comment on lines 163 to 176
var sessionNamespaces = [String: SessionNamespace]()
proposal.requiredNamespaces.forEach {
let caip2Namespace = $0.key
let proposalNamespace = $0.value
let accounts = Set(proposalNamespace.chains.compactMap { Account($0.absoluteString + ":\(account)") } )

let extensions: [SessionNamespace.Extension]? = proposalNamespace.extension?.map { element in
let accounts = Set(element.chains.compactMap { Account($0.absoluteString + ":\(account)") } )
return SessionNamespace.Extension(accounts: accounts, methods: element.methods, events: element.events)
}
let sessionNamespace = SessionNamespace(accounts: accounts, methods: proposalNamespace.methods, events: proposalNamespace.events, extension: extensions)
sessionNamespaces[caip2Namespace] = sessionNamespace
}
try! client.approve(proposalId: proposal.id, namespaces: sessionNamespaces)

Choose a reason for hiding this comment

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

We should definitely simplify this step, later. This works for now.

@llbartekll llbartekll merged commit bf3f119 into develop May 23, 2022
@llbartekll llbartekll deleted the namespaces-sample-app branch May 23, 2022 11:14
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.

2 participants