Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support encryptor allowlist #306

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading