Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

Commit

Permalink
Switch bls-wallet-clients to use @thehubbleproject/bls
Browse files Browse the repository at this point in the history
Switch ./clients/deps/hubble-bls to @thehubbleproject/bls.
Clean up import paths in clients.
Update hex values in clients tests with new mcl-wasm values.
Update clients package in aggreagotr and fix private key generation in tests.
Update contract tests.
  • Loading branch information
jacque006 committed Jan 22, 2022
1 parent 9763c2a commit 3785fec
Show file tree
Hide file tree
Showing 27 changed files with 130 additions and 641 deletions.
4 changes: 3 additions & 1 deletion aggregator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@ TS2300 [ERROR]: Duplicate identifier 'TypedArray'.

You need to reload modules (`-r`):

`deno run -r --allow-net --allow-env --allow-read --unstable ./programs/aggregator.ts`
```sh
deno run -r --allow-net --allow-env --allow-read --unstable ./programs/aggregator.ts
```

### Notable Components

Expand Down
10 changes: 5 additions & 5 deletions aggregator/deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ export {
Contract,
ethers,
Wallet,
} from "https://esm.sh/[email protected].2";
} from "https://esm.sh/[email protected].3";

import { ethers } from "https://esm.sh/[email protected].2";
import { ethers } from "https://esm.sh/[email protected].3";
export const keccak256 = ethers.utils.keccak256;

export type {
Expand All @@ -40,17 +40,17 @@ export type {
PublicKey,
Signature,
VerificationGateway,
} from "https://esm.sh/[email protected].3";
} from "https://esm.sh/[email protected].4-05c23aa";

export {
Aggregator as AggregatorClient,
BlsWalletWrapper,
getConfig,
VerificationGateway__factory,
} from "https://esm.sh/[email protected].3";
} from "https://esm.sh/[email protected].4-05c23aa";

// Workaround for esbuild's export-star bug
import blsWalletClients from "https://esm.sh/[email protected].3";
import blsWalletClients from "https://esm.sh/[email protected].4-05c23aa";
const {
bundleFromDto,
bundleToDto,
Expand Down
2 changes: 1 addition & 1 deletion aggregator/programs/premerge.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env -S deno run --unstable --allow-run --allow-read --allow-write
#!/usr/bin/env -S deno run --unstable --allow-run --allow-read --allow-write --allow-env

import * as shell from "./helpers/shell.ts";
import repoDir from "../src/helpers/repoDir.ts";
Expand Down
8 changes: 2 additions & 6 deletions aggregator/src/helpers/Rng.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
import { BigNumber, ethers } from "../../deps.ts";
import { BigNumber } from "../../deps.ts";

import words from "./words.ts";

const { keccak256 } = ethers.utils;

function byteToHex(byte: number): string {
return byte.toString(16).padStart(2, "0");
}

function hash(data: string) {
const byteValues = Array.from(new TextEncoder().encode(data));
const hex = `0x${byteValues.map(byteToHex).join("")}`;

return keccak256(hex);
return `0x${byteValues.map(byteToHex).join("")}`;
}

export default class Rng {
Expand Down
2 changes: 0 additions & 2 deletions contracts/clients/.npmignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
*
!/dist/src/**/*
!/dist/deps/**/*
!/dist/typechain/**/*
!/src/**/*
!/deps/**/*
!/package.json
!/README.md
27 changes: 0 additions & 27 deletions contracts/clients/deps/hubble-bls/exceptions.ts

This file was deleted.

101 changes: 0 additions & 101 deletions contracts/clients/deps/hubble-bls/hashToField.ts

This file was deleted.

24 changes: 0 additions & 24 deletions contracts/clients/deps/hubble-bls/index.ts

This file was deleted.

Loading

0 comments on commit 3785fec

Please sign in to comment.