Skip to content
Open
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Fixed

- **CI**: ensure that `cargo test --doc` works in each crate, fix
[#1555](https://github.com/o1-labs/mina-rust/issues/1555), see
[#1556](https://github.com/o1-labs/mina-rust/pull/1556)

## [0.18.0] - 2025-11-04

### OCaml node
Expand Down
59 changes: 30 additions & 29 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,10 @@ setup: setup-taplo setup-wasm ## Setup development environment
test: ## Run tests
cargo test

.PHONY: test-doc
test-doc: ## Run documentation tests only
@cargo test --doc

.PHONY: test-ledger
test-ledger: build-ledger ## Run ledger tests in release mode, requires nightly Rust
@cd ledger && cargo +$(NIGHTLY_RUST_VERSION) test --release -- -Z unstable-options --report-time
Expand Down Expand Up @@ -560,7 +564,7 @@ docs-serve-only: docs-install ## Serve the documentation website locally without
@cd website && npm start -- --port $(DOCS_PORT)

.PHONY: docs-rust
docs-rust: ## Generate Rust API documentation
docs-rust: test-doc ## Generate Rust API documentation
@echo "Generating Rust API documentation..."
# Using nightly with --enable-index-page to generate workspace index
# See: https://github.com/rust-lang/cargo/issues/8229
Expand Down
10 changes: 5 additions & 5 deletions cli/src/commands/node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,17 @@ pub struct Node {
/// Multiaddresses follow the format: `/protocol/address/protocol/port/protocol/peer_id`
///
/// **IPv4 Example:**
/// ```
/// ```text
/// /ip4/192.168.1.100/tcp/8302/p2p/12D3KooWABCDEF1234567890abcdef...
/// ```
///
/// **IPv6 Example:**
/// ```
/// ```text
/// /ip6/2001:db8::1/tcp/8302/p2p/12D3KooWABCDEF1234567890abcdef...
/// ```
///
/// **DNS Example:**
/// ```
/// ```text
/// /dns4/node.example.com/tcp/8302/p2p/12D3KooWABCDEF1234567890abcdef...
/// ```
///
Expand All @@ -143,7 +143,7 @@ pub struct Node {
/// Each line should contain a peer's multiaddr following the format described above.
///
/// **Example file content:**
/// ```
/// ```text
/// /ip4/192.168.1.100/tcp/8302/p2p/12D3KooWABCDEF1234567890abcdef...
/// /ip4/10.0.0.50/tcp/8302/p2p/12D3KooWXYZ9876543210fedcba...
/// /dns4/bootstrap.example.com/tcp/8302/p2p/12D3KooW123ABC...
Expand All @@ -160,7 +160,7 @@ pub struct Node {
/// Useful for dynamic peer discovery from a central bootstrap service.
///
/// **Example URL response:**
/// ```
/// ```text
/// /ip4/bootstrap1.example.com/tcp/8302/p2p/12D3KooW...
/// /ip4/bootstrap2.example.com/tcp/8302/p2p/12D3KooX...
/// ```
Expand Down
1 change: 1 addition & 0 deletions macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ syn = { workspace = true }

[dev-dependencies]
mina-core = { workspace = true }
redux = { workspace = true }
tracing = { workspace = true }
rust-format = { workspace = true, features = ["token_stream"] }
anyhow = { workspace = true }
19 changes: 18 additions & 1 deletion macros/src/action_event.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@ For action containers, it simply delegates to inner actions.

```rust
# use mina_core::ActionEvent;
# extern crate redux;
# struct DummyContext {
# time: String,
# node_id: String,
# }
# impl mina_core::log::EventContext for DummyContext {
# fn timestamp(&self) -> redux::Timestamp { mina_core::log::system_time() }
# fn time(&self) -> &dyn tracing::Value { &self.time }
# fn node_id(&self) -> &dyn tracing::Value { &self.node_id }
# fn log_node_id(&self) -> bool { false }
# }
# let context = DummyContext {
# time: "0".to_string(),
# node_id: "test".to_string(),
# };
#
#[derive(ActionEvent)]
enum ActionContainer {
Expand All @@ -17,7 +32,7 @@ enum Action1 {
Done,
}

ActionContainer::SubAction1(Action1::Init).action_event(context);
ActionContainer::SubAction1(Action1::Init).action_event(&context);
```

```rust
Expand Down Expand Up @@ -156,6 +171,8 @@ a field's enum variant), logging can be delegated to a function implementing
that logic.

```rust
# fn foo<T: mina_core::log::EventContext>(_context: &T) {}
# fn bar<T: mina_core::log::EventContext>(_context: &T, _f1: &bool) {}
#[derive(mina_core::ActionEvent)]
pub enum Action {
#[action_event(expr(foo(context)))]
Expand Down
Loading
Loading