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 delegate schema #1314

Merged
merged 4 commits into from
Mar 11, 2024
Merged

Fix delegate schema #1314

merged 4 commits into from
Mar 11, 2024

Conversation

gagdiez
Copy link
Contributor

@gagdiez gagdiez commented Mar 11, 2024

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • Commit messages follow the conventional commits spec
  • If this is a code change: I have written unit tests.
  • If this changes code in a published package: I have run pnpm changeset to create a changeset JSON document appropriate for this change.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

Currently people can create meta-transactions, but once they are relayed, the RPC answers Parse error: Failed to decode transaction: Unexpected variant tag: 131. This is because the transaction is being wrongly serialized since two fields are swapped in the Schema.

Test Plan

Added a test checking that the SCHEMA can deserialize a valid delegateAction, since the SCHEMA is the same for both serialization and deserialization, that should suffice

Related issues/PRs

#1313

gagdiez added 4 commits March 11, 2024 16:11
The current schema has two fields swapped (actions and nonce), which
makes it impossible to create DelegateActions, since the borsh
serialization ends up mixing the nonce with the action
Copy link

changeset-bot bot commented Mar 11, 2024

🦋 Changeset detected

Latest commit: d3feb0d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@near-js/transactions Patch
@near-js/accounts Patch
@near-js/cookbook Patch
near-api-js Patch
@near-js/providers Patch
@near-js/wallet-account Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@gagdiez gagdiez requested a review from gtsonevv March 11, 2024 15:51
@gagdiez
Copy link
Contributor Author

gagdiez commented Mar 11, 2024

@gtsonevv can we get this released ASAP? People cannot create meta-transactions :/

@gagdiez gagdiez linked an issue Mar 11, 2024 that may be closed by this pull request
4 tasks
@frol frol merged commit 42dc7e2 into master Mar 11, 2024
3 checks passed
@frol frol deleted the fix-delegate-schema branch March 11, 2024 20:15
@github-actions github-actions bot mentioned this pull request Mar 11, 2024
andy-haynes pushed a commit that referenced this pull request Aug 15, 2024
The current schema has two fields swapped (actions and nonce), which
makes it impossible to create DelegateActions, since the borsh
serialization ends up mixing the nonce with the action
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.

SignedDelegate is not working
2 participants