Skip to content

Commit

Permalink
apply pr suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-roslaniec committed Sep 8, 2023
1 parent 19a73b7 commit f605e88
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/agents/coordinator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ export class DkgCoordinatorAgent {
const Coordinator = await this.connectReadOnly(provider);
const dkgPublicKeyBytes = dkgPublicKey.toBytes();
const pointStruct: BLS12381.G1PointStruct = {
word0: dkgPublicKeyBytes.slice(0, 16),
word1: dkgPublicKeyBytes.slice(16, 32),
word0: dkgPublicKeyBytes.slice(0, 32),
word1: dkgPublicKeyBytes.slice(32, 48),
};
return await Coordinator.getRitualIdFromPublicKey(pointStruct);
}
Expand Down
6 changes: 6 additions & 0 deletions test/unit/conditions/context.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ describe('context parameters', () => {
const condition = new ContractCondition(conditionObj);
const conditionExpr = new ConditionExpression(condition);
expect(conditionExpr.contextRequiresSigner()).toBe(true);
expect(conditionExpr.buildContext(provider, {}, signer)).toBeDefined();
expect(() => conditionExpr.buildContext(provider, {})).toThrow(
`Cannot use ${USER_ADDRESS_PARAM} as a parameter without a signer`
);
});

it('detects if a signer is not required', () => {
Expand All @@ -100,6 +104,8 @@ describe('context parameters', () => {
false
);
expect(conditionExpr.contextRequiresSigner()).toBe(false);
expect(conditionExpr.buildContext(provider, {}, signer)).toBeDefined();
expect(conditionExpr.buildContext(provider, {})).toBeDefined();
});

it('rejects on a missing signer', () => {
Expand Down

0 comments on commit f605e88

Please sign in to comment.