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

Out-of-order signer accounts can cause issues with generated Anchor bindings #9

Open
nathanleclaire opened this issue May 5, 2022 · 2 comments

Comments

@nathanleclaire
Copy link

I ran into this issue using the code gen because in my Rust struct, the authority which I used to sign a transaction was not listed as the zeroth account, which is what the Solana runtime expects for verification (since the signature is in the zeroth index of the list of sigs). So anchor-go complained about sigs, yet, it worked in the Anchor JS client.

Anchor JS bindings, I think were doing some magic behind the scenes (https://github.com/project-serum/anchor/blob/master/ts/src/program/accounts-resolver.ts#L42 ?) to make the ordering work correctly, perhaps the generated Go code could do something like this as well. But that would also probably complicate the code, so I can definitely see it as unnecessary as well.

@gagliardetto
Copy link
Owner

gagliardetto commented May 8, 2022

Can you serialize to base64 the anchor equivalent of the same transaction? And post it here (or send privately)

@nathanleclaire
Copy link
Author

nathanleclaire commented May 11, 2022

Do you happen to know the code to do that in Anchor JS/TSX? I can get .transaction() off the RPC, but it's giving me some mystery complaints even after signing, setting fee payer, etc

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

No branches or pull requests

2 participants