Skip to content

Comments

Refactor/type-validation#951

Merged
vplasencia merged 2 commits intosemaphore-protocol:mainfrom
FaezehShakouri:refactor/type-validation
Feb 3, 2025
Merged

Refactor/type-validation#951
vplasencia merged 2 commits intosemaphore-protocol:mainfrom
FaezehShakouri:refactor/type-validation

Conversation

@FaezehShakouri
Copy link
Contributor

@FaezehShakouri FaezehShakouri commented Feb 1, 2025

Description

This pull request replaces the custom checkParameter function with the errorHandlers utility from the @zk-kit/utils package for parameter validation across multiple files. This change improves code consistency and leverages existing utility functions for better error handling.

  • Current Behavior: The code uses a custom function checkParameter to validate parameters.
  • New Behavior: The code now uses requireString, requireObject and requireBoolean from @zk-kit/utils/error-handlers for parameter validation.

Related Issue(s)

Closes #773

Other information

No visual changes are introduced by this PR, as it primarily focuses on refactoring the parameter validation logic.

Previous work: #938

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have run yarn format and yarn lint without getting any errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Copy link
Member

@vplasencia vplasencia left a comment

Choose a reason for hiding this comment

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

Great work @FaezehShakouri! Thank you very much!

@vplasencia vplasencia merged commit eef2772 into semaphore-protocol:main Feb 3, 2025
3 checks passed
@gitpoap-bot
Copy link

gitpoap-bot bot commented Feb 3, 2025

Congrats, your important contribution to this open-source project has earned you a GitPOAP!

GitPOAP: 2025 Semaphore Contributor:

GitPOAP: 2025 Semaphore Contributor GitPOAP Badge

Head to gitpoap.io & connect your GitHub account to mint!

Learn more about GitPOAPs here.

Lauman added a commit to crowd-wisdom/semaphore that referenced this pull request Feb 12, 2025
* docs: update contributing and pull_request_template files

