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

[GraphQL] Rework Event type #19654

Merged

Conversation

stefan-mysten
Copy link
Contributor

@stefan-mysten stefan-mysten commented Oct 2, 2024

Description

Accessing the bcs field of an Event is rather confusing, as it is not the whole event BCS encoded, but just the contents of it, more specifically, the BCS bytes of a MoveValue.

This PR removes the #flatten in Event, adds a contents field to the type, and adds the bcs field to the Event type which encodes the whole Event.

Test plan

Existing tests


Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • Indexer:
  • JSON-RPC:
  • GraphQL: The Event type has a new field called contents, which is the event's content value as a MoveValue. This replaces the previous scheme that flattened the MoveValue type in the Event type. A bcs field was also added, which represents the Base64 encoded BCS serialized event.
  • CLI:
  • Rust SDK:
  • REST API:

Copy link

vercel bot commented Oct 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 8, 2024 3:48am
sui-typescript-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 8, 2024 3:48am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Oct 8, 2024 3:48am
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Oct 8, 2024 3:48am

Copy link
Member

@amnn amnn left a comment

Choose a reason for hiding this comment

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

Nice, thank you @stefan-mysten ! Could you also give a heads up to the SDK working group about this change and when it's expected to be released?

@stefan-mysten
Copy link
Contributor Author

stefan-mysten commented Oct 4, 2024

Nice, thank you @stefan-mysten ! Could you also give a heads up to the SDK working group about this change and when it's expected to be released?

Definitely, thanks for the reminder!

Copy link
Contributor

github-actions bot commented Oct 7, 2024

⚠️ 🦋 Changesets Warning: This PR has changes to public npm packages, but does not contain a changeset. You can create a changeset easily by running pnpm changeset in the root of the Sui repo, and following the prompts. If your change does not need a changeset (e.g. a documentation-only change), you can ignore this message. This warning will be removed when a changeset is added to this pull request.

Learn more about Changesets.

@@ -71,7 +71,7 @@ jobs:
run: pnpm dlx concurrently --kill-others --success command-1 "$E2E_RUN_LOCAL_NET_CMD" 'pnpm --filter @mysten/sui test:e2e'

- name: Run RPC/GrpahQL comaptability e2e tests
if: ${{ needs.diff.outputs.isGraphQlTransport == 'true' || needs.diff.outputs.isRust == 'true'}}
if: ${{ (needs.diff.outputs.isGraphQlTransport == 'true' || needs.diff.outputs.isRust == 'true') && github.ref == 'refs/heads/main' }}
Copy link
Contributor

Choose a reason for hiding this comment

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

this will also disable this on all PRs right?

Copy link
Contributor

Choose a reason for hiding this comment

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

we probably still want this for PRs, but just against localnet

Copy link
Contributor Author

@stefan-mysten stefan-mysten Oct 7, 2024

Choose a reason for hiding this comment

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

I pushed another commit that checks specifically for devnet and testnet branches. I think that should work, what do you think? @hayes-mysten

Copy link
Contributor

Choose a reason for hiding this comment

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

I am not very familiar with the github workflow syntax, but seems reasonable to me!

@stefan-mysten stefan-mysten merged commit f780402 into MystenLabs:main Oct 8, 2024
47 checks passed
@stefan-mysten stefan-mysten deleted the gql_fix_events_schema_naming branch October 8, 2024 05:56
stefan-mysten added a commit to stefan-mysten/sui that referenced this pull request Oct 9, 2024
stefan-mysten added a commit to stefan-mysten/sui that referenced this pull request Oct 9, 2024
stefan-mysten added a commit to stefan-mysten/sui that referenced this pull request Oct 9, 2024
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.

4 participants