Skip to content

Commit

Permalink
update after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-roslaniec committed Sep 6, 2023
1 parent 9e589cc commit 933416e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 60 deletions.
14 changes: 1 addition & 13 deletions src/taco.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,7 @@ export const decrypt = async (
ritualId,
ritual.dkgParams.threshold
);
// TODO: What do we do if there are no conditions?
if (!messageKit.acp.conditions) {
throw new Error('ThresholdMessageKit does not contain conditions');
}
const conditionExpr = ConditionExpression.fromWASMConditions(
messageKit.acp.conditions
);
return decrypter.retrieveAndDecrypt(
provider,
conditionExpr,
messageKit,
signer
);
return decrypter.retrieveAndDecrypt(provider, messageKit, signer);
};

export const taco = {
Expand Down
5 changes: 2 additions & 3 deletions test/unit/cbd-strategy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ const {
const secretKey = SecretKey.fromBEBytes(aliceSecretKeyBytes);
const provider = fakeProvider(secretKey.toBEBytes());
const signer = fakeSigner(secretKey.toBEBytes());
const aliceSigner = fakeSigner(aliceSecretKey.toBEBytes());
const ownsNFT = new ERC721Ownership({
contractAddress: '0x1e988ba4692e52Bc50b375bcC8585b95c48AaD77',
parameters: [3591],
Expand Down Expand Up @@ -132,9 +131,9 @@ describe('CbdDeployedStrategy', () => {

const decryptedMessage =
await deployedStrategy.decrypter.retrieveAndDecrypt(
aliceProvider,
provider,
thresholdMessageKit,
aliceSigner
signer
);
expect(getUrsulasSpy).toHaveBeenCalled();
expect(getParticipantsSpy).toHaveBeenCalled();
Expand Down
44 changes: 0 additions & 44 deletions test/unit/conditions/condition-expr.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,50 +226,6 @@ describe('condition set', () => {
}
);

it.each([
// no "operator" nor "method" value
{
version: ConditionExpression.VERSION,
condition: {
randoKey: 'randoValue',
otherKey: 'otherValue',
},
},
// invalid "method" and no "contractAddress"
{
version: ConditionExpression.VERSION,
condition: {
method: 'doWhatIWant',
returnValueTest: {
index: 0,
comparator: '>',
value: '100',
},
chain: 5,
},
},
// condition with wrong method "method" and no contract address
{
version: ConditionExpression.VERSION,
condition: {
...testTimeConditionObj,
method: 'doWhatIWant',
},
},
// rpc condition (no contract address) with disallowed method
{
version: ConditionExpression.VERSION,
condition: {
...testRpcConditionObj,
method: 'isPolicyActive',
},
},
])("can't determine condition type", (invalidCondition) => {
expect(() => {
ConditionExpression.fromObj(invalidCondition);
}).toThrow('unrecognized condition data');
});

it.each(['_invalid_condition_type_', undefined as unknown as string])(
'rejects an invalid condition type',
(invalidConditionType) => {
Expand Down

0 comments on commit 933416e

Please sign in to comment.