challenger: Simplify register code#8384
Merged
refcell merged 1 commit intoaj/output-cannon-new-contractfrom Dec 1, 2023
Merged
challenger: Simplify register code#8384refcell merged 1 commit intoaj/output-cannon-new-contractfrom
refcell merged 1 commit intoaj/output-cannon-new-contractfrom
Conversation
refcell
approved these changes
Dec 1, 2023
Contributor
refcell
left a comment
There was a problem hiding this comment.
This reads a lot better to me :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Attempt to simplify the player and register setup code. Rather than using a struct to hold the contract, the contract creation and resource creator definition is done inside the playerCreator function used when registering. The contract can then just be passed
NewGamePlayerand create resources goes back to just being a function instead of an interface.This is shorter code but has an unavoidable extra level of nesting. I think it's better, but not entirely convinced so quite happy to just close this if people thing the struct approach is easier to follow.
Builds on #8379