Skip to content

Commit

Permalink
Fix contract registry not parsing contract artifacts correctly (#353)
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-roslaniec authored Oct 23, 2023
2 parents 8fb2a83 + 04b31db commit 7704553
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 7 deletions.
3 changes: 2 additions & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nucypher/shared",
"version": "0.1.0-rc.2",
"version": "0.1.0-rc.3",
"keywords": [
"pre",
"taco",
Expand Down Expand Up @@ -35,6 +35,7 @@
"lint": "eslint --ext .ts src",
"lint:fix": "pnpm lint --fix",
"package-check": "package-check",
"test": "vitest run",
"typechain": "ts-node scripts/typechain.ts",
"typedoc": "typedoc"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/shared/src/contracts/registry.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as lynxRegistryJson from '@nucypher/nucypher-contracts/deployment/artifacts/lynx.json';
import * as mainnetRegistryJson from '@nucypher/nucypher-contracts/deployment/artifacts/mainnet.json';
import * as tapirRegistryJson from '@nucypher/nucypher-contracts/deployment/artifacts/tapir.json';
import lynxRegistryJson from '@nucypher/nucypher-contracts/deployment/artifacts/lynx.json';
import mainnetRegistryJson from '@nucypher/nucypher-contracts/deployment/artifacts/mainnet.json';
import tapirRegistryJson from '@nucypher/nucypher-contracts/deployment/artifacts/tapir.json';

import { Domain } from '../porter';
import { ChecksumAddress } from '../types';
Expand Down
22 changes: 22 additions & 0 deletions packages/shared/test/registry.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { describe, expect, it } from 'vitest';

import { ChainId, ContractName, getContract } from '../src';

const testCases: [string, number, ContractName][] = [
['lynx', ChainId.MUMBAI, 'Coordinator'],
['lynx', ChainId.MUMBAI, 'GlobalAllowList'],
['lynx', ChainId.MUMBAI, 'SubscriptionManager'],
['tapir', ChainId.MUMBAI, 'Coordinator'],
['tapir', ChainId.MUMBAI, 'GlobalAllowList'],
['tapir', ChainId.MUMBAI, 'SubscriptionManager'],
];

describe('registry', () => {
for (const testCase of testCases) {
const [domain, chainId, contract] = testCase;
it(`should for domain ${domain}, chainId ${chainId}, contract ${contract}`, () => {
const contractAddress = getContract(domain, chainId, contract);
expect(contractAddress).toBeDefined();
});
}
});
5 changes: 3 additions & 2 deletions packages/taco/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nucypher/taco",
"version": "0.1.0-rc.4",
"version": "0.1.0-rc.5",
"keywords": [
"taco",
"threshold",
Expand Down Expand Up @@ -40,7 +40,7 @@
"dependencies": {
"@ethersproject/abstract-signer": "^5.7.0",
"@nucypher/nucypher-core": "0.13.0-alpha.1",
"@nucypher/shared": "0.1.0-rc.2",
"@nucypher/shared": "0.1.0-rc.3",
"semver": "^7.5.2",
"zod": "^3.22.4"
},
Expand All @@ -49,6 +49,7 @@
"@types/semver": "^7.5.0"
},
"peerDependencies": {
"@nucypher/shared": "workspace:*",
"ethers": "^5.7.2"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

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

0 comments on commit 7704553

Please sign in to comment.