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

#207 Update namespaces #212

Merged
merged 9 commits into from
May 17, 2022
Merged

#207 Update namespaces #212

merged 9 commits into from
May 17, 2022

Conversation

sekimondre
Copy link

closes #207, closes #202

Refactors the client to work with the new namespace spec. Does not implement validation yet.

  • Changes public API to comply to new namespace structures.
  • Apply changes to proposal and approval schemas to work with namespaces.
  • Apply namespace changes to update method.
  • Removes updateAccount method.
  • Renames updateExpiry back to extend

Temporary changes:

  • Disable CI builds for example apps.
  • Disable integration tests.

Namespace validation will be done in next PR.

@sekimondre sekimondre added this to the v2.0-beta.100 milestone May 16, 2022
@sekimondre sekimondre self-assigned this May 16, 2022
@@ -5,8 +5,7 @@ import WalletConnectKMS
import Combine

final class ControllerSessionStateMachine: SessionStateMachineValidating {
var onAccountsUpdate: ((String, Set<Account>)->())?
var onNamespacesUpdate: ((String, Set<Namespace>)->())?
var onNamespacesUpdate: ((String, [String: SessionNamespace])->())?
var onExpiryUpdate: ((String, Date)->())?
Copy link
Contributor

Choose a reason for hiding this comment

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

we could rename that callback to onExtend to not use expiry update any more

@@ -69,17 +69,17 @@ final class PairingEngine {
return uri
}

func propose(pairingTopic: String, namespaces: Set<Namespace>, relay: RelayProtocolOptions) async throws {
func propose(pairingTopic: String, namespaces: [String: ProposalNamespace], relay: RelayProtocolOptions) async throws {
Copy link
Contributor

Choose a reason for hiding this comment

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

what do you think of having a ProposalNamespaces typealias for [String: ProposalNamespace] ?

case .sessionUpdateExpiry:
case .sessionUpdate:
handleUpdateResponse(topic: response.topic, result: response.result)
case .sessionExtend:
handleUpdateExpiryResponse(topic: response.topic, result: response.result)
Copy link
Contributor

Choose a reason for hiding this comment

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

handleExtendResponse?

@@ -6,8 +6,7 @@ import Combine

final class NonControllerSessionStateMachine: SessionStateMachineValidating {

var onAccountsUpdate: ((String, Set<Account>)->())?
var onNamespacesUpdate: ((String, Set<Namespace>)->())?
var onNamespacesUpdate: ((String, [String: SessionNamespace])->())?
var onExpiryUpdate: ((String, Date) -> ())?
Copy link
Contributor

Choose a reason for hiding this comment

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

onExtend

@llbartekll llbartekll merged commit 86ea2d4 into develop May 17, 2022
@llbartekll llbartekll deleted the #207-update-namespaces branch May 17, 2022 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants