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

Add name lookup example snap #1768

Merged
merged 11 commits into from
Sep 21, 2023
Merged

Conversation

matthewwalsh0
Copy link
Member

@matthewwalsh0 matthewwalsh0 commented Sep 21, 2023

Add the Name Lookup Example Snap to support manual and E2E testing with the name-lookup handler and endowment.

Supports resolving both domains and addresses based on the request.

If an address is provided, it returns static text followed by a shortened form of the address and the hex form of the chain ID, in order to provide some validation of the received arguments. e.g. example.domain - 0xCD2 / 0x5

If a domain is provided, it simply returns a static Ethereum address: 0xc0ffee254729296a45a3885639AC7E10F9d54979

If neither values are provided, it returns null.

No additional UI is included in the test-snaps package beyond the standard Connect button.

@matthewwalsh0 matthewwalsh0 requested a review from a team as a code owner September 21, 2023 09:02
Copy link
Member

@Mrtenz Mrtenz left a comment

Choose a reason for hiding this comment

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

Make sure to add the example to the README.md in packages/examples too!

packages/examples/packages/name-lookup/snap.config.js Outdated Show resolved Hide resolved
packages/examples/packages/name-lookup/snap.manifest.json Outdated Show resolved Hide resolved
packages/examples/packages/name-lookup/src/index.ts Outdated Show resolved Hide resolved
packages/examples/packages/name-lookup/src/index.ts Outdated Show resolved Hide resolved
packages/examples/packages/name-lookup/src/index.ts Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Sep 21, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.02% 🎉

Comparison is base (8eda0bf) 95.79% compared to head (c653d3f) 95.82%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1768      +/-   ##
==========================================
+ Coverage   95.79%   95.82%   +0.02%     
==========================================
  Files         240      239       -1     
  Lines        5476     5464      -12     
  Branches      852      851       -1     
==========================================
- Hits         5246     5236      -10     
+ Misses        230      228       -2     
Files Changed Coverage Δ
...ages/snaps-controllers/src/snaps/SnapController.ts 96.77% <ø> (+0.27%) ⬆️
...ges/snaps-controllers/src/snaps/endowments/enum.ts 100.00% <ø> (ø)
...es/snaps-controllers/src/snaps/endowments/index.ts 100.00% <ø> (ø)
packages/snaps-utils/src/manifest/validation.ts 100.00% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Update example readme.
Fix changelog.
Add Jest config.
Fix package scripts.
Use updated config file.
Add JSDoc.
matthewwalsh0 and others added 2 commits September 21, 2023 12:50
@socket-security
Copy link

socket-security bot commented Sep 21, 2023

No top level dependency changes detected. Learn more about Socket for GitHub ↗︎

@socket-security
Copy link

socket-security bot commented Sep 21, 2023

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Mrtenz
Mrtenz previously approved these changes Sep 21, 2023
@Mrtenz
Copy link
Member

Mrtenz commented Sep 21, 2023

@SocketSecurity ignore @esbuild-plugins/[email protected]
@SocketSecurity ignore [email protected]
@SocketSecurity ignore [email protected]
@SocketSecurity ignore [email protected]
@SocketSecurity ignore [email protected]

@matthewwalsh0 matthewwalsh0 merged commit f865a28 into main Sep 21, 2023
134 checks passed
@matthewwalsh0 matthewwalsh0 deleted the feat/name-lookup-example-snap branch September 21, 2023 19:22
hmalik88 added a commit that referenced this pull request Oct 11, 2023
The current example snap is not inline with SIP-12, see
#1768 (comment)
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.

3 participants