diff --git a/.github/workflows/mainnet.yml b/.github/workflows/mainnet.yml index 852fd57f1..c75d8f5ed 100644 --- a/.github/workflows/mainnet.yml +++ b/.github/workflows/mainnet.yml @@ -7,7 +7,7 @@ on: # TODO: Use variables when GH supports it for forks. See https://github.com/orgs/community/discussions/44322 env: - RPC_PROVIDER_URL: "https://rpc-mainnet.maticvigil.com" + RPC_PROVIDER_URL: 'https://rpc-amoy.polygon.technology' ENCRYPTOR_PRIVATE_KEY: ${{ secrets.MAINNET_ENCRYPTOR_PRIVATE_KEY }} CONSUMER_PRIVATE_KEY: ${{ secrets.MAINNET_CONSUMER_PRIVATE_KEY }} RITUAL_ID: "9" diff --git a/examples/taco/nodejs/src/index.ts b/examples/taco/nodejs/src/index.ts index 42d453f1c..9d5b595c5 100644 --- a/examples/taco/nodejs/src/index.ts +++ b/examples/taco/nodejs/src/index.ts @@ -8,6 +8,7 @@ import { fromBytes, getPorterUri, initialize, + isAuthorized, ThresholdMessageKit, toBytes, toHexString, @@ -72,6 +73,17 @@ const encryptToBytes = async (messageString: string) => { encryptorSigner, ); + // Calling it after the encryption because we need material from messageKit + const isEncryptorAuthenticated = await isAuthorized( + provider, + domain, + messageKit, + ritualId, + ); + if (!isEncryptorAuthenticated) { + throw new Error('Not authorized'); + } + return messageKit.toBytes(); };