Skip to content

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

Merged
armaniferrante merged 4 commits into
otter-sec:masterfrom
callensm:master
Mar 4, 2022
Merged

ts: fix methods builder .accounts requiring global programs#1548
armaniferrante merged 4 commits into
otter-sec:masterfrom
callensm:master

Conversation

@callensm

@callensm callensm commented Mar 3, 2022

Copy link
Copy Markdown
Contributor

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
Comment thread ts/src/program/accounts-resolver.ts Outdated
@armaniferrante armaniferrante merged commit eee75ab into otter-sec: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