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

SemaphoreViem implemented #364

Open
wants to merge 901 commits into
base: main
Choose a base branch
from
Open

Conversation

inaridiy
Copy link

Description

SemaphoreViem is implemented.

Related Issue

#343

Does this introduce a breaking change?

  • Yes
  • No

Other information

cedoor and others added 30 commits February 15, 2023 20:40
…re/release

Yarn patch to change `changelogithub` output
…re/bump-version

New NPM scripts to bump versions and publish NPM packages
…erifier-hardhat

add hardhat task to deploy SemaphoreVerifier.sol
feat(identity): prepend hex strings with 0x
feat(identity): use sha512 to extract more entropy from message
This new package allows devs to fetch on-chain data by using a Semaphore subgraph or the Ethers
library.

BREAKING CHANGE: The code of the old `@semaphore-protocol/subgraph` package has been moved to the
`@semaphore-protocol/data` package.

re semaphore-protocol#256
@inaridiy
Copy link
Author

Worse, I forgot to write the test. I'll go write one soon.

@vplasencia
Copy link
Member

Hey @inaridiy! Don't worry, take your time. Thank you so much.

@inaridiy
Copy link
Author

@vplasencia Accomplished! I have confirmed a successful build and test!

packages/data/src/types/index.ts Show resolved Hide resolved
packages/data/src/viem.ts Outdated Show resolved Hide resolved
* @param network Chain object of viem.
* @param options Viem options.
*/
constructor(network: Chain = sepolia, options: ViemOptions = {}) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice for devs to have a way to pass a valid chain without installing vite separately and importing viem/chains. The type here can be similar to EthersNetwork (i.e. strings), and the constructor could then use the right chain object based on that string. It would also be more consistent with SemaphoreEthers.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the current implementation is better here, given its affinity with the Viem ecosystem.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Do you think it makes sense to export those chains' objects in this package too?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It certainly makes sense, and I find it a very nice contrast to SemaphoreEthers.

packages/data/src/viem.ts Outdated Show resolved Hide resolved
@inaridiy
Copy link
Author

inaridiy commented Oct 2, 2023

Thanks for the review. I will fix it now.

@inaridiy
Copy link
Author

inaridiy commented Oct 2, 2023

I have made some corrections and added some comments

@cedoor
Copy link
Member

cedoor commented Oct 4, 2023

I have made some corrections and added some comments

Great, it looks like there's a small error in the API test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants