-
Notifications
You must be signed in to change notification settings - Fork 18
Adjustments to tournament simplification PR #228
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
Adjustments to tournament simplification PR #228
Conversation
| has_winner = helper.str_to_bool(ret[1]), | ||
| parent_commitment = Hash:from_digest_hex(ret[2]), | ||
| dangling_commitment = Hash:from_digest_hex(ret[3]), | ||
| commitment = Hash:from_digest_hex(ret[3]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change makes the inner_tournament_winner function return a table which contains a commitment entry, making it more similar to the table returned by the root_tournament_winner function. That is important because the return value of both functions are used (almost) interchangeably here:
dave/prt/client-lua/player/state.lua
Lines 62 to 66 in 1f1249a
| if not tournament.parent then | |
| tournament.tournament_winner = self.reader:root_tournament_winner(tournament.address) | |
| else | |
| tournament.tournament_winner = self.reader:inner_tournament_winner(tournament.address) | |
| end |
Later, this tournament_winner value and its commitment value are accessed:
dave/prt/client-lua/player/strategy.lua
Line 303 in 1f1249a
| if tournament_winner.commitment ~= old_commitment then |
This is the reason behind this change.
| returns (TournamentArguments memory); | ||
|
|
||
| /// @notice Returns non-root tournament arguments | ||
| function nonRootTournamentArgs() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added this function to the ITournament interface, because the NonRootArguments struct was not being used there. Also, it might be useful to expose this struct to the node.
| // | ||
|
|
||
| /// @notice Check if this is a root tournament (level == 0) | ||
| function _isRootTournament() internal view returns (bool) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have removed this function because it was not being used.
fa741b5
into
feature/prt-tournament-simplification
Hey @stephenctw, I've collected some suggested changes into a PR for your appreciation.
Let's discuss here the changes, so we can converge. :-)