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

ts: fix methods builder .accounts requiring global programs #1548

Merged
merged 4 commits into from
Mar 4, 2022
Merged

ts: fix methods builder .accounts requiring global programs #1548

merged 4 commits into from
Mar 4, 2022

Conversation

callensm
Copy link
Member

@callensm callensm commented Mar 3, 2022

After my last PR (#1539), the .accounts() function on the methods builder was requiring that global on-chain programs (systemProgram, tokenProgram, etc) be manually added.

This PR fixes that by having a static mapping in AccountsResolver of the resolvable global names and their PublicKeys and then excluding those names from the object provided to .accounts().

This has the implication that we no longer allow developers to manually add those program public keys to the .accounts() object which would prevent user error with public key inputs.

resolves #1547

@callensm callensm changed the title ts: fix methods builder .accounts requiring global programs [WIP] ts: fix methods builder .accounts requiring global programs Mar 3, 2022
@callensm callensm changed the title [WIP] ts: fix methods builder .accounts requiring global programs ts: fix methods builder .accounts requiring global programs Mar 3, 2022
@armaniferrante armaniferrante merged commit eee75ab into coral-xyz:master Mar 4, 2022
NBNARADHYA pushed a commit to MLH-Fellowship/anchor that referenced this pull request Mar 8, 2022
NBNARADHYA pushed a commit to MLH-Fellowship/anchor that referenced this pull request Mar 9, 2022
NBNARADHYA pushed a commit to MLH-Fellowship/anchor that referenced this pull request Mar 9, 2022
NBNARADHYA pushed a commit to MLH-Fellowship/anchor that referenced this pull request Mar 9, 2022
NBNARADHYA pushed a commit to MLH-Fellowship/anchor that referenced this pull request Mar 9, 2022
NBNARADHYA pushed a commit to MLH-Fellowship/anchor that referenced this pull request Mar 9, 2022
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.

Typescript complains when .accounts() from MethodNamespace is missing an account
2 participants