Make DeploymentTransactionArgs fields and module public#2461
Make DeploymentTransactionArgs fields and module public#2461
Conversation
WalkthroughTwo files were modified to increase the visibility of the order_operations module and its struct fields. The order_operations module was made public, and five fields of DeploymentTransactionArgs were made public to enable external access via wasm bindings. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@crates/js_api/src/gui/mod.rs`:
- Line 39: The current pub mod order_operations; exposes every public item in
that module (e.g., DeploymentTransactionArgs, CalldataFunction, VaultAndDeposit,
TokenAllowance, and all calldata result types); if you only intend to expose
DeploymentTransactionArgs and a few related types, make the module private
(remove the pub) and re-export only the needed symbols from this file via pub
use order_operations::{DeploymentTransactionArgs, ExtendedApprovalCalldata,
ExternalCall} (adjust names to the exact types you need) so downstream consumers
only see the intended API; if full exposure was intended, keep the pub mod
as-is.
| mod deposits; | ||
| mod field_values; | ||
| mod order_operations; | ||
| pub mod order_operations; |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Consider whether exposing the entire module is intentional.
Making order_operations public exposes all pub items within it — not just DeploymentTransactionArgs, but also CalldataFunction, VaultAndDeposit, TokenAllowance, and all the calldata result types. If the goal is only to expose DeploymentTransactionArgs and its related types for downstream consumers, a narrower approach would be to re-export specific items from mod.rs:
mod order_operations;
pub use order_operations::{DeploymentTransactionArgs, ExtendedApprovalCalldata, ExternalCall};If full module exposure is intended for the downstream REST API, then the current approach is fine.
🤖 Prompt for AI Agents
In `@crates/js_api/src/gui/mod.rs` at line 39, The current pub mod
order_operations; exposes every public item in that module (e.g.,
DeploymentTransactionArgs, CalldataFunction, VaultAndDeposit, TokenAllowance,
and all calldata result types); if you only intend to expose
DeploymentTransactionArgs and a few related types, make the module private
(remove the pub) and re-export only the needed symbols from this file via pub
use order_operations::{DeploymentTransactionArgs, ExtendedApprovalCalldata,
ExternalCall} (adjust names to the exact types you need) so downstream consumers
only see the intended API; if full exposure was intended, keep the pub mod
as-is.
Motivation
Needed for external access to
DeploymentTransactionArgsfields in downstream consumers.See: ST0x-Technology/st0x.rest.api#36
Solution
DeploymentTransactionArgsstruct public (approvals,deployment_calldata,orderbook_address,chain_id,emit_meta_call)order_operationsmodule visibility from private to public ingui/mod.rsChecks
By submitting this for review, I'm confirming I've done the following:
Summary by CodeRabbit