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

#201 required chainid #203

Merged
merged 5 commits into from
May 11, 2022
Merged

#201 required chainid #203

merged 5 commits into from
May 11, 2022

Conversation

sekimondre
Copy link

closes #201

Makes chainId a required parameter in request and event payloads.

@sekimondre sekimondre self-assigned this May 10, 2022
Comment on lines 128 to 147
// func testSessionRequestEmptyNamespaceUnmatchingMethod() {
// var didTriggerRequest = false
// engine.onSessionRequest = { _ in didTriggerRequest = true }
//
// let session = WCSession.stub(isSelfController: true)
// storageMock.setSession(session)
//
// let payload = WCRequestSubscriptionPayload.stubRequest(topic: session.topic, method: "someMethod", chainId: nil)
// networkingInteractor.wcRequestPublisherSubject.send(payload)
//
// XCTAssertTrue(networkingInteractor.didRespondError)
// XCTAssertFalse(didTriggerRequest)
// }
//
// func testSessionRequestEmptyNamespaceMatchingMethod() {
// var didTriggerRequest = false
// engine.onSessionRequest = { _ in didTriggerRequest = true }
//
// var session = WCSession.stub(isSelfController: true)
// session.updateNamespaces([Namespace(chains: [], methods: ["someMethod"], events: [])])
Copy link
Contributor

Choose a reason for hiding this comment

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

wouldn't it better to just remove it? will stay in git history for reference.

@@ -6,6 +6,7 @@ enum WalletConnectError: Error {
case noSessionMatchingTopic(String)
case sessionNotAcknowledged(String)
case pairingNotSettled(String)
case namespaceHasEmptyChains
Copy link
Contributor

Choose a reason for hiding this comment

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

personally I would prefer smth like: emptyChainsInNamespaceForbidden or invalidNamespaceStructure

@sekimondre sekimondre merged commit 3fd3b4b into develop May 11, 2022
@sekimondre sekimondre deleted the #201-required-chainid branch May 11, 2022 13:50
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