Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Repository Guidelines

## Project Structure & Module Organization
Mostro Core is a Rust library with `src/lib.rs` orchestrating modules that mirror domain entities. Core data models and logic live in files such as `src/order.rs`, `src/message.rs`, `src/user.rs`, while cryptographic helpers sit in `src/crypto.rs` and dispute flows in `src/dispute.rs`. Shared exports intended for consumers are re-exported through `src/prelude.rs`. Inline unit tests reside beside their modules under `#[cfg(test)]`. Enable optional capabilities through Cargo features: `wasm` ships by default and `sqlx` adds persistence helpers.
Mostro Core is a Rust library with `src/lib.rs` orchestrating modules that mirror domain entities. Core data models and logic live in files such as `src/order.rs`, `src/message.rs`, `src/user.rs`, while dispute flows live in `src/dispute.rs`. Shared exports intended for consumers are re-exported through `src/prelude.rs`. Inline unit tests reside beside their modules under `#[cfg(test)]`. Enable optional capabilities through Cargo features: `wasm` ships by default and `sqlx` adds persistence helpers.

## Build, Test, and Development Commands
- `cargo check` — fast type checking before committing.
Expand All @@ -14,7 +14,7 @@ Mostro Core is a Rust library with `src/lib.rs` orchestrating modules that mirro
Code targets Rust 1.86.0 (2021 edition). Favor clear module boundaries and avoid leaking internals outside the prelude unless necessary. Use `snake_case` for functions and modules, `PascalCase` for types and enums, and `SCREAMING_SNAKE_CASE` for constants. Document public APIs with `///` comments and keep error enums exhaustive. Always run `cargo fmt` before pushing and address clippy warnings immediately.

## Testing Guidelines
Place new unit tests in the same module inside `#[cfg(test)] mod tests` blocks with descriptive names like `test_signature_roundtrip`. Cover failure paths around invalid currencies, dispute resolution, and crypto edge cases. Reuse existing builders or helpers instead of duplicating fixtures. Run `cargo test --all-features` before opening a PR to ensure feature parity.
Place new unit tests in the same module inside `#[cfg(test)] mod tests` blocks with descriptive names like `test_signature_roundtrip`. Cover failure paths around invalid currencies, dispute resolution, and other edge cases. Reuse existing builders or helpers instead of duplicating fixtures. Run `cargo test --all-features` before opening a PR to ensure feature parity.

## Commit & Pull Request Guidelines
Follow Conventional Commits (e.g., `feat:`, `fix:`, `chore:`) and sign commits when possible. Keep commits focused and squash noisy iterations prior to review. Pull requests should summarise scope, list affected modules or features, and explain validation steps (tests, docs, screenshots for API changes). Link related issues and request review in Telegram if the change is time-sensitive.
10 changes: 1 addition & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mostro-core"
version = "0.7.0"
version = "0.7.1"
Copy link
Contributor

@coderabbitai coderabbitai bot Mar 12, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Consider a minor version bump for this breaking change.

The PR description declares this as a BREAKING change (removing crypto APIs), but the version is bumped from 0.7.0 to 0.7.1 (patch). Per semver, even in 0.x.y versions, breaking changes are typically signaled by bumping the minor version (0.7.0 → 0.8.0) to alert consumers of incompatible API changes.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Cargo.toml` at line 3, The crate version in Cargo.toml incorrectly uses a
patch bump ("version" = "0.7.1") for a breaking change; update the version field
to a minor bump "0.8.0" to reflect the removal of crypto APIs and communicate
the breaking change to consumers (edit the version = "..." line in Cargo.toml).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I will evaluate this with @grunch

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

edition = "2021"
license = "MIT"
authors = ["Francisco Calderón <negrunch@grunch.dev>"]
Expand Down Expand Up @@ -57,14 +57,6 @@ sqlx-crud = { version = "0.4.0", features = [
wasm-bindgen = { version = "0.2.92", optional = true }
nostr-sdk = "0.43.0"
bitcoin = "0.32.7"
bitcoin_hashes = "0.16.0"
rand = "0.9.2"
argon2 = "0.5"
chacha20poly1305 = "0.10"
base64 = "0.22.1"
secrecy = "0.10.3"
zeroize = "1.8.1"
blake3 = "1.8.2"

[features]
default = ["wasm"]
Expand Down
283 changes: 0 additions & 283 deletions src/crypto.rs

This file was deleted.

1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
pub mod crypto;
pub mod dispute;
pub mod error;
pub mod message;
Expand Down
5 changes: 2 additions & 3 deletions src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ pub struct RestoredOrderHelper {
}

/// Information about the dispute to be restored in the new client.
/// Helper struct to decrypt the dispute information in case of encrypted database.
/// Note: field names are chosen to match expected SQL SELECT aliases in mostrod (e.g. `status` aliased as `dispute_status`).
#[cfg_attr(feature = "sqlx", derive(FromRow, SqlxCrud))]
#[derive(Debug, Deserialize, Serialize, Clone)]
Expand All @@ -277,10 +276,10 @@ pub struct RestoredDisputeHelper {
pub trade_index_buyer: Option<i64>,
pub trade_index_seller: Option<i64>,
/// Indicates whether the buyer has initiated a dispute for this order.
/// Used in conjunction with `seller_dispute` to derive the `initiator` field in `RestoredDisputesInfo` after decryption.
/// Used in conjunction with `seller_dispute` to derive the `initiator` field in `RestoredDisputesInfo`.
pub buyer_dispute: bool,
/// Indicates whether the seller has initiated a dispute for this order.
/// Used in conjunction with `buyer_dispute` to derive the `initiator` field in `RestoredDisputesInfo` after decryption.
/// Used in conjunction with `buyer_dispute` to derive the `initiator` field in `RestoredDisputesInfo`.
pub seller_dispute: bool,
}

Expand Down
Loading
Loading