-
Notifications
You must be signed in to change notification settings - Fork 5
feat: validate IDs #42
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e9e1ccc
feat: validate IDs
nikgraf e2b7940
feat: validate IDs for length 22 only
nikgraf efdb207
feat: IDs with length 21 are valid
nikgraf 6c46dd8
doc: improve Jsdoc
nikgraf c44f027
chore: add changesets
nikgraf 3cc92b0
doc: improve readme
nikgraf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@graphprotocol/grc-20": minor | ||
| --- | ||
|
|
||
| Update `QUOTES_THAT_SUPPORT_CLAIMS_PROPERTY` and `ACADEMIC_FIELD_TYPE` values to be valid IDs | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@graphprotocol/grc-20": minor | ||
| --- | ||
|
|
||
| IDs now use a branded type `Id` instead of `string` and validate every ID param |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,18 +34,18 @@ | |
| "@changesets/cli": "^2.27.12", | ||
| "@ethersproject/abi": "^5.6.4", | ||
| "@ethersproject/providers": "^5.6.8", | ||
| "@types/uuid": "^9.0.8", | ||
| "effect": "^3.12.11", | ||
| "ethers": "^5.7.2", | ||
| "position-strings": "^2.0.1", | ||
| "uuid": "^9.0.0", | ||
| "uuid": "^11.1.0", | ||
| "viem": "^1.16.0", | ||
| "vite": "^5.2.11", | ||
| "vitest": "^1.6.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@bufbuild/buf": "^1.31.0", | ||
| "@bufbuild/protoc-gen-es": "^1.9.0", | ||
| "@types/uuid": "^10.0.0", | ||
| "typescript": "^5.4.5" | ||
| }, | ||
| "packageManager": "[email protected]" | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll need to figure out the migration path for these since there's already data in the mainnet KG using these ids.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's KG?
One thing we could do is simply create new entities and change the entries manually. In this case in old version we still have old versions pointing to invalid IDs, but since the data is already on chain we can't do a simply SQL migration script or can we?