Skip to content

Commit

Permalink
Merge pull request #118 from theref/default
Browse files Browse the repository at this point in the history
Remove default chain id and references to ibex
  • Loading branch information
theref authored Dec 5, 2022
2 parents ab2b0be + ae6cd07 commit 4fa49fb
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/react-craco/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function App() {

const config = {
// Public Porter endpoint on Ibex network
porterUri: 'https://porter-ibex.nucypher.community',
porterUri: 'https://porter-tapir.nucypher.community',
};

const makeAlice = () => {
Expand Down
2 changes: 1 addition & 1 deletion examples/react-webpack-5-experiments/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function App() {

const config = {
// Public Porter endpoint on Ibex network
porterUri: 'https://porter-ibex.nucypher.community',
porterUri: 'https://porter-tapir.nucypher.community',
}

const makeAlice = () => {
Expand Down
2 changes: 1 addition & 1 deletion examples/webpack-5-experiments/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const txtEncoder = new TextEncoder();

const config = {
// Public Porter endpoint on Ibex network
porterUri: 'https://porter-ibex.nucypher.community',
porterUri: 'https://porter-tapir.nucypher.community',
}

const makeAlice = (provider) => {
Expand Down
2 changes: 1 addition & 1 deletion examples/webpack-bundler/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ethers } from 'ethers';

const config = {
// Public Porter endpoint on Ibex network
porterUri: 'https://porter-ibex.nucypher.community',
porterUri: 'https://porter-tapir.nucypher.community',
}

const makeAlice = (provider) => {
Expand Down
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const CONFIGS: { readonly [key in ChainId]: Configuration } = {
porterUri: 'https://porter.nucypher.community',
},
[ChainId.MUMBAI]: {
porterUri: 'https://porter-ibex.nucypher.community',
porterUri: 'https://porter-tapir.nucypher.community',
},
};

Expand Down
2 changes: 0 additions & 2 deletions src/policies/conditions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ class EvmCondition extends Condition {

class ERC721Ownership extends EvmCondition {
readonly defaults = {
chain: 5, // TODO: make this value configurable
method: 'ownerOf',
parameters: [],
standardContractType: 'ERC721',
Expand All @@ -312,7 +311,6 @@ class ERC721Ownership extends EvmCondition {

class ERC721Balance extends EvmCondition {
readonly defaults = {
chain: 5, // TODO: make this value configurable
method: 'balanceOf',
parameters: [':userAddress'],
standardContractType: 'ERC721',
Expand Down
7 changes: 7 additions & 0 deletions test/integration/conditions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ describe('conditions schema', () => {
expect(result.error).toEqual(undefined);
expect(result.value.chain).toEqual(5);
});

it('should validate chain id', async () => {
result = condition.validate({ chain: 10 });
expect(result.error?.message).toEqual(
'"chain" must be one of [1, 5, 137, 80001]'
);
});
});

describe('condition set', () => {
Expand Down
2 changes: 2 additions & 0 deletions test/integration/enrico.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,13 @@ describe('enrico', () => {

const ownsBufficornNFT = new Conditions.ERC721Ownership({
contractAddress: '0x1e988ba4692e52Bc50b375bcC8585b95c48AaD77',
chain: 5,
parameters: [3591],
});

const ownsNonsenseNFT = new Conditions.ERC721Ownership({
contractAddress: '0x1e988ba4692e52Bc50b375bcC8585b95c48AaD77',
chain: 5,
parameters: [6969],
});

Expand Down
2 changes: 2 additions & 0 deletions test/integration/pre.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,11 @@ describe('proxy reencryption', () => {

const genuineUndead = new Conditions.ERC721Ownership({
contractAddress: '0x209e639a0EC166Ac7a1A4bA41968fa967dB30221',
chain: 1,
});
const gnomePals = new Conditions.ERC721Ownership({
contractAddress: '0x5dB11d7356aa4C0E85Aa5b255eC2B5F81De6d4dA',
chain: 1,
});
const conditions = new ConditionSet([
genuineUndead,
Expand Down
1 change: 1 addition & 0 deletions test/unit/strategy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ describe('Deployed Strategy', () => {
const ownsNFT = new Conditions.ERC721Ownership({
contractAddress: '0x1e988ba4692e52Bc50b375bcC8585b95c48AaD77',
parameters: [3591],
chain: 5,
});

const plaintext = 'this is a secret';
Expand Down

0 comments on commit 4fa49fb

Please sign in to comment.