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

Revealables #231

Merged
merged 7 commits into from
Oct 9, 2023
Merged

Revealables #231

merged 7 commits into from
Oct 9, 2023

Conversation

steven2308
Copy link
Collaborator

@steven2308 steven2308 commented Oct 6, 2023

Description

Adds Revealable/Revealer extensions with abstract impl for the first.

Checklist

  • Verified code additions
  • Updated NatSpec comments (if applicable)
  • Regenerated docs
  • Ran prettier
  • Added tests to fully cover the changes

PR-Codex overview

Detailed summary

  • Bump version from 2.1.1 to 2.2.0 in package.json
  • Update CODEOWNERS file
  • Update VERSION constant in RMRKCore.sol
  • Update imports and functions in RMRKEquippableMock.sol and RMRKMinifiedEquippableMock.sol
  • Add new interfaces IRMRKRevealable and IRMRKRevealer
  • Change visibility of certain functions in RMRKNestableMultiAsset.sol, RMRKEquippable.sol, RMRKNestable.sol, RMRKMultiAsset.sol, RMRKMinifiedEquippable.sol
  • Update CHANGELOG.md
  • Update env.example file
  • Update visibility of functions in RMRKMultiAsset.sol
  • Add new documentation files IRMRKRevealable.md and RMRKRevealable.md
  • Update visibility of functions in RMRKMinifiedEquippable.sol
  • Add new contract RMRKMultiAssetRevealableMock.sol
  • Add new interface IRMRKRevealer.sol
  • Add new documentation file RMRKRevealable.md

The following files were skipped due to too many changes: docs/RMRK/extension/revealable/RMRKRevealable.md, docs/RMRK/extension/revealable/IRMRKRevealer.md, contracts/mocks/extensions/revealable/RMRKRevealerMock.sol, docs/mocks/extensions/revealable/RMRKRevealerMock.md, contracts/RMRK/extension/revealable/RMRKRevealable.sol, test/extensions/revealable.ts, docs/elin/contracts/token/ERC721/extensions/ERC721Burnable.md, docs/mocks/extensions/revealable/RMRKMultiAssetRevealableMock.md

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@steven2308 steven2308 changed the base branch from master to dev October 6, 2023 16:29
* @return revealedAssetIds The assetIds to reveal
* @return assetToReplaceIds The assetIds to replace
*/
function getRevealedAssets(
Copy link
Member

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

Copy link
Member

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

Copy link
Collaborator Author

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?

Copy link
Member

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

Copy link
Collaborator Author

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


// --------------- TESTS -----------------------

describe('RMRKTokenPropertiesMock', async function () {
Copy link
Member

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will do

Copy link
Collaborator Author

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.

Copy link
Member

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

Copy link
Member

@Yuripetusko Yuripetusko left a 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

@steven2308 steven2308 merged commit af83f10 into dev Oct 9, 2023
4 checks passed
@steven2308 steven2308 deleted the revealables branch October 9, 2023 19:36
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.

2 participants