Fixes for nft example launchpad.move #277
Merged
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.
This PR solves 2 issues in the launchpad.move example.
Mint stage index from
token-minter
moduleWhen using this example template, we ran into an issue with the mint stages from token-minter.
minter::execute_earliest_stage
loops over the mint stages, and removes any inactive indexes from the mint_stages vector, until it finds and active stage and then returns that index. Since the inactive indexes have been removed, the returned index does not match the active mint stage. The active mint stage will always have index 0, since all earlier indexes have been removed for being inactive.The launchpad.move module uses returned value from
execute_earliest_stage
as input for index when callingminter::find_mint_stage_by_index
. It should just use0
as input for index, as that is now the index for the active mint stage.Check on collection_uri
Also there is no check on collection_uri when creating a collection. This can cause problems later in
construct_nft_metadata_uri
, where/collection.json
is replaced by{next_nft_id}.json
. I added a check increate_collection
to ensure thecollection_uri
ends with.json
.