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

Allow minting multiple editions with the same set/play but different tiers #21

Merged
merged 1 commit into from
Apr 17, 2023

Conversation

EricLin-wk
Copy link
Contributor

@EricLin-wk EricLin-wk commented Apr 13, 2023

Allow minting multiple editions with the same set/play but different tiers. This would eliminate the need to create redundant play data for cases when we create dynamic moments/editions for multiple tiers.

  • Removing the mint edition pre-condition check that prevent a new edition with the same setID and playID from being created
  • Use a map to keep track of existing setID + playID + tier combination to prevent duplication. The map is store in the minter account's storage. Will manually backfill the map for existing editions.

@EricLin-wk EricLin-wk requested a review from a team as a code owner April 13, 2023 00:58
@@ -483,7 +482,7 @@ pub contract AllDay: NonFungibleToken {
AllDay.setByID.containsKey(setID): "setID does not exist"
AllDay.playByID.containsKey(playID): "playID does not exist"
SeriesData(id: seriesID).active == true: "cannot create an Edition with a closed Series"
SetData(id: setID).setPlayExistsInEdition(playID: playID) != true: "set play combination already exists in an edition"
AllDay.getPlayTierExistsInEdition(setID, playID, tier) == false: "set play tier combination already exists in an edition"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The set + play + tier duplicate check is now done directly within the smart contract.

Copy link

@joshuahannan joshuahannan left a comment

Choose a reason for hiding this comment

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

Looks good!

@EricLin-wk EricLin-wk merged commit af46086 into main Apr 17, 2023
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.

3 participants