-
Notifications
You must be signed in to change notification settings - Fork 8
Rust: Add ReportDataV10 schema #23
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for Report Data Version 10 Schema to the Rust chainlink_data_streams_report crate, extending the existing V8 schema with additional fields for multipliers and tokenized pricing.
- Implements a new ReportDataV10 struct with fields for current/new multipliers, activation dates, and tokenized pricing
- Adds encoding/decoding functionality and comprehensive test coverage for the new schema
- Updates package versions from 1.0.0/1.0.1 to 1.0.2 to reflect the new functionality
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| rust/crates/sdk/Cargo.toml | Updates SDK version and report dependency to 1.0.2 |
| rust/crates/report/src/report/v10.rs | Implements new ReportDataV10 struct with decode/encode methods and tests |
| rust/crates/report/src/report.rs | Adds v10 module import and test utilities for the new schema |
| rust/crates/report/Cargo.toml | Updates report crate version to 1.0.2 |
| let encoded = report_data.abi_encode().unwrap(); | ||
| let decoded = ReportDataV10::decode(&encoded).unwrap(); | ||
|
|
||
| const MOCK_MULTIPLIER: isize = 1000000000000000000; |
Copilot
AI
Aug 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The magic number 1000000000000000000 should be defined as a named constant or use a more readable format like 10_i128.pow(18) to clearly indicate it represents 1.0 with 18 decimal places.
| const MOCK_MULTIPLIER: isize = 1000000000000000000; | |
| const ONE_WITH_18_DECIMALS: isize = 10_isize.pow(18); | |
| const MOCK_MULTIPLIER: isize = ONE_WITH_18_DECIMALS; |
| const MOCK_MULTIPLIER: isize = 1000000000000000000; // 1.0 with 18 decimals | ||
|
|
Copilot
AI
Aug 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This duplicates the same magic number from the v10.rs test. Consider defining a shared constant or using 10_i128.pow(18) for better readability and maintainability.
| const MOCK_MULTIPLIER: isize = 1000000000000000000; // 1.0 with 18 decimals | |
| // Use shared constant for 1.0 with 18 decimals |
The merge-base changed after approval.
This PR adds Report Data Version 10 Schema to the Rust
chainlink_data_streams_reportcrate