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

Commit

Permalink
Update lynx to use Polygon Amoy testnet (nucypher#507)
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-roslaniec authored Apr 4, 2024
2 parents 811cced + f28ba6d commit b50928f
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lynx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ on:

# TODO: Use variables when GH supports it for forks. See https://github.com/orgs/community/discussions/44322
env:
RPC_PROVIDER_URL: "https://polygon-mumbai.infura.io/v3/3747007a284045d483c342fb39889a30"
RPC_PROVIDER_URL: "https://rpc-amoy.polygon.technology"
ENCRYPTOR_PRIVATE_KEY: "0x900edb9e8214b2353f82aa195e915128f419a92cfb8bbc0f4784f10ef4112b86"
CONSUMER_PRIVATE_KEY: "0xf307e165339cb5deb2b8ec59c31a5c0a957b8e8453ce7fe8a19d9a4c8acf36d4"
RITUAL_ID: "5"
RITUAL_ID: "0"

jobs:
networks:
Expand Down
5 changes: 4 additions & 1 deletion examples/taco/nodejs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,11 @@ const encryptToBytes = async (messageString: string) => {
const message = toBytes(messageString);
console.log(format('Encrypting message ("%s") ...', messageString));

// TODO: Remove after fixing #506
const chain = domain === 'lynx' ? 80002 : 80001;

const hasPositiveBalance = new conditions.base.rpc.RpcCondition({
chain: 80001,
chain,
method: 'eth_getBalance',
parameters: [':userAddress', 'latest'],
returnValueTest: {
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"dependencies": {
"@ethersproject/abi": "^5.7.0",
"@ethersproject/providers": "^5.7.2",
"@nucypher/nucypher-contracts": "^0.20.0",
"@nucypher/nucypher-contracts": "^0.21.0",
"@nucypher/nucypher-core": "*",
"axios": "^1.6.8",
"deep-equal": "^2.2.3",
Expand Down
3 changes: 2 additions & 1 deletion packages/shared/src/web3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { fromHexString } from './utils';

export enum ChainId {
POLYGON = 137,
MUMBAI = 80001,
MUMBAI = 80001, // TODO(#506): Deprecate MUMBAI
AMOY = 80002,
SEPOLIA = 11155111,
ETHEREUM_MAINNET = 1,
}
Expand Down
3 changes: 2 additions & 1 deletion packages/taco/src/conditions/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export const CONTEXT_PARAM_PREFIX = ':';

export const SUPPORTED_CHAIN_IDS = [
ChainId.POLYGON,
ChainId.MUMBAI,
ChainId.MUMBAI, // TODO(#506): Deprecate MUMBAI
ChainId.AMOY,
ChainId.SEPOLIA,
ChainId.ETHEREUM_MAINNET,
];
Expand Down
3 changes: 2 additions & 1 deletion packages/taco/test/conditions/base/condition.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ describe('validation', () => {
chain: {
_errors: [
'Invalid literal value, expected 137',
'Invalid literal value, expected 80001',
'Invalid literal value, expected 80001', // TODO(#506): Deprecate MUMBAI
'Invalid literal value, expected 80002',
'Invalid literal value, expected 11155111',
'Invalid literal value, expected 1',
],
Expand Down
2 changes: 1 addition & 1 deletion packages/taco/test/conditions/conditions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('conditions', () => {

it('creates a complex condition with custom parameters', async () => {
const hasPositiveBalance = {
chain: ChainId.MUMBAI,
chain: ChainId.AMOY,
method: 'eth_getBalance',
parameters: [':userAddress', 'latest'],
returnValueTest: {
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b50928f

Please sign in to comment.