This repository was archived by the owner on Jan 21, 2022. It is now read-only.
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.
[WIP] Implementation of plugins for ERC165, ERC721 and cryptokitties #116
base: master
Are you sure you want to change the base?
[WIP] Implementation of plugins for ERC165, ERC721 and cryptokitties #116
Changes from 5 commits
0b5da35
517300c
d1dacdb
c0ec9e1
67b07b7
4e1b86c
9b7df7d
bafc00f
f17707e
73abf18
d644ebc
da4d6bc
1feaef0
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 prefer strict camel casing.
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.
I prefer too, but that's the language of the original EIP - https://github.com/ethereum/EIPs/blob/master/EIPS/eip-165.md. Of course we can do
interfaceId
, your call.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.
How about we add a a field an an enum type for known interface 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.
as a new grapql method (like
supportsInterfaceByEnum
) or just at the backend?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 don't want to pollute the global namespace. How about adding a if this plugin extends the
Account
type with an nftToken field? We'd need to add thetoken
field in thecore
plugin schema. A query would look like this: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.
Interesting, yeah this looks cleaner. But I'm not sure why we need the
contract
fields as a intermediary (for logical distinction?). For now I did this syntax:If I would add the
contract
toAccount
, what should it return if plugins are used? An empty object?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 if the balance of these accounts changes? The tests will fail.
Could you please add comments indicating what these addresses correspond to?
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.
Yes, it's a problem. But I guess the same goes the all tests that didn't query past transactions.
I changed the tests to use my accounts, with some GodsUnchained tokens I bought for tests.
I wanted to test more functionality with them but it turned out these tokens cannot be moved.
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 shy away from mapping 1:1 functions to fields. We prefer to represent the data model. In this case, it could look like this:
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.
Hey, well I just defined defined tried to to resemble the most ERC721. what you suggest is good for the function
ownerOf
andgetApproved
, but the functions likebalanceOf
andisApprovedForAll
doesn't receive thetokenId
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.
Cool, nice test.
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.
Why the comment here?
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.
Watch the indentation here! Check out erc20.json.
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 plugin did you use to indentation?
Large diffs are not rendered by default.