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

Fix example sponsor transaction error #413

Merged
merged 4 commits into from
Sep 9, 2024
Merged

Conversation

0xRichBot
Copy link
Contributor

At now, when you try to test function Sponsor Transaction Flow - [Submit Transaction] in NextJS demo, website will come out with the Application error
Here is the error code from console:
{"message":"Invalid transaction: Type: Validation Code: INVALID_SIGNATURE","error_code":"vm_error","vm_error_code":1}

Error Reason: When calling method signAsFeePayer, the function needs to pass in the Account type. So it's useless to call signTransaction when you can't have the private key for the sponsor account.

Fixed Way: As noted above, I add const sponsor = Account.generate(); to act as a sponsor. And use signAsFeePayer to sign transaction.

Hope u enjoy my code :)

Copy link
Collaborator

@0xmaayan 0xmaayan left a comment

Choose a reason for hiding this comment

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

overall LGTM, thanks for the contribution!

  • Please revert any format changes
  • Please revert pnpm-lock.yaml - it should not include any changes

@0xRichBot 0xRichBot requested a review from 0xmaayan September 6, 2024 06:46
@0xmaayan
Copy link
Collaborator

0xmaayan commented Sep 6, 2024

@0xRichBot Please revert pnpm-lock.yaml - it shouldn't have any changes or be included in the PR.

@0xmaayan 0xmaayan merged commit e954520 into aptos-labs:main Sep 9, 2024
4 checks passed
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