Skip to content

Commit 590ec4e

Browse files
authored
Merge branch 'next' into igamigo-rpc-tls
2 parents 31df69c + 55e6508 commit 590ec4e

35 files changed

+597
-131
lines changed

.github/workflows/test.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,19 @@ jobs:
1717
- name: make - test
1818
run: make test
1919

20+
doc-tests:
21+
name: doc-tests
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@main
25+
- uses: Swatinem/rust-cache@v2
26+
with:
27+
save-if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/next' }}
28+
- name: Install rust
29+
run: rustup update --no-self-update
30+
- name: Run doc-tests
31+
run: make test-docs
32+
2033
integration-tests:
2134
name: Run integration tests on ubuntu-latest
2235
runs-on: ubuntu-latest

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
* Added fixed seed option for web client generation (#688)
2222
* [BREAKING] Updated `init` command in the CLI to receive a `--network` flag (#690).
2323
* Improved CLI error messages (#682).
24+
* [BREAKING] Renamed APIs for retrieving account information to use the `try_get_*` naming convention, and added/improved module documentation (#683).
2425
* Enabled TLS on tonic client (#697).
2526

2627
### Fixes

Makefile

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ help: ## Show description of all commands
66

77
# --- Variables -----------------------------------------------------------------------------------
88

9+
# Enable file generation in the `src` directory.
10+
# This is used in the build script of the client to generate the node RPC-related code, from the
11+
# protobuf files.
12+
CODEGEN=CODEGEN=1
13+
914
FEATURES_WEB_CLIENT=--features "testing"
1015
FEATURES_CLIENT=--features "testing, concurrent" --no-default-features
1116
FEATURES_CLI=--features "concurrent"
@@ -76,29 +81,33 @@ doc: ## Generate & check rust documentation. You'll need `jq` in order for this
7681

7782
.PHONY: test
7883
test: ## Run tests
79-
CODEGEN=1 cargo nextest run --workspace --exclude miden-client-web --release --lib $(FEATURES_CLIENT)
84+
$(CODEGEN) cargo nextest run --workspace --exclude miden-client-web --release --lib $(FEATURES_CLIENT)
8085

8186
.PHONY: test-deps
8287
test-deps: ## Install dependencies for tests
83-
CODEGEN=1 cargo install cargo-nextest
88+
$(CODEGEN) cargo install cargo-nextest
89+
90+
.PHONY: test-docs
91+
test-docs: ## Run documentation tests
92+
$(CODEGEN) cargo test --doc $(FEATURES_CLIENT)
8493

8594
# --- Integration testing -------------------------------------------------------------------------
8695

8796
.PHONY: integration-test
8897
integration-test: ## Run integration tests
89-
CODEGEN=1 cargo nextest run --workspace --exclude miden-client-web --release --test=integration $(FEATURES_CLI)
98+
$(CODEGEN) cargo nextest run --workspace --exclude miden-client-web --release --test=integration $(FEATURES_CLI)
9099

91100
.PHONY: integration-test-web-client
92101
integration-test-web-client: ## Run integration tests for the web client
93-
CODEGEN=1 cd ./crates/web-client && npm run test:clean
102+
$(CODEGEN) cd ./crates/web-client && npm run test:clean
94103

95104
.PHONY: integration-test-remote-prover-web-client
96105
integration-test-remote-prover-web-client: ## Run integration tests for the web client with remote prover
97-
CODEGEN=1 cd ./crates/web-client && npm run test:remote_prover
106+
$(CODEGEN) cd ./crates/web-client && npm run test:remote_prover
98107

99108
.PHONY: integration-test-full
100109
integration-test-full: ## Run the integration test binary with ignored tests included
101-
CODEGEN=1 cargo nextest run --workspace --exclude miden-client-web --release --test=integration $(FEATURES_CLI)
110+
$(CODEGEN) cargo nextest run --workspace --exclude miden-client-web --release --test=integration $(FEATURES_CLI)
102111
cargo nextest run --workspace --exclude miden-client-web --release --test=integration $(FEATURES_CLI) --run-ignored ignored-only -- test_import_genesis_accounts_can_be_used_for_transactions
103112

104113
.PHONY: kill-node

bin/miden-cli/src/commands/account.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use clap::Parser;
22
use miden_client::{
33
account::{Account, AccountId, AccountType, StorageSlot},
4-
assets::Asset,
4+
asset::Asset,
55
crypto::FeltRng,
66
Client, ZERO,
77
};
@@ -67,8 +67,7 @@ impl AccountCmd {
6767
})?;
6868

6969
// Check whether we're tracking that account
70-
let (account, _) =
71-
client.get_account_header_or_error(account_id).await?;
70+
let (account, _) = client.try_get_account_header(account_id).await?;
7271

7372
Some(account.id())
7473
};

bin/miden-cli/src/commands/init.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ the CLI and client configurations, and will be placed by default in the current
5252
directory."
5353
)]
5454
pub struct InitCmd {
55-
/// Network configuration to use. Options are devnet, testnet, localhost or a custom RPC
55+
/// Network configuration to use. Options are `devnet`, `testnet`, `localhost` or a custom RPC
5656
/// endpoint. Defaults to the testnet network.
5757
#[clap(long, short, default_value = "testnet")]
5858
network: Option<Network>,
5959

60-
/// Store file path.
60+
/// Path to the store file.
6161
#[clap(long)]
6262
store_path: Option<String>,
6363

bin/miden-cli/src/commands/new_account.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use miden_client::{
44
AccountBuilder, AccountStorageMode, AccountType, BasicFungibleFaucetComponent,
55
BasicWalletComponent, RpoFalcon512Component,
66
},
7-
assets::TokenSymbol,
7+
asset::TokenSymbol,
88
auth::AuthSecretKey,
99
crypto::{FeltRng, SecretKey},
1010
Client, Felt,

bin/miden-cli/src/commands/new_transactions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::{io, sync::Arc};
33
use clap::{Parser, ValueEnum};
44
use miden_client::{
55
account::AccountId,
6-
assets::{FungibleAsset, NonFungibleDeltaAction},
6+
asset::{FungibleAsset, NonFungibleDeltaAction},
77
crypto::{Digest, FeltRng},
88
note::{build_swap_tag, get_input_note_with_id_prefix, BlockNumber, NoteType as MidenNoteType},
99
store::NoteRecordError,

bin/miden-cli/src/commands/notes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use clap::ValueEnum;
22
use comfy_table::{presets, Attribute, Cell, ContentArrangement, Table};
33
use miden_client::{
44
account::AccountId,
5-
assets::Asset,
5+
asset::Asset,
66
crypto::{Digest, FeltRng},
77
note::{
88
get_input_note_with_id_prefix,

bin/miden-cli/src/faucet_details_map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::{
33
path::PathBuf,
44
};
55

6-
use miden_client::{account::AccountId, assets::FungibleAsset};
6+
use miden_client::{account::AccountId, asset::FungibleAsset};
77
use miden_lib::account::faucets::BasicFungibleFaucet;
88
use serde::{Deserialize, Serialize};
99

crates/rust-client/README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@ miden-client = { version = "0.6" }
1212

1313
## Crate Features
1414

15-
- `concurrent`: used to enable concurrency during execution and proof generation. Disabled by default.
16-
- `idxdb`: includes `WebStore`, an IdexedDB implementation of the `Store` trait. Disabled by default.
17-
- `sqlite`: includes `SqliteStore`, a SQLite implementation of the `Store` trait. Disabled by default.
18-
- `tonic`: includes `TonicRpcClient`, a Tonic client to communicate with Miden node. Disabled by default.
19-
- `web-tonic`: includes `WebTonicRpcClient`, an Tonic client to communicate with the Miden node in the browser. Disabled by default.
20-
- `testing`: useful feature that lowers PoW difficulty when enabled, meant to be used during development and not on production. Disabled by default.
21-
22-
To compile with `no_std`, disable default features via `--no-default-features` flag.
15+
| Features | Description |
16+
| ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
17+
| `concurrent` | Used to enable concurrency during execution and proof generation. **Disabled by default.** |
18+
| `idxdb` | Includes `WebStore`, an IndexedDB implementation of the `Store` trait. **Disabled by default.** |
19+
| `sqlite` | Includes `SqliteStore`, a SQLite implementation of the `Store` trait. This relies on the standard library. **Disabled by default.** |
20+
| `tonic` | Includes `TonicRpcClient`, a Tonic client to communicate with Miden node. This relies on the standard library. **Disabled by default.** |
21+
| `web-tonic` | Includes `WebTonicRpcClient`, a Tonic client to communicate with the Miden node in the browser. **Disabled by default.** |
22+
| `testing` | Enables functions meant to be used in testing environments. **Disabled by default.** |
23+
24+
Features `sqlite` and `idxdb` are mutually exclusive.
2325

2426
### Store and RpcClient implementations
2527

0 commit comments

Comments
 (0)