Skip to content

Commit

Permalink
update to [email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-roslaniec committed Sep 6, 2023
1 parent 3511348 commit b11f1d4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"prebuild": "yarn typechain"
},
"dependencies": {
"@nucypher/nucypher-core": "^0.12.0",
"@nucypher/nucypher-core": "^0.13.0",
"axios": "^1.5.0",
"deep-equal": "^2.2.1",
"ethers": "^5.7.2",
Expand Down
15 changes: 7 additions & 8 deletions src/conditions/context/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ export class ConditionContext {
this.validate();
}

private requiresSigner(): boolean {
return this.conditions.some((cond) => cond.requiresSigner());
}

private validate() {
Object.keys(this.customParameters).forEach((key) => {
if (RESERVED_CONTEXT_PARAMS.includes(key)) {
Expand All @@ -54,7 +50,10 @@ export class ConditionContext {
}
});

if (this.requiresSigner() && !this.signer) {
const conditionRequiresSigner = this.conditions.some((c) =>
c.requiresSigner()
);
if (conditionRequiresSigner && !this.signer) {
throw new Error(
`Cannot use ${USER_ADDRESS_PARAM} as custom parameter without a signer`
);
Expand Down Expand Up @@ -151,9 +150,9 @@ export class ConditionContext {
acp: AccessControlPolicy,
signer?: ethers.Signer
): ConditionContext {
const conditions = acp.conditions
? [ConditionExpression.fromWASMConditions(acp.conditions).condition]
: [];
const conditions = [
ConditionExpression.fromWASMConditions(acp.conditions).condition,
];
return new ConditionContext(provider, conditions, {}, signer);
}
}
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1818,10 +1818,10 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"

"@nucypher/nucypher-core@^0.12.0":
version "0.12.0"
resolved "https://registry.yarnpkg.com/@nucypher/nucypher-core/-/nucypher-core-0.12.0.tgz#0274026f3996601994e9639c06ab79c62c8f5d7c"
integrity sha512-hEjjnTSLNqHUiIF6U02j+M8jUOBCOt5mGG78lMHoathbak15AmYX4gkdkHTg2Ssvt5o77Cwzsn5YgGM4Haf7AQ==
"@nucypher/nucypher-core@^0.13.0":
version "0.13.0"
resolved "https://registry.yarnpkg.com/@nucypher/nucypher-core/-/nucypher-core-0.13.0.tgz#071263931d4e9604b428ea738ebe8ee5e1f302f3"
integrity sha512-HfEbrQvngOHIn0bMAdqPIF7WzkLdb5+sMhmX7bQl2SINABQ6FGGN8G+Arb+pbkYgru5qeQ+RTTbCBwBNaxFKEg==

"@sinclair/typebox@^0.27.8":
version "0.27.8"
Expand Down

0 comments on commit b11f1d4

Please sign in to comment.