-
Notifications
You must be signed in to change notification settings - Fork 109
sdk - large scr value fix & test #2257
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 fixes a bug where large Smart Contract Result (SCR) values that exceed u64::MAX could not be properly parsed from transaction data. The fix changes the value field type from u64 to u128 in the ApiSmartContractResult struct and adds comprehensive test coverage using real mainnet transaction data.
- Changed
ApiSmartContractResult::valuefromu64tou128to handle large values - Added test case with real mainnet transaction data containing SCR value exceeding
u64::MAX - Updated example to use mainnet transaction for demonstration
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| sdk/core/src/data/transaction.rs | Changed value field type from u64 to u128 in ApiSmartContractResult struct to support large SCR values |
| sdk/core/tests/retrieve_tx_on_network_test.rs | Added test case tx_with_large_scr_value to verify large value handling |
| sdk/core/tests/tx_with_large_scr_value.json | Added real mainnet transaction JSON data containing SCR with value 667724319460794006649 (exceeds u64::MAX) |
| sdk/http/examples/tx_info.rs | Updated example to use mainnet gateway and the transaction hash from test data; changed to wildcard import |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Contract comparison - from a89768e to b48518e
|
Coverage SummaryTotals
FilesExpand
|
Issue signalled here: #2228