scaffold.js: load() transaction hash as unique id #595
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.
Just went thru the Curator program and am sending this quick PR to suggest a small change that might save future subgraph creators a little pain during setup, especially the first time.
When I set up the subgraph for my project the first time, the auto-generated
mapping.tsfile looked like this:I can't remember exactly what the problem was (maybe it was throwing errors at some point?) but changing the above to use the
hashinstead offromfield fixed the problem. I'm assuming this is because thefromwas not unique in the contract I was setting up the subgraph for (it had been in production for a while), and this is probably the case with most contracts that people will try to index that are already in production:I'm thinking this small change would save future devs that are new to the protocol some time, since it hung me up trying to figure out what was wrong.
Also updated the test file for the change I made (in
scaffold.test.js) but please note that I didn't actually run the test. I'm assuming you probably have some automation that will run it.Best,
Lauren