refactor: use canonical types from contract interface in test-parallel-contract#2858
Merged
refactor: use canonical types from contract interface in test-parallel-contract#2858
test-parallel-contract#2858Conversation
Code Review: refactor test-parallel-contract to use canonical types (#1057)Clean refactor that replaces locally-defined types with canonical ones from
No critical issues found. ✅ Approved |
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors test-parallel-contract to reuse canonical signing/CKD request types from near-mpc-contract-interface, eliminating locally duplicated request/payload structs and aligning the test contract’s JSON arguments with the shared interface.
Changes:
- Replace locally defined
Payload,SignRequest, andCKDRequestArgswithnear_mpc_contract_interface::types::{Payload, SignRequestArgs, CKDRequestArgs, DomainId, CKDAppPublicKey}. - Update payload construction to operate on raw bytes (SHA-256 output) rather than pre-hex-encoded strings.
- Remove the
hexdependency fromtest-parallel-contract(and corresponding lockfile entry).
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/test-parallel-contract/src/lib.rs | Switch to canonical interface types for sign/CKD args and adapt payload/domain_id construction accordingly. |
| crates/test-parallel-contract/Cargo.toml | Drop unused hex dependency after moving to interface Payload serialization. |
| Cargo.lock | Remove hex from test-parallel-contract dependency list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Change closure signature from Fn(Vec<u8>) to Fn([u8; 32]) and use .into() instead of .try_into().unwrap(), leveraging the infallible From<[T; L]> impl on BoundedVec
test-parallel-contract
netrome
approved these changes
Apr 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace locally-redefined
Payload,SignRequest,SignArgs, andCKDRequestArgswith canonical types fromnear-mpc-contract-interface, resolving theTODO(#1057)intest-parallel-contract.Closes #1057