Skip to content

challenger: Simplify register code#8384

Merged
refcell merged 1 commit intoaj/output-cannon-new-contractfrom
aj/simplify-register
Dec 1, 2023
Merged

challenger: Simplify register code#8384
refcell merged 1 commit intoaj/output-cannon-new-contractfrom
aj/simplify-register

Conversation

@ajsutton
Copy link
Contributor

@ajsutton ajsutton commented Dec 1, 2023

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 NewGamePlayer and 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

@ajsutton ajsutton requested a review from a team as a code owner December 1, 2023 04:15
@ajsutton ajsutton requested review from refcell and trianglesphere and removed request for a team December 1, 2023 04:15
Copy link
Contributor

@refcell refcell left a comment

Choose a reason for hiding this comment

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

This reads a lot better to me :)

@refcell refcell merged commit 56ad5b7 into aj/output-cannon-new-contract Dec 1, 2023
@refcell refcell deleted the aj/simplify-register branch December 1, 2023 20:19
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