-
Notifications
You must be signed in to change notification settings - Fork 25
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
For much larger games the authority (or permissionless) oracle may want to be resized. #30
base: master
Are you sure you want to change the base?
For much larger games the authority (or permissionless) oracle may want to be resized. #30
Conversation
.gitpod.yml
Outdated
@@ -0,0 +1,8 @@ | |||
# This configuration file was automatically generated by Gitpod. |
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.
Remove gitpod config
args.authority | ||
); | ||
|
||
const match = (await getMatch(oracle))[0]; |
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.
Rename this to matchInstance
, simplifies the accounts struct below.
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.
Don't forget about this one
async resizeOracle( | ||
args: ResizeOracleArgs, | ||
_accounts = {}, | ||
_additionalArgs = {} |
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.
Just remove _accounts
and _additionalArgs
as parameters.
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.
Looks like you removed these ones from the resizeOracle
instruction function, but still need to remove from here, on the program resizeOracle
function
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.
Getting close. Couple small things left.
@@ -798,8 +794,8 @@ pub struct LeaveMatch<'info> { | |||
#[derive(Accounts)] | |||
#[instruction(args: ResizeOracleArgs)] | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#[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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove these two new lines
ctx: Context<'a, 'b, 'c, 'info, ResizeOracle<'info>>, | ||
args: ResizeOracleArgs, | ||
) -> Result<()> { | ||
|
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.
Remove extra newline
args.authority | ||
); | ||
|
||
const match = (await getMatch(oracle))[0]; |
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.
Don't forget about this one
async resizeOracle( | ||
args: ResizeOracleArgs, | ||
_accounts = {}, | ||
_additionalArgs = {} |
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.
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 :)