feat(interface): typed vote and admin methods on MpcContractHandle - #3922
Conversation
d100b5c to
a5e813f
Compare
e02ffa0 to
983363a
Compare
ff6c2c3 to
afcab90
Compare
| impl<E> From<PayloadBytesError> for MpcContractHandleError<E> { | ||
| fn from(value: PayloadBytesError) -> Self { | ||
| match value { | ||
| PayloadBytesError::Serialize(err) => MpcContractHandleError::Serialize(err), | ||
| PayloadBytesError::Overflow => MpcContractHandleError::Deposit(DepositOverflowError), | ||
| } | ||
| } | ||
| } |
This comment was marked as resolved.
This comment was marked as resolved.
|
@claude review |
Pull request overviewFollow-up review after the prior blocking finding on Changes: unchanged from the earlier summary — the delta since is limited to the deposit fix on FindingsBlocking: none — the prior Non-blocking (nits, follow-ups):
|
804ff3b to
5074278
Compare
netrome
left a comment
There was a problem hiding this comment.
Nice stuff! I took the liberty to rebase the PR, but it already got a new conflict (with my other PR I believe). Will update and re-approve.
| contract: mpc.near | ||
| method: vote_add_domains | ||
| gas: 300.0 Tgas | ||
| deposit: 0 NEAR | ||
| args: {"domains":[{"id":0,"protocol":"CaitSith","reconstruction_threshold":2,"purpose":"Sign"}]} |
There was a problem hiding this comment.
I think these are really nice! 🤩
| impl<E> From<PayloadBytesError> for MpcContractHandleError<E> { | ||
| fn from(value: PayloadBytesError) -> Self { | ||
| match value { | ||
| PayloadBytesError::Serialize(err) => MpcContractHandleError::Serialize(err), | ||
| PayloadBytesError::Overflow => MpcContractHandleError::Deposit(DepositOverflowError), | ||
| } | ||
| } | ||
| } |
Addressed in 86623a9 |
…ant_url The contract requires MINIMUM_NODE_MANAGEMENT_DEPOSIT on update_participant_url like on register_backup_service and start_node_migration; the handle attached nothing, failing the update_participant_url e2e test.
86623a9 to
8a904cd
Compare
netrome
left a comment
There was a problem hiding this comment.
Took the liberty to rebase and resolve another conflict. Should be good to go now.
There was a problem hiding this comment.
Pull request overview
Adds nine typed governance/admin methods to MpcContractHandle and migrates e2e callers away from hand-built wire payloads.
Changes:
- Adds typed arguments, gas, and deposit handling.
- Migrates governance, migration, and foreign-chain e2e calls.
- Extends wire-format snapshot coverage.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
crates/near-mpc-contract-interface/src/client.rs |
Adds typed handle methods. |
crates/near-mpc-contract-interface/src/call_args.rs |
Adds typed JSON argument DTOs. |
crates/near-mpc-contract-interface/src/deposits.rs |
Centralizes management deposit. |
crates/near-mpc-contract-interface/src/snapshots/near_mpc_contract_interface__client__tests__mpc_contract_handle__should_match_the_wire_format_catalog.snap |
Records new wire formats. |
crates/near-contract-transport/src/types.rs |
Adds function-call constructors. |
crates/contract/src/lib.rs |
Reuses interface deposit constant. |
crates/e2e-tests/src/blockchain.rs |
Removes superseded raw-call helpers. |
crates/e2e-tests/src/cluster.rs |
Routes targeted calls through the handle. |
crates/e2e-tests/src/mpc_node.rs |
Returns typed signer public keys. |
crates/e2e-tests/tests/web_endpoints.rs |
Adapts public-key formatting. |
crates/e2e-tests/tests/migration_service.rs |
Uses typed migration DTOs. |
crates/e2e-tests/tests/migration_endpoint.rs |
Uses typed migration DTOs. |
crates/e2e-tests/README.md |
Updates e2e contract-call documentation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| `NearKitCaller`), `call_from_with_deposit` (untyped escape hatch for | ||
| `prepay_attestation_storage`, which has no typed method yet), `view`, and |
| client. It exposes `call`/`call_final` (from the contract account, used only | ||
| for `init`), `handle_for` (a typed `MpcContractHandle` calling as a given |
|
@claude review |
Pull request overviewMoves the e2e suite's vote/admin contract calls off the stringly-typed Changes:
Reviewed changesPer-file summary
FindingsI checked the migrated call sites against the contract: Non-blocking (follow-ups, nits):
✅ Approved |
resolves #3921, part of #3693