-
Notifications
You must be signed in to change notification settings - Fork 36
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
Revealables #231
Revealables #231
Conversation
* @return revealedAssetIds The assetIds to reveal | ||
* @return assetToReplaceIds The assetIds to replace | ||
*/ | ||
function getRevealedAssets( |
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.
The name of the function sounds like the assets were already revealed, but comment says assetIds to reveal
like they are yet to be revealed
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 would rename it to getRevealableAssets
and revealableAssetIds
if this is about assets that are yet to be revealed
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.
It's tricky.. since by calling this method you are effectively revealing them. What about getAssetsToReveal
and assetsToRevealIds
?
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 I like it more, but then we have an opposite issue, that once they are revealed, the name will not be very accurate, as they are already revealed, but var is still called toReveal
. Another alternative is assetIdsOnReveal
or something like that. But if you don't like any of these options, you can leave as is
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.
Since this became reveal instead, I think revealedAssetsIds
is now fine
test/extensions/revealable.ts
Outdated
|
||
// --------------- TESTS ----------------------- | ||
|
||
describe('RMRKTokenPropertiesMock', async function () { |
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.
Would be nice to add test with replace id, also with contract where there's more than 1 revealable asset
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.
Will do
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.
Actually, the tests already uses replace id. Also, I'm focusing on revealable logic which is the abstract contract I'm implementing.
Revealer here is just a mock to prove the concept, in the future we may add a few implementations and only then I would add more specific cases.
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.
Sure, but tests and mocks are like a documentation in this case, so good to have it to cover many cases and be descriptive
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.
Left few small comments. Mostly questions
Description
Adds Revealable/Revealer extensions with abstract impl for the first.
Checklist
PR-Codex overview
Detailed summary