Skip to content

fix(contract-manager): preserve nativeToken during chain serialization - #3855

Open
Ysh204 wants to merge 1 commit into
pyth-network:mainfrom
Ysh204:fix/preserve-native-token-serialization
Open

fix(contract-manager): preserve nativeToken during chain serialization#3855
Ysh204 wants to merge 1 commit into
pyth-network:mainfrom
Ysh204:fix/preserve-native-token-serialization

Conversation

@Ysh204

@Ysh204 Ysh204 commented Jun 29, 2026

Copy link
Copy Markdown

Summary

Fixes #3854 by preserving nativeToken during chain serialization in @pythnetwork/contract-manager.

Details

Several Chain implementations deserialize nativeToken in fromJson() but do not serialize it back in toJson(). As a result, a fromJson() → toJson() round trip drops the configured nativeToken, and persistence paths that rely on toJson() lose this metadata.

This PR restores serialization symmetry by preserving nativeToken in toJson() for the affected chain implementations.

Testing

  • Added regression tests covering fromJson() → toJson() → fromJson() round trips for all affected chain classes.
  • Verified that the regression tests fail before the fix and pass after the fix.

Fixes #3854


Open in Devin Review

@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

4 Skipped Deployments
Project Deployment Actions Updated (UTC)
entropy-explorer Skipped Skipped Jun 29, 2026 7:51am
insights Skipped Skipped Jun 29, 2026 7:51am
proposals Skipped Skipped Jun 29, 2026 7:51am
staking Skipped Skipped Jun 29, 2026 7:51am

Request Review

@vercel
vercel Bot temporarily deployed to Preview – entropy-explorer June 29, 2026 07:39 Inactive
@vercel
vercel Bot temporarily deployed to Preview – proposals June 29, 2026 07:39 Inactive
@vercel
vercel Bot temporarily deployed to Preview – staking June 29, 2026 07:39 Inactive
@vercel
vercel Bot temporarily deployed to Preview – insights June 29, 2026 07:39 Inactive
@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

@Ysh204 is attempting to deploy a commit to the Pyth Network Team on Vercel.

A member of the Team first needs to authorize it.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 4 potential issues.

Open in Devin Review

Comment thread contract_manager/tests/chains.test.ts Outdated
Comment thread contract_manager/tests/chains.test.ts Outdated
Comment thread contract_manager/src/core/chains.ts
Comment thread contract_manager/src/core/chains.ts
@Ysh204
Ysh204 force-pushed the fix/preserve-native-token-serialization branch from b1420e1 to f197d02 Compare June 29, 2026 07:51
@vercel
vercel Bot temporarily deployed to Preview – proposals June 29, 2026 07:51 Inactive
@vercel
vercel Bot temporarily deployed to Preview – entropy-explorer June 29, 2026 07:51 Inactive
@vercel
vercel Bot temporarily deployed to Preview – insights June 29, 2026 07:51 Inactive
@vercel
vercel Bot temporarily deployed to Preview – staking June 29, 2026 07:51 Inactive
@Ysh204

Ysh204 commented Jun 29, 2026

Copy link
Copy Markdown
Author

@devin-ai-integration please re-review

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.

contract-manager: nativeToken is lost during chain serialization

1 participant