-
Notifications
You must be signed in to change notification settings - Fork 191
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
#347 extend pairing on approve proposal #373
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,7 +71,6 @@ final class ApproveEngine { | |
peerPublicKey: proposal.proposer.publicKey | ||
) else { throw Errors.agreementMissingOrInvalid } | ||
|
||
// TODO: Extend pairing | ||
let sessionTopic = agreementKey.derivedTopic() | ||
try kms.setAgreementSecret(agreementKey, topic: sessionTopic) | ||
|
||
|
@@ -82,7 +81,15 @@ final class ApproveEngine { | |
let proposeResponse = SessionType.ProposeResponse(relay: relay, responderPublicKey: selfPublicKey.hexRepresentation) | ||
let response = JSONRPCResponse<AnyCodable>(id: payload.wcRequest.id, result: AnyCodable(proposeResponse)) | ||
|
||
guard var pairing = pairingStore.getPairing(forTopic: payload.topic) else { | ||
throw Errors.pairingNotFound | ||
} | ||
|
||
try await networkingInteractor.respond(topic: payload.topic, response: .response(response), tag: payload.wcRequest.responseTag) | ||
|
||
try pairing.updateExpiry() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we also extending pairing in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. correct |
||
pairingStore.setPairing(pairing) | ||
|
||
try await settle(topic: sessionTopic, proposal: proposal, namespaces: sessionNamespaces) | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we care about pairing is active / inactive ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think on wallet pairing is always active
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exactly