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

Verify Update #970

Merged
merged 1 commit into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions Sources/Auth/Services/Wallet/WalletRequestSubscriber.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,11 @@ class WalletRequestSubscriber {
let assertionId = payload.decryptedPayload.sha256().toHexString()
do {
let origin = try await verifyClient.verifyOrigin(assertionId: assertionId)
let verifyContext = await verifyClient.createVerifyContext(
origin: origin,
domain: payload.request.payloadParams.domain
)
let verifyContext = verifyClient.createVerifyContext(origin: origin, domain: payload.request.payloadParams.domain)
onRequest?((request, verifyContext))
} catch {
onRequest?((request, nil))
let verifyContext = verifyClient.createVerifyContext(origin: nil, domain: payload.request.payloadParams.domain)
onRequest?((request, verifyContext))
return
}
}
Expand Down
5 changes: 3 additions & 2 deletions Sources/WalletConnectSign/Engine/Common/ApproveEngine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,14 @@ private extension ApproveEngine {
let assertionId = payload.decryptedPayload.sha256().toHexString()
do {
let origin = try await verifyClient.verifyOrigin(assertionId: assertionId)
let verifyContext = await verifyClient.createVerifyContext(
let verifyContext = verifyClient.createVerifyContext(
origin: origin,
domain: payload.request.proposer.metadata.url
)
onSessionProposal?(proposal.publicRepresentation(pairingTopic: payload.topic), verifyContext)
} catch {
onSessionProposal?(proposal.publicRepresentation(pairingTopic: payload.topic), nil)
let verifyContext = verifyClient.createVerifyContext(origin: nil, domain: payload.request.proposer.metadata.url)
onSessionProposal?(proposal.publicRepresentation(pairingTopic: payload.topic), verifyContext)
return
}
}
Expand Down
8 changes: 3 additions & 5 deletions Sources/WalletConnectSign/Engine/Common/SessionEngine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -242,13 +242,11 @@ private extension SessionEngine {
let assertionId = payload.decryptedPayload.sha256().toHexString()
do {
let origin = try await verifyClient.verifyOrigin(assertionId: assertionId)
let verifyContext = await verifyClient.createVerifyContext(
origin: origin,
domain: session.peerParticipant.metadata.url
)
let verifyContext = verifyClient.createVerifyContext(origin: origin, domain: session.peerParticipant.metadata.url)
onSessionRequest?(request, verifyContext)
} catch {
onSessionRequest?(request, nil)
let verifyContext = verifyClient.createVerifyContext(origin: nil, domain: session.peerParticipant.metadata.url)
onSessionRequest?(request, verifyContext)
return
}
}
Expand Down