Skip to content

For much larger games the authority (or permissionless) oracle may want to be resized.#30

Open
staccDOTsol wants to merge 5 commits into
raindrops-protocol:masterfrom
staccDOTsol:features/resize-oracle-cleaner-pr2
Open

For much larger games the authority (or permissionless) oracle may want to be resized.#30
staccDOTsol wants to merge 5 commits into
raindrops-protocol:masterfrom
staccDOTsol:features/resize-oracle-cleaner-pr2

Conversation

@staccDOTsol
Copy link
Copy Markdown

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

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

Choose a reason for hiding this comment

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

Remove gitpod config

Comment thread rust/matches/src/lib.rs Outdated
args.authority
);

const match = (await getMatch(oracle))[0];
Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread js/cli/src/matches.ts Outdated
Comment thread js/cli/src/matches.ts Outdated
Comment thread js/cli/src/matches.ts Outdated
async resizeOracle(
args: ResizeOracleArgs,
_accounts = {},
_additionalArgs = {}
Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread rust/matches/src/lib.rs Outdated
Comment thread rust/matches/src/lib.rs Outdated
Comment thread rust/matches/src/lib.rs Outdated
Comment thread rust/matches/src/lib.rs Outdated
Comment thread rust/matches/src/lib.rs Outdated
Comment thread rust/matches/src/lib.rs Outdated
Comment thread rust/matches/src/lib.rs Outdated
Copy link
Copy Markdown
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.

Comment thread rust/matches/src/lib.rs
pub struct ResizeOracle<'info> {
#[account(constraint=winOracle.key() == match_instance.win_oracle)]
winOracle: UncheckedAccount<'info>,
#[account(address == match_instance.win_oracle)]
Copy link
Copy Markdown
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)]

Comment thread rust/matches/src/lib.rs
let new_size = args.resize as usize;
if new_size > win_oracle_account.data.borrow().len() {


Copy link
Copy Markdown
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

Comment thread rust/matches/src/lib.rs
ctx: Context<'a, 'b, 'c, 'info, ResizeOracle<'info>>,
args: ResizeOracleArgs,
) -> Result<()> {

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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