* feat(website): add obscurus to projects section (semaphore-protocol#941)

re semaphore-protocol#939

* chore: fix 404 status URL (semaphore-protocol#917)

Signed-off-by: hanghuge <[email protected]>

* docs(website): update roadmap (semaphore-protocol#943)

docs(website): update roadmap on the website

* docs: make year update dynamically on website and docs (semaphore-protocol#945)

* docs: make year update dynamically on website and docs

* docs(docs): make year update dynamically

* docs: fix broken link and typo correction (semaphore-protocol#923)

* broken redirect CONTRIBUTING.md

* typo README.md

* docs: fixed circuit logic url (semaphore-protocol#931)

fix: circuit logic url

* chore(subgraph): update matchstick-as dependency (semaphore-protocol#946)

* chore(subgraph): update matchstick-as dependency

* chore(subgraph): update dependency versions

* ci: update pull request workflow to install libssl1.1 before testing the subgraph

* ci: update pull requests workflow

* ci: update ubuntu version

* ci: update ubuntu version in tests

* ci: update ubuntu version

* Add new article (semaphore-protocol#918)

* Add new article

* Update apps/website/src/data/articles.json

remove referral link

Co-authored-by: Vivian Plasencia <[email protected]>

---------

Co-authored-by: Vivian Plasencia <[email protected]>

* revert(subgraph): reverses changes made (semaphore-protocol#952)

re semaphore-protocol#915

* Refactor/type-validation (semaphore-protocol#951)

* chore(data): add @zk-kit/utils dependency

* refactor(data): refactor parameter validation using @zk-kit/utils

* chore: update utils package version (semaphore-protocol#954)

* chore: v4.9.0

---------

Signed-off-by: hanghuge <[email protected]>
Co-authored-by: Vivian Plasencia <[email protected]>
Co-authored-by: 0xpanoramix <[email protected]>
Co-authored-by: hanghuge <[email protected]>
Co-authored-by: youyyytrok <[email protected]>
Co-authored-by: Sumit Vekariya <[email protected]>
Co-authored-by: zanastas <[email protected]>
Co-authored-by: Chidozie DAVID <[email protected]>
Co-authored-by: Faezeh Shakouri <[email protected]>
Lauman added a commit to crowd-wisdom/semaphore that referenced this pull request Feb 12, 2025
* docs: update contributing and pull_request_template files

* feat(website): add obscurus to projects section (semaphore-protocol#941)

re semaphore-protocol#939

* chore: fix 404 status URL (semaphore-protocol#917)



* docs(website): update roadmap (semaphore-protocol#943)

docs(website): update roadmap on the website

* docs: make year update dynamically on website and docs (semaphore-protocol#945)

* docs: make year update dynamically on website and docs

* docs(docs): make year update dynamically

* docs: fix broken link and typo correction (semaphore-protocol#923)

* broken redirect CONTRIBUTING.md

* typo README.md

* docs: fixed circuit logic url (semaphore-protocol#931)

fix: circuit logic url

* chore(subgraph): update matchstick-as dependency (semaphore-protocol#946)

* chore(subgraph): update matchstick-as dependency

* chore(subgraph): update dependency versions

* ci: update pull request workflow to install libssl1.1 before testing the subgraph

* ci: update pull requests workflow

* ci: update ubuntu version

* ci: update ubuntu version in tests

* ci: update ubuntu version

* Add new article (semaphore-protocol#918)

* Add new article

* Update apps/website/src/data/articles.json

remove referral link



---------



* revert(subgraph): reverses changes made (semaphore-protocol#952)

re semaphore-protocol#915

* Refactor/type-validation (semaphore-protocol#951)

* chore(data): add @zk-kit/utils dependency

* refactor(data): refactor parameter validation using @zk-kit/utils

* chore: update utils package version (semaphore-protocol#954)

* chore: v4.9.0

---------

Signed-off-by: hanghuge <[email protected]>
Co-authored-by: Vivian Plasencia <[email protected]>
Co-authored-by: 0xpanoramix <[email protected]>
Co-authored-by: hanghuge <[email protected]>
Co-authored-by: youyyytrok <[email protected]>
Co-authored-by: Sumit Vekariya <[email protected]>
Co-authored-by: zanastas <[email protected]>
Co-authored-by: Chidozie DAVID <[email protected]>
Co-authored-by: Faezeh Shakouri <[email protected]>
jimmychu0807 added a commit to jimmychu0807/semaphore that referenced this pull request Mar 27, 2025
* feat(website): add obscurus to projects section (semaphore-protocol#941)

re semaphore-protocol#939

* chore: fix 404 status URL (semaphore-protocol#917)

Signed-off-by: hanghuge <[email protected]>

* docs(website): update roadmap (semaphore-protocol#943)

docs(website): update roadmap on the website

* docs: make year update dynamically on website and docs (semaphore-protocol#945)

* docs: make year update dynamically on website and docs

* docs(docs): make year update dynamically

* docs: fix broken link and typo correction (semaphore-protocol#923)

* broken redirect CONTRIBUTING.md

* typo README.md

* docs: fixed circuit logic url (semaphore-protocol#931)

fix: circuit logic url

* chore(subgraph): update matchstick-as dependency (semaphore-protocol#946)

* chore(subgraph): update matchstick-as dependency

* chore(subgraph): update dependency versions

* ci: update pull request workflow to install libssl1.1 before testing the subgraph

* ci: update pull requests workflow

* ci: update ubuntu version

* ci: update ubuntu version in tests

* ci: update ubuntu version

* Add new article (semaphore-protocol#918)

* Add new article

* Update apps/website/src/data/articles.json

remove referral link

Co-authored-by: Vivian Plasencia <[email protected]>

---------

Co-authored-by: Vivian Plasencia <[email protected]>

* revert(subgraph): reverses changes made (semaphore-protocol#952)

re semaphore-protocol#915

* Refactor/type-validation (semaphore-protocol#951)

* chore(data): add @zk-kit/utils dependency

* refactor(data): refactor parameter validation using @zk-kit/utils

* chore: update utils package version (semaphore-protocol#954)

* chore: v4.9.0

* Fix broken link for LeanMIT (semaphore-protocol#956)

chore: fixes broken link for LeanMIT

* chore(group): update leanimt package version (semaphore-protocol#957)

* chore: v4.9.1

* docs(website): update spec status to true on roadmap (semaphore-protocol#959)

* docs(website): update roadmap to add semaphore noir implementation (semaphore-protocol#962)

* docs: add specification document link to website and docs (semaphore-protocol#965)

* docs(website): add scaling semaphore with pir to the roadmap (semaphore-protocol#969)

* update to latest semaphore

---------

Signed-off-by: hanghuge <[email protected]>
Co-authored-by: 0xpanoramix <[email protected]>
Co-authored-by: hanghuge <[email protected]>
Co-authored-by: Vivian Plasencia <[email protected]>
Co-authored-by: youyyytrok <[email protected]>
Co-authored-by: Sumit Vekariya <[email protected]>
Co-authored-by: zanastas <[email protected]>
Co-authored-by: Chidozie DAVID <[email protected]>
Co-authored-by: Faezeh Shakouri <[email protected]>
Co-authored-by: ewynx <[email protected]>
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.

@semaphore-protocol/data uses utility functions that can be replaced by @zk-kit/utils

2 participants