Skip to content

Commit

Permalink
feat(allowlist): register encrypters in ritual allowlist
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-roslaniec committed Oct 4, 2023
1 parent d344181 commit e5ac346
Show file tree
Hide file tree
Showing 18 changed files with 2,128 additions and 19 deletions.
4 changes: 2 additions & 2 deletions packages/pre/src/characters/bob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
SecretKey,
Signer,
} from '@nucypher/nucypher-core';
import { PorterClient, zip } from '@nucypher/shared';
import { ChecksumAddress, PorterClient, zip } from '@nucypher/shared';

import { Keyring } from '../keyring';
import { PolicyMessageKit, RetrievalResult } from '../kits';
Expand Down Expand Up @@ -128,7 +128,7 @@ export class Bob {
return zip(policyMessageKits, retrieveCFragsResponses).map((pair) => {
const [messageKit, { cFrags, errors }] = pair;
const vcFrags = Object.keys(cFrags).map((address) => {
const verified = cFrags[address].verify(
const verified = cFrags[address as ChecksumAddress].verify(
messageKit.capsule,
publisherVerifyingKey,
policyEncryptingKey,
Expand Down
4 changes: 2 additions & 2 deletions packages/pre/src/cohort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ export class Cohort {
public static async create(
porterUri: string,
numUrsulas: number,
include: string[] = [],
exclude: string[] = [],
include: ChecksumAddress[] = [],
exclude: ChecksumAddress[] = [],
) {
const porter = new PorterClient(porterUri);
const ursulas = await porter.getUrsulas(numUrsulas, exclude, include);
Expand Down
2 changes: 1 addition & 1 deletion packages/pre/src/kits/retrieval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class RetrievalResult {
}

public get addresses(): readonly ChecksumAddress[] {
return Object.keys(this.cFrags);
return Object.keys(this.cFrags) as ChecksumAddress[];
}

public withResult(result: RetrievalResult): RetrievalResult {
Expand Down
3 changes: 2 additions & 1 deletion packages/pre/src/policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
VerifiedKeyFrag,
} from '@nucypher/nucypher-core';
import {
ChecksumAddress,
PreSubscriptionManagerAgent,
toBytes,
toCanonicalAddress,
Expand Down Expand Up @@ -76,7 +77,7 @@ export class PreEnactedPolicy implements IPreEnactedPolicy {
this.size,
startTimestamp,
endTimestamp,
ownerAddress,
ownerAddress as ChecksumAddress,
);
return tx.hash;
}
Expand Down
Loading

0 comments on commit e5ac346

Please sign in to comment.