Skip to content

Replace dotrain order dummy constructor with class constructor#1907

Merged
hardyjosh merged 8 commits intomainfrom
2025-06-04-dotrain-order-wasm-class
Jun 6, 2025
Merged

Replace dotrain order dummy constructor with class constructor#1907
hardyjosh merged 8 commits intomainfrom
2025-06-04-dotrain-order-wasm-class

Conversation

@findolor
Copy link
Copy Markdown
Collaborator

@findolor findolor commented Jun 4, 2025

Caution

Chained PR - do not merge before #1906

Motivation

See issue: #1855
Now that we've bumped the wasm-bindgen-utils version and have the ability to use class constructors with wasm bindings, this PR implements the first pass for dotrain order class

Solution

Checks

By submitting this for review, I'm confirming I've done the following:

  • made this PR as small as possible
  • unit-tested any new functionality
  • linked any relevant issues or PRs
  • included screenshots (if this involves a front-end change)

fix #1855

Summary by CodeRabbit

  • Refactor
    • Simplified the creation and initialization of DotrainOrder objects across the application by consolidating the previous two-step process into a single asynchronous call, enhancing efficiency and reducing complexity.
  • Bug Fixes
    • Improved error handling in tests to provide clearer feedback when order creation fails.
  • Chores
    • Updated the wasm-bindgen-utils dependency to version 0.0.9.

@findolor findolor added this to the Raindex SDK v1 milestone Jun 4, 2025
@findolor findolor self-assigned this Jun 4, 2025
@findolor findolor added the rust Related to rust crates label Jun 4, 2025
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 4, 2025

## Walkthrough

This change refactors all usages of the `DotrainOrder` struct to consolidate its creation and initialization into a single asynchronous `create` method, replacing the previous two-step pattern of calling `new()` followed by `initialize()`. Related tests and API surfaces are updated accordingly, and the `wasm-bindgen-utils` dependency is bumped from version 0.0.8 to 0.0.9.

## Changes

| File(s)                                                                 | Change Summary                                                                                                   |
|-------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|
| crates/common/src/dotrain_order/mod.rs                                  | Removes `new`, `initialize`, and `ensure_initialized`; updates `create` to return initialized instance directly. |
| crates/cli/src/commands/order/calldata.rs<br>crates/cli/src/commands/order/compose.rs<br>crates/cli/src/commands/order/listorderfrontmatterkeys.rs<br>crates/cli/src/commands/order/orderbook_address.rs<br>crates/cli/src/commands/words/mod.rs | Refactors to use `DotrainOrder::create` instead of `new` + `initialize`.                                         |
| crates/common/src/add_order.rs<br>crates/common/src/replays.rs          | Updates test code to use `DotrainOrder::create` for initialization.                                              |
| crates/integration_tests/src/lib.rs                                     | Refactors test initialization to use `DotrainOrder::create`.                                                     |
| crates/js_api/src/gui/mod.rs<br>crates/js_api/src/gui/state_management.rs | Refactors all creation to use `DotrainOrder::create`; removes separate initialization step.                      |
| crates/quote/src/order_quotes.rs<br>crates/quote/src/quote_debug.rs     | Updates test helpers and tests to use single-step `DotrainOrder::create`.                                        |
| packages/orderbook/test/common/test.test.ts                             | Refactors tests to handle result from `DotrainOrder.create` as a result object, with explicit error checks.      |
| tauri-app/src-tauri/Cargo.toml<br>Cargo.toml                            | Bumps `wasm-bindgen-utils` dependency from 0.0.8 to 0.0.9.                                                       |
| tauri-app/src-tauri/src/commands/authoring_meta.rs<br>tauri-app/src-tauri/src/commands/order.rs<br>tauri-app/src-tauri/src/commands/order_quote.rs<br>tauri-app/src-tauri/src/commands/trade_debug.rs | Refactors all usages to single-step `DotrainOrder::create` initialization.                                       |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant Caller
    participant DotrainOrder

    Caller->>DotrainOrder: create(dotrain, settings) (async)
    activate DotrainOrder
    DotrainOrder-->>Caller: Initialized DotrainOrder instance

