For much larger games the authority (or permissionless) oracle may want to be resized.#30
Conversation
| @@ -0,0 +1,8 @@ | |||
| # This configuration file was automatically generated by Gitpod. | |||
| args.authority | ||
| ); | ||
|
|
||
| const match = (await getMatch(oracle))[0]; |
There was a problem hiding this comment.
Rename this to matchInstance, simplifies the accounts struct below.
There was a problem hiding this comment.
Don't forget about this one
| async resizeOracle( | ||
| args: ResizeOracleArgs, | ||
| _accounts = {}, | ||
| _additionalArgs = {} |
There was a problem hiding this comment.
Just remove _accounts and _additionalArgs as parameters.
There was a problem hiding this comment.
Looks like you removed these ones from the resizeOracle instruction function, but still need to remove from here, on the program resizeOracle function
long-banana
left a comment
There was a problem hiding this comment.
Getting close. Couple small things left.
| pub struct ResizeOracle<'info> { | ||
| #[account(constraint=winOracle.key() == match_instance.win_oracle)] | ||
| winOracle: UncheckedAccount<'info>, | ||
| #[account(address == match_instance.win_oracle)] |
There was a problem hiding this comment.
| #[account(address == match_instance.win_oracle)] | |
| #[account(address = match_instance.win_oracle)] |
| let new_size = args.resize as usize; | ||
| if new_size > win_oracle_account.data.borrow().len() { | ||
|
|
||
|
|
There was a problem hiding this comment.
Remove these two new lines
| ctx: Context<'a, 'b, 'c, 'info, ResizeOracle<'info>>, | ||
| args: ResizeOracleArgs, | ||
| ) -> Result<()> { | ||
|
|
| args.authority | ||
| ); | ||
|
|
||
| const match = (await getMatch(oracle))[0]; |
There was a problem hiding this comment.
Don't forget about this one
| async resizeOracle( | ||
| args: ResizeOracleArgs, | ||
| _accounts = {}, | ||
| _additionalArgs = {} |
There was a problem hiding this comment.
Looks like you removed these ones from the resizeOracle instruction function, but still need to remove from here, on the program resizeOracle function
For much larger games the authority (or permissionless) oracle may want to be resized.
team at your convenience this would help me with my hackathon submission :)
in the case of https://hackblock.space/:
if the authority can have an orderly object that includes many amounts from many players then the players themselves can take turns at concurrently paying out proceeds from previous rounds. It would also track who has entered when.
Cheers :)