diff --git a/packages/taco/src/taco.ts b/packages/taco/src/taco.ts index e711ae6b..fc166bf0 100644 --- a/packages/taco/src/taco.ts +++ b/packages/taco/src/taco.ts @@ -11,6 +11,7 @@ import { fromHexString, getPorterUris, GlobalAllowListAgent, + PorterClient, toBytes, } from '@nucypher/shared'; import { ethers } from 'ethers'; @@ -143,6 +144,7 @@ export const decrypt = async ( const porterUrisFull: string[] = porterUris ? porterUris : await getPorterUris(domain); + const porter = new PorterClient(porterUrisFull); const ritualId = await DkgCoordinatorAgent.getRitualIdFromPublicKey( provider, @@ -152,7 +154,7 @@ export const decrypt = async ( return retrieveAndDecrypt( provider, domain, - porterUrisFull, + porter, messageKit, ritualId, context, diff --git a/packages/taco/src/tdec.ts b/packages/taco/src/tdec.ts index 7b33f9cc..97132437 100644 --- a/packages/taco/src/tdec.ts +++ b/packages/taco/src/tdec.ts @@ -61,7 +61,7 @@ export const encryptMessage = async ( export const retrieveAndDecrypt = async ( provider: ethers.providers.Provider, domain: Domain, - porterUris: string[], + porter: PorterClient, thresholdMessageKit: ThresholdMessageKit, ritualId: number, context?: ConditionContext, @@ -69,7 +69,7 @@ export const retrieveAndDecrypt = async ( const decryptionShares = await retrieve( provider, domain, - porterUris, + porter, thresholdMessageKit, ritualId, context, @@ -82,7 +82,7 @@ export const retrieveAndDecrypt = async ( const retrieve = async ( provider: ethers.providers.Provider, domain: Domain, - porterUris: string[], + porter: PorterClient, thresholdMessageKit: ThresholdMessageKit, ritualId: number, context?: ConditionContext, @@ -106,7 +106,6 @@ const retrieve = async ( thresholdMessageKit, ); - const porter = new PorterClient(porterUris); const { encryptedResponses, errors } = await porter.tacoDecrypt( encryptedRequests, ritual.threshold,