Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
chore(ci): update mainnet example
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-roslaniec committed Jul 4, 2024
1 parent 0d25f33 commit b61d7cc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/mainnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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://polygon.llamarpc.com'
ENCRYPTOR_PRIVATE_KEY: ${{ secrets.MAINNET_ENCRYPTOR_PRIVATE_KEY }}
CONSUMER_PRIVATE_KEY: ${{ secrets.MAINNET_CONSUMER_PRIVATE_KEY }}
RITUAL_ID: "9"
Expand Down
14 changes: 13 additions & 1 deletion packages/taco/examples/encrypt-decrypt.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { ChainId } from '@nucypher/shared';
import { ethers } from 'ethers';

import { ChainId } from '@nucypher/shared';
import {
conditions,
decrypt,
domains,
encrypt,
getPorterUri,
initialize,
isAuthorized,
ThresholdMessageKit,
toBytes,
} from '../src';
Expand Down Expand Up @@ -35,6 +36,17 @@ const run = async () => {
ritualId,
web3Provider.getSigner(),
);

// Calling it after the encryption because we need material from messageKit
const isEncryptorAuthenticated = await isAuthorized(
web3Provider,
domains.TESTNET,
messageKit,
ritualId,
);
if (!isEncryptorAuthenticated) {
throw new Error('Not authorized');
}
return messageKit;
};

Expand Down

0 comments on commit b61d7cc

Please sign in to comment.