Assessment against linked issues

Objective Addressed Explanation
Use static class fn to get DotrainOrderGui instance (#1854) No static class function for obtaining DotrainOrderGui instance is introduced or refactored in this PR.

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Refactor all DotrainOrder creation to single-step async create (multiple files) This refactor is unrelated to the objective of introducing a static class function for DotrainOrderGui.
Bump wasm-bindgen-utils dependency version (Cargo.toml, tauri-app/src-tauri/Cargo.toml) Dependency update is unrelated to the stated objective.

Possibly related PRs

Suggested labels

Tauri

Suggested reviewers

  • hardyjosh
  • 0xgleb

<!-- walkthrough_end -->
<!-- This is an auto-generated comment: all tool run failures by coderabbit.ai -->

> [!WARNING]
> There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.
> 
> <details>
> <summary>🔧 ESLint</summary>
> 
> > If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.
> 
> npm error Exit handler never called!
> npm error This is an error with npm itself. Please report this error at:
> npm error   <https://github.com/npm/cli/issues>
> npm error A complete log of this run can be found in: /.npm/_logs/2025-06-05T04_54_12_707Z-debug-0.log
> 
> 
> 
> </details>

<!-- end of auto-generated comment: all tool run failures by coderabbit.ai -->


---

<details>
<summary>📜 Recent review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: ASSERTIVE**
**Plan: Pro**


<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between b73b92a2c4420aa4b7d04a53b20f354983dfb2fd and cf5d974a18deea994c77fb98508387a88621ffec.

</details>

<details>
<summary>⛔ Files ignored due to path filters (1)</summary>

* `Cargo.lock` is excluded by `!**/*.lock`

</details>

<details>
<summary>📒 Files selected for processing (18)</summary>

* `crates/cli/src/commands/order/calldata.rs` (1 hunks)
* `crates/cli/src/commands/order/compose.rs` (1 hunks)
* `crates/cli/src/commands/order/listorderfrontmatterkeys.rs` (1 hunks)
* `crates/cli/src/commands/order/orderbook_address.rs` (1 hunks)
* `crates/cli/src/commands/words/mod.rs` (1 hunks)
* `crates/common/src/add_order.rs` (2 hunks)
* `crates/common/src/dotrain_order/mod.rs` (16 hunks)
* `crates/common/src/replays.rs` (1 hunks)
* `crates/integration_tests/src/lib.rs` (2 hunks)
* `crates/js_api/src/gui/mod.rs` (5 hunks)
* `crates/js_api/src/gui/state_management.rs` (1 hunks)
* `crates/quote/src/order_quotes.rs` (1 hunks)
* `crates/quote/src/quote_debug.rs` (3 hunks)
* `packages/orderbook/test/common/test.test.ts` (2 hunks)
* `tauri-app/src-tauri/src/commands/authoring_meta.rs` (1 hunks)
* `tauri-app/src-tauri/src/commands/order.rs` (2 hunks)
* `tauri-app/src-tauri/src/commands/order_quote.rs` (1 hunks)
* `tauri-app/src-tauri/src/commands/trade_debug.rs` (1 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🧠 Learnings (1)</summary>

<details>
<summary>packages/orderbook/test/common/test.test.ts (1)</summary>

Learnt from: findolor
PR: #1907
File: packages/orderbook/test/common/test.test.ts:75-77
Timestamp: 2025-06-04T10:21:01.388Z
Learning: The DotrainOrder.create API in packages/orderbook/test/common/test.test.ts is internal and not used directly in consumer applications, so API changes here don't require external breaking change documentation.


</details>

</details><details>
<summary>🧬 Code Graph Analysis (9)</summary>

<details>
<summary>tauri-app/src-tauri/src/commands/trade_debug.rs (1)</summary><blockquote>

<details>
<summary>crates/common/src/dotrain_order/mod.rs (2)</summary>

* `create` (229-274)
* `dotrain` (278-280)

</details>

</blockquote></details>
<details>
<summary>tauri-app/src-tauri/src/commands/order_quote.rs (1)</summary><blockquote>

<details>
<summary>crates/common/src/dotrain_order/mod.rs (2)</summary>

* `create` (229-274)
* `dotrain` (278-280)

</details>

</blockquote></details>
<details>
<summary>crates/cli/src/commands/order/orderbook_address.rs (1)</summary><blockquote>

<details>
<summary>crates/common/src/dotrain_order/mod.rs (2)</summary>

* `create` (229-274)
* `dotrain` (278-280)

</details>

</blockquote></details>
<details>
<summary>crates/cli/src/commands/order/calldata.rs (1)</summary><blockquote>

<details>
<summary>crates/common/src/dotrain_order/mod.rs (2)</summary>

* `create` (229-274)
* `dotrain` (278-280)

</details>

</blockquote></details>
<details>
<summary>crates/integration_tests/src/lib.rs (1)</summary><blockquote>

<details>
<summary>crates/common/src/dotrain_order/mod.rs (2)</summary>

* `create` (229-274)
* `dotrain` (278-280)

</details>

</blockquote></details>
<details>
<summary>crates/cli/src/commands/words/mod.rs (1)</summary><blockquote>

<details>
<summary>crates/common/src/dotrain_order/mod.rs (2)</summary>

* `create` (229-274)
* `dotrain` (278-280)

</details>

</blockquote></details>
<details>
<summary>packages/orderbook/test/common/test.test.ts (2)</summary><blockquote>

<details>
<summary>crates/common/src/dotrain_order/mod.rs (1)</summary>

* `dotrain` (278-280)

</details>
<details>
<summary>tauri-app/src/__tests__/pickConfig.test.ts (1)</summary>

* `config` (11-182)

</details>

</blockquote></details>
<details>
<summary>crates/cli/src/commands/order/listorderfrontmatterkeys.rs (1)</summary><blockquote>

<details>
<summary>crates/common/src/dotrain_order/mod.rs (2)</summary>

* `create` (229-274)
* `dotrain` (278-280)

</details>

</blockquote></details>
<details>
<summary>tauri-app/src-tauri/src/commands/authoring_meta.rs (1)</summary><blockquote>

<details>
<summary>crates/common/src/dotrain_order/mod.rs (2)</summary>

* `create` (229-274)
* `dotrain` (278-280)

</details>

</blockquote></details>

</details>

</details>

<details>
<summary>⏰ Context from checks skipped due to timeout of 90000ms (16)</summary>

* GitHub Check: build-tauri (ubuntu-22.04, true)
* GitHub Check: test
* GitHub Check: test
* GitHub Check: standard-tests (ubuntu-latest, rainix-sol-legal)
* GitHub Check: standard-tests (ubuntu-latest, rainix-rs-static)
* GitHub Check: standard-tests (ubuntu-latest, rainix-wasm-test)
* GitHub Check: standard-tests (ubuntu-latest, rainix-wasm-artifacts)
* GitHub Check: standard-tests (ubuntu-latest, ob-rs-test, true)
* GitHub Check: standard-tests (ubuntu-latest, test-js-bindings)
* GitHub Check: test
* GitHub Check: standard-tests (ubuntu-latest, rainix-sol-static)
* GitHub Check: git-clean
* GitHub Check: standard-tests (ubuntu-latest, rainix-rs-artifacts, true)
* GitHub Check: standard-tests (ubuntu-latest, rainix-sol-artifacts)
* GitHub Check: Deploy-Preview
* GitHub Check: standard-tests (ubuntu-latest, rainix-sol-test)

</details>

<details>
<summary>🔇 Additional comments (28)</summary><blockquote>

<details>
<summary>crates/quote/src/quote_debug.rs (1)</summary>

`160-160`: **LGTM! Consistent refactoring to use the new `create` method.**

The changes consistently replace the old two-step `DotrainOrder::new()` + `initialize()` pattern with the new single `DotrainOrder::create()` method across all three test functions. The async patterns and error handling are correct.



Also applies to: 288-288, 414-414

</details>
<details>
<summary>crates/cli/src/commands/order/orderbook_address.rs (1)</summary>

`37-37`: **LGTM! Correct refactoring with proper settings handling.**

The change correctly replaces the old two-step pattern with `DotrainOrder::create()` and properly handles the settings parameter by mapping `Option<String>` to `Option<Vec<String>>` as required by the new API. Error handling with the `?` operator is appropriate for this production code context.

</details>
<details>
<summary>tauri-app/src-tauri/src/commands/trade_debug.rs (1)</summary>

`123-123`: **LGTM! Consistent refactoring pattern.**

The change correctly adopts the new `DotrainOrder::create()` method, maintaining consistency with the refactoring pattern applied throughout the codebase. The async handling and error unwrapping are appropriate for test code.

</details>
<details>
<summary>tauri-app/src-tauri/src/commands/order_quote.rs (1)</summary>

`127-127`: **LGTM! Consistent with the overall refactoring.**

The change correctly implements the new `DotrainOrder::create()` pattern, maintaining consistency with the refactoring applied across the entire codebase. The async handling is proper and the use of `unwrap()` is appropriate for test code.

</details>
<details>
<summary>crates/cli/src/commands/order/calldata.rs (1)</summary>

`39-39`: **LGTM: Clean refactoring to new async factory method**

The change correctly replaces the old two-step initialization pattern with the new `DotrainOrder::create()` method. The parameter mapping logic properly converts the optional settings string to `Option<Vec<String>>` format expected by the new API.

</details>
<details>
<summary>crates/common/src/replays.rs (1)</summary>

`148-148`: **LGTM: Test updated to use new async factory method**

The change correctly updates the test to use the new `DotrainOrder::create()` method. Using `unwrap()` is appropriate for test code where we expect the operation to succeed.

</details>
<details>
<summary>crates/js_api/src/gui/state_management.rs (1)</summary>

`181-181`: **LGTM: GUI state deserialization updated correctly**

The change properly updates the GUI state deserialization to use the new `DotrainOrder::create()` method. The error propagation with `?` operator is appropriate for this async context.

</details>
<details>
<summary>crates/integration_tests/src/lib.rs (1)</summary>

`87-87`: **LGTM: Integration tests updated to new API pattern**

Both test functions correctly update to use the new `DotrainOrder::create()` method instead of the old two-step initialization. The use of `unwrap()` is appropriate for test code, and the `None` parameter for settings is correct since these tests don't require additional configuration.




Also applies to: 194-194

</details>
<details>
<summary>crates/cli/src/commands/order/listorderfrontmatterkeys.rs (1)</summary>

`44-44`: **LGTM: Clean refactoring to consolidated creation pattern.**

The change correctly replaces the two-step initialization pattern with the new async `create` method. The parameter conversion `settings.map(|v| vec![v])` properly transforms `Option<String>` to `Option<Vec<String>>` as required by the new API signature.

</details>
<details>
<summary>crates/cli/src/commands/order/compose.rs (1)</summary>

`45-45`: **LGTM: Consistent application of the new creation pattern.**

This change correctly follows the same refactoring pattern as other files, replacing the two-step initialization with the consolidated `DotrainOrder::create()` method. The parameter handling and async usage are appropriate.

</details>
<details>
<summary>tauri-app/src-tauri/src/commands/order.rs (3)</summary>

`144-144`: **LGTM: Correct parameter handling for existing Vec<String> type.**

The change properly uses the new `create` method with `settings` already being `Option<Vec<String>>`, so no parameter conversion is needed. The async error handling is appropriate.

---

`152-152`: **LGTM: Proper conversion from Vec<String> to Option<Vec<String>>.**

The change correctly wraps the `Vec<String>` parameter with `Some()` to match the expected `Option<Vec<String>>` signature of the `create` method.

---

`441-441`: **LGTM: Correct test usage with None parameter.**

The test correctly demonstrates usage of the new `create` method with `None` for the settings parameter, which is appropriate for this test scenario.

</details>
<details>
<summary>crates/cli/src/commands/words/mod.rs (1)</summary>

`95-95`: **LGTM: Consistent implementation of the consolidated creation pattern.**

The change correctly replaces the two-step initialization with the new `DotrainOrder::create()` method. The parameter conversion `settings.map(|v| vec![v])` appropriately transforms the type, and the async error handling is proper.

</details>
<details>
<summary>crates/common/src/add_order.rs (2)</summary>

`900-900`: **LGTM: Refactor follows new DotrainOrder API pattern.**

The change correctly adopts the new consolidated `create` method, replacing the previous two-step initialization process.

---

`990-990`: **LGTM: Consistent with API refactor.**

This change correctly mirrors the pattern used elsewhere, maintaining consistency across the codebase.

</details>
<details>
<summary>crates/quote/src/order_quotes.rs (1)</summary>

`280-280`: **LGTM: Test helper updated for new API.**

The refactor correctly updates the test helper to use the consolidated `create` method.

</details>
<details>
<summary>crates/js_api/src/gui/mod.rs (5)</summary>

`75-75`: **LGTM: Static method updated for new DotrainOrder API.**

The refactor correctly updates the public API method to use the new consolidated creation pattern with appropriate error handling.

---

`88-88`: **LGTM: Instance method correctly updated.**

The change properly implements the new API pattern while maintaining the existing functionality of updating the instance state.

---

`207-207`: **LGTM: Strategy details method updated consistently.**

The static method correctly adopts the new DotrainOrder creation pattern.

---

`220-220`: **LGTM: Deployment details method follows refactor pattern.**

The static method is correctly updated to use the new consolidated API.

---

`272-272`: **LGTM: Rainlang composition method updated appropriately.**

The method correctly uses the new API pattern for creating a DotrainOrder from the regenerated dotrain text.

</details>
<details>
<summary>packages/orderbook/test/common/test.test.ts (1)</summary>

`99-101`: **Consistent API usage pattern.**

</details>
<details>
<summary>tauri-app/src-tauri/src/commands/authoring_meta.rs (1)</summary>

`9-9`: **Clean refactor to single-step initialization.**

The simplified API usage eliminates the need for mutable state and reduces the initialization to a single async call. This aligns well with the broader refactor across the codebase.

</details>
<details>
<summary>crates/common/src/dotrain_order/mod.rs (4)</summary>

`15-15`: **Import cleanup is appropriate.**

---

`218-223`: **Dummy method updated consistently with the refactor.**

The `dummy()` method now creates a `DotrainYaml` with empty sources, which is appropriate for a dummy instance and consistent with the removal of Cache dependencies.

---

`226-274`: **Well-structured factory method implementation.**

The `create()` method consolidates all initialization logic into a single async factory method with proper:
- Spec version validation
- Remote network and token fetching
- Comprehensive error handling
- WASM export compatibility

This is a significant improvement over the previous two-step initialization pattern.

---

`516-517`: **Test suite properly updated to use the new API.**

All tests have been consistently updated to use the single-step `create()` method, eliminating the need for mutable variables and separate initialization calls.



Also applies to: 561-563, 613-615, 662-665, 709-711, 755-757, 805-807, 860-862, 916-918, 994-996, 1178-1180, 1201-1203, 1231-1233, 1297-1299

</details>

</blockquote></details>

</details>
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrKNwS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AgXYLQG2BSg0AEoShUwqmDkLpQmwMUOQtoBTABAtoqYPQGigYKpgEoWgJsF2DcLxQSgTOJsE2BSgGAuwXYOIuEUShtgIisULsDQBigxQ5IW0esDZ5awSFEAfPFgo1Rgtn0+C8NvFH0BAA== -->

<!-- internal state end -->
<!-- finishing_touch_checkbox_start -->

<details open="true">
<summary>✨ Finishing Touches</summary>

- [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate Docstrings

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---

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.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=rainlanguage/rain.orderbook&utm_content=1907):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Explain this complex logic.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai explain this code block.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and explain its main purpose.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

### Support

Need help? Create a ticket on our [support page](https://www.coderabbit.ai/contact-us/support) for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->

@findolor findolor marked this pull request as draft June 4, 2025 09:42
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5de9547 and b73b92a.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • tauri-app/src-tauri/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (20)
  • Cargo.toml (1 hunks)
  • crates/cli/src/commands/order/calldata.rs (1 hunks)
  • crates/cli/src/commands/order/compose.rs (1 hunks)
  • crates/cli/src/commands/order/listorderfrontmatterkeys.rs (1 hunks)
  • crates/cli/src/commands/order/orderbook_address.rs (1 hunks)
  • crates/cli/src/commands/words/mod.rs (1 hunks)
  • crates/common/src/add_order.rs (2 hunks)
  • crates/common/src/dotrain_order/mod.rs (15 hunks)
  • crates/common/src/replays.rs (1 hunks)
  • crates/integration_tests/src/lib.rs (2 hunks)
  • crates/js_api/src/gui/mod.rs (5 hunks)
  • crates/js_api/src/gui/state_management.rs (1 hunks)
  • crates/quote/src/order_quotes.rs (1 hunks)
  • crates/quote/src/quote_debug.rs (3 hunks)
  • packages/orderbook/test/common/test.test.ts (2 hunks)
  • tauri-app/src-tauri/Cargo.toml (1 hunks)
  • tauri-app/src-tauri/src/commands/authoring_meta.rs (1 hunks)
  • tauri-app/src-tauri/src/commands/order.rs (2 hunks)
  • tauri-app/src-tauri/src/commands/order_quote.rs (1 hunks)
  • tauri-app/src-tauri/src/commands/trade_debug.rs (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
Cargo.toml (1)
Learnt from: findolor
PR: rainlanguage/rain.orderbook#1710
File: crates/quote/Cargo.toml:30-30
Timestamp: 2025-05-14T04:49:14.621Z
Learning: In the rain.orderbook repository, wasm-bindgen-utils is intentionally used as an unconditional dependency because non-wasm targets (like tests) sometimes need to use it.
🧬 Code Graph Analysis (13)
crates/cli/src/commands/order/compose.rs (1)
crates/common/src/dotrain_order/mod.rs (2)
  • create (226-263)
  • dotrain (267-269)
tauri-app/src-tauri/src/commands/trade_debug.rs (1)
crates/common/src/dotrain_order/mod.rs (2)
  • create (226-263)
  • dotrain (267-269)
crates/cli/src/commands/order/calldata.rs (1)
crates/common/src/dotrain_order/mod.rs (2)
  • create (226-263)
  • dotrain (267-269)
crates/cli/src/commands/order/orderbook_address.rs (1)
crates/common/src/dotrain_order/mod.rs (2)
  • create (226-263)
  • dotrain (267-269)
tauri-app/src-tauri/src/commands/authoring_meta.rs (1)
crates/common/src/dotrain_order/mod.rs (2)
  • create (226-263)
  • dotrain (267-269)
crates/js_api/src/gui/state_management.rs (1)
crates/common/src/dotrain_order/mod.rs (2)
  • create (226-263)
  • dotrain (267-269)
crates/cli/src/commands/words/mod.rs (1)
crates/common/src/dotrain_order/mod.rs (2)
  • create (226-263)
  • dotrain (267-269)
crates/quote/src/quote_debug.rs (1)
crates/common/src/dotrain_order/mod.rs (2)
  • create (226-263)
  • dotrain (267-269)
crates/integration_tests/src/lib.rs (1)
crates/common/src/dotrain_order/mod.rs (2)
  • create (226-263)
  • dotrain (267-269)
tauri-app/src-tauri/src/commands/order_quote.rs (1)
crates/common/src/dotrain_order/mod.rs (2)
  • create (226-263)
  • dotrain (267-269)
crates/js_api/src/gui/mod.rs (1)
crates/common/src/dotrain_order/mod.rs (2)
  • create (226-263)
  • dotrain (267-269)
packages/orderbook/test/common/test.test.ts (2)
crates/common/src/dotrain_order/mod.rs (1)
  • dotrain (267-269)
tauri-app/src/__tests__/pickConfig.test.ts (1)
  • config (11-182)
crates/quote/src/order_quotes.rs (1)
crates/common/src/dotrain_order/mod.rs (2)
  • create (226-263)
  • dotrain (267-269)
🔇 Additional comments (25)
Cargo.toml (1)

55-55:

Details

✅ Verification successful

Verify the wasm-bindgen-utils version upgrade.

The version bump from 0.0.8 to 0.0.9 aligns with the PR objectives to leverage enhanced class constructor support. Please ensure this version is available and check for any breaking changes.


🏁 Script executed:

#!/bin/bash
# Check if wasm-bindgen-utils 0.0.9 exists on crates.io and look for any security advisories
curl -s https://crates.io/api/v1/crates/wasm-bindgen-utils | jq '.versions[] | select(.num == "0.0.9") | {num: .num, created_at: .created_at}'

# Check for any security advisories
gh api graphql -f query='
{
  securityVulnerabilities(first: 5, ecosystem: RUST, package: "wasm-bindgen-utils") {
    nodes {
      advisory {
        summary
        severity
        publishedAt
      }
      vulnerableVersionRange
      firstPatchedVersion {
        identifier
      }
    }
  }
}'

Length of output: 565


Confirmed wasm-bindgen-utils 0.0.9 is available and secure.

The crate version 0.0.9 was published on 2025-06-04 and no security advisories were found for this package. You can proceed with the upgrade.

tauri-app/src-tauri/Cargo.toml (1)

53-53: LGTM! Consistent dependency update.

The wasm-bindgen-utils version update is properly scoped to the wasm target and aligns with the workspace-level dependency bump.

crates/quote/src/quote_debug.rs (3)

157-157: LGTM! Proper implementation of the new DotrainOrder creation pattern.

The refactor correctly replaces the two-step initialization pattern with the new asynchronous create method, simplifying the code and enforcing initialization at creation time.


283-283: LGTM! Consistent usage of the new creation pattern.

The change follows the same pattern as other tests, maintaining consistency across the codebase.


407-407: LGTM! Final test updated consistently.

All three test functions now use the unified DotrainOrder::create method, completing the refactor for this file.

crates/common/src/replays.rs (1)

145-145: LGTM! Consistent implementation of the new DotrainOrder pattern.

The change correctly adopts the new DotrainOrder::create method, maintaining consistency with the broader refactor across the codebase.

tauri-app/src-tauri/src/commands/trade_debug.rs (1)

120-120: LGTM! Clean refactoring to consolidated async constructor.

The change from the two-step DotrainOrder::new() + initialize() pattern to the single DotrainOrder::create() call simplifies the API and eliminates the need for mutable variables while maintaining the same functionality.

tauri-app/src-tauri/src/commands/order_quote.rs (1)

124-124: LGTM! Consistent with the broader DotrainOrder API refactor.

The consolidation of creation and initialization into the single async create() method is applied consistently here, improving code clarity and eliminating mutable variable requirements.

crates/integration_tests/src/lib.rs (1)

84-84: LGTM! Consistent DotrainOrder API modernization in both test functions.

Both changes properly replace the old two-step initialization pattern with the new consolidated create() method, maintaining identical functionality while simplifying the code structure.

Also applies to: 189-189

crates/common/src/add_order.rs (1)

893-893: LGTM! Final consistent application of DotrainOrder API refactor.

Both test functions correctly adopt the new DotrainOrder::create() pattern, completing the systematic refactor to consolidate creation and initialization into a single async method call.

Also applies to: 981-981

crates/js_api/src/gui/state_management.rs (1)

181-181: LGTM! Clean consolidation of DotrainOrder creation and initialization.

This change successfully replaces the previous two-step pattern (new + initialize) with a single async factory method call, eliminating the need for mutable variables and separate initialization steps.

crates/cli/src/commands/words/mod.rs (1)

95-95: LGTM! Consistent refactor with proper settings handling.

The change correctly consolidates DotrainOrder creation and initialization while properly transforming the optional settings string into the expected vector format.

crates/cli/src/commands/order/compose.rs (1)

45-45: LGTM! Follows the established refactor pattern correctly.

The consolidation of DotrainOrder creation and initialization is implemented consistently with proper settings transformation and error handling.

crates/cli/src/commands/order/listorderfrontmatterkeys.rs (1)

44-44: LGTM! Completes the consistent DotrainOrder refactor across CLI commands.

This final change maintains consistency with the broader refactor, successfully consolidating creation and initialization while preserving all existing functionality and error handling.

crates/cli/src/commands/order/calldata.rs (1)

39-39: LGTM! Clean refactoring to the new DotrainOrder initialization pattern.

The change correctly replaces the previous two-step initialization (new + initialize) with the consolidated create method. The settings parameter mapping from Option<String> to Option<Vec<String>> is handled appropriately, and error handling is preserved.

crates/quote/src/order_quotes.rs (1)

277-277: LGTM! Test helper function correctly updated for new DotrainOrder API.

The change appropriately uses the new create method with None for settings, which is suitable for test scenarios. The unwrap() usage is acceptable in test context.

crates/cli/src/commands/order/orderbook_address.rs (1)

37-37: LGTM! Consistent implementation of the DotrainOrder refactoring.

The change follows the same pattern as other CLI commands, correctly using the new create method with proper settings parameter mapping and error handling.

tauri-app/src-tauri/src/commands/order.rs (3)

144-144: LGTM! Correct usage of the new create method.

The settings parameter is already Option<Vec<String>> so it can be passed directly to create().


152-152: LGTM! Proper parameter wrapping for the create method.

Correctly wraps the Vec<String> in Some() since create() expects Option<Vec<String>>.


437-437: LGTM! Test code appropriately updated.

The test correctly uses the new create method with None for settings, and unwrap() is acceptable in test context.

crates/js_api/src/gui/mod.rs (1)

75-75: LGTM! Clean refactor to consolidate initialization.

The changes correctly replace the two-step pattern with the single DotrainOrder::create() call across all methods. This simplifies the API and removes the need for mutable intermediate states.

Also applies to: 88-88, 207-207, 220-220, 272-272

tauri-app/src-tauri/src/commands/authoring_meta.rs (1)

9-9: LGTM!

The refactor correctly replaces the two-step initialization with the single create call, maintaining the same error propagation pattern.

crates/common/src/dotrain_order/mod.rs (3)

215-221: Good update to the dummy() method.

The dummy() method now properly initializes dotrain_yaml with an empty vector, ensuring the instance is valid even without going through the full create() flow. This is important for test scenarios.


223-263: Excellent refactor of the initialization pattern.

The new create() method successfully consolidates all initialization logic that was previously split between new() and initialize(). This ensures that DotrainOrder instances are always fully initialized, eliminating potential bugs from forgetting to call initialize().

The implementation correctly:

  • Extracts frontmatter
  • Merges settings if provided
  • Fetches remote networks and tokens asynchronously
  • Updates caches appropriately

507-509: Test updates are consistent and correct.

All test cases have been properly updated to use the new create() pattern. The async/await usage is correct and error handling remains intact.

Also applies to: 550-552, 600-602, 647-651, 692-694, 736-738, 784-786, 837-839, 891-893, 967-969, 1151-1153, 1178-1180, 1236-1238

Comment thread packages/orderbook/test/common/test.test.ts
@findolor findolor marked this pull request as ready for review June 5, 2025 04:08
@findolor findolor requested review from 0xgleb and hardyjosh June 5, 2025 04:08
@hardyjosh hardyjosh enabled auto-merge June 6, 2025 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rust Related to rust crates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use static classs fn to get DotrainOrder instance

3 participants