Skip to content

Commit

Permalink
Fill peerMetadata for Pairing
Browse files Browse the repository at this point in the history
  • Loading branch information
flypaper0 committed Dec 20, 2022
1 parent 8db3be7 commit a5ec19d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Sources/WalletConnectSign/Engine/Common/ApproveEngine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,13 @@ final class ApproveEngine {
peerParticipant: proposal.proposer,
settleParams: settleParams,
requiredNamespaces: proposal.requiredNamespaces,
acknowledged: false)
acknowledged: false
)

logger.debug("Sending session settle request")

sessionStore.setSession(session)
pairingRegisterer.updateMetadata(topic, metadata: session.peerParticipant.metadata)

let protocolMethod = SessionSettleProtocolMethod()
let request = RPCRequest(method: protocolMethod.method, params: settleParams)
Expand Down Expand Up @@ -295,6 +297,7 @@ private extension ApproveEngine {
return respondError(payload: payload, reason: .invalidUpdateRequest, protocolMethod: SessionProposeProtocolMethod())
}
proposalPayloadsStore.set(payload, forKey: proposal.proposer.publicKey)
// TODO:: setPairing metadata
onSessionProposal?(proposal.publicRepresentation())
}

Expand Down Expand Up @@ -343,6 +346,8 @@ private extension ApproveEngine {
acknowledged: true
)
sessionStore.setSession(session)
pairingRegisterer.updateMetadata(topic, metadata: session.peerParticipant.metadata)

Task(priority: .high) {
try await networkingInteractor.respondSuccess(topic: payload.topic, requestId: payload.id, protocolMethod: protocolMethod)
}
Expand Down

0 comments on commit a5ec19d

Please sign in to comment.