Skip to content
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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

staccDOTsol
Copy link

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 :)

js/cli/src/matches.ts Outdated Show resolved Hide resolved
rust/matches/src/lib.rs Outdated Show resolved Hide resolved
.gitpod.yml Outdated
@@ -0,0 +1,8 @@
# This configuration file was automatically generated by Gitpod.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove gitpod config

rust/matches/src/lib.rs Outdated Show resolved Hide resolved
args.authority
);

const match = (await getMatch(oracle))[0];
Copy link
Collaborator

@long-banana long-banana Aug 23, 2022

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.

Copy link
Collaborator

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

js/cli/src/matches.ts Outdated Show resolved Hide resolved
js/cli/src/matches.ts Outdated Show resolved Hide resolved
js/cli/src/matches.ts Outdated Show resolved Hide resolved
async resizeOracle(
args: ResizeOracleArgs,
_accounts = {},
_additionalArgs = {}
Copy link
Collaborator

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.

Copy link
Collaborator

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

rust/matches/src/lib.rs Outdated Show resolved Hide resolved
rust/matches/src/lib.rs Outdated Show resolved Hide resolved
rust/matches/src/lib.rs Outdated Show resolved Hide resolved
rust/matches/src/lib.rs Outdated Show resolved Hide resolved
rust/matches/src/lib.rs Outdated Show resolved Hide resolved
rust/matches/src/lib.rs Outdated Show resolved Hide resolved
rust/matches/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@long-banana long-banana left a 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)]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
#[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() {


Copy link
Collaborator

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<()> {

Copy link
Collaborator

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];
Copy link
Collaborator

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 = {}
Copy link
Collaborator

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

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