Skip to content

Commit

Permalink
Modified Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Garcia committed Jul 22, 2024
1 parent b90913d commit 6c59bb5
Show file tree
Hide file tree
Showing 24 changed files with 63 additions and 439 deletions.
19 changes: 12 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ help: ## Show description of all commands

# --- Variables -----------------------------------------------------------------------------------

FEATURES_WEB_CLIENT="testing, concurrent"
FEATURES_CLIENT="testing, concurrent"
FEATURES_CLI="testing, concurrent"
NODE_FEATURES_TESTING="testing"
Expand All @@ -16,7 +17,11 @@ NODE_BRANCH="main"

.PHONY: clippy
clippy: ## Runs Clippy with configs
cargo +nightly clippy --workspace --all-targets --features $(FEATURES_CLI) -- -D warnings
cargo +nightly clippy --workspace --exclude miden-client-web --all-targets --features $(FEATURES_CLI) -- -D warnings

.PHONY: clippy-wasm
clippy-wasm: ## Runs Clippy with configs
cargo +nightly clippy --workspace --exclude miden-client --exclude miden-cli --exclude miden-client-tests --all-targets --features $(FEATURES_CLI) -- -D warnings

.PHONY: fix
fix: ## Runs Fix with configs
Expand Down Expand Up @@ -59,18 +64,18 @@ doc: ## Generates & checks rust documentation. You'll need `jq` in order for thi

.PHONY: test
test: ## Run tests
cargo nextest run --release --lib --features $(FEATURES_CLIENT)
cargo nextest run --workspace --exclude miden-client-web --release --lib --features $(FEATURES_CLIENT)

# --- Integration testing -------------------------------------------------------------------------

.PHONY: integration-test
integration-test: ## Run integration tests
cargo nextest run --release --test=integration --features $(FEATURES_CLI) --no-default-features
cargo nextest run --workspace --exclude miden-client-web --release --test=integration --features $(FEATURES_CLI) --no-default-features

.PHONY: integration-test-full
integration-test-full: ## Run the integration test binary with ignored tests included
cargo nextest run --release --test=integration --features $(FEATURES_CLI)
cargo nextest run --release --test=integration --features $(FEATURES_CLI) --run-ignored ignored-only -- test_import_genesis_accounts_can_be_used_for_transactions
cargo nextest run --workspace --exclude miden-client-web --release --test=integration --features $(FEATURES_CLI)
cargo nextest run --workspace --exclude miden-client-web --release --test=integration --features $(FEATURES_CLI) --run-ignored ignored-only -- test_import_genesis_accounts_can_be_used_for_transactions

.PHONY: kill-node
kill-node: ## Kill node process
Expand Down Expand Up @@ -99,7 +104,7 @@ install: ## Installs the CLI binary
# --- Building ------------------------------------------------------------------------------------

build: ## Builds the CLI binary and client library in release mode
cargo build --release --features $(FEATURES_CLI)
cargo build --workspace --exclude miden-client-web --release --features $(FEATURES_CLI)

build-wasm: ## Builds the client library for wasm32
cargo build --target wasm32-unknown-unknown --features idxdb,web-tonic --no-default-features --package miden-client
cargo build --workspace --exclude miden-client --exclude miden-cli --features $(FEATURES_WEB_CLIENT)
5 changes: 1 addition & 4 deletions bin/miden-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ use miden_client::{
auth::{StoreAuthenticator, TransactionAuthenticator},
crypto::{FeltRng, RpoRandomCoin},
rpc::{NodeRpcClient, TonicRpcClient},
store::{
sqlite_store::SqliteStore, InputNoteRecord, NoteFilter as ClientNoteFilter,
OutputNoteRecord, Store,
},
store::{sqlite_store::SqliteStore, NoteFilter as ClientNoteFilter, OutputNoteRecord, Store},
Client, ClientError, Felt, IdPrefixFetchError,
};
use rand::Rng;
Expand Down
9 changes: 2 additions & 7 deletions bin/miden-cli/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@ use figment::{
Figment,
};
use miden_client::{
accounts::AccountId,
auth::TransactionAuthenticator,
crypto::FeltRng,
notes::{NoteError, NoteExecutionHint, NoteTag, NoteType},
rpc::NodeRpcClient,
store::Store,
Client,
accounts::AccountId, auth::TransactionAuthenticator, crypto::FeltRng, rpc::NodeRpcClient,
store::Store, Client,
};
use tracing::info;

Expand Down
5 changes: 1 addition & 4 deletions crates/rust-client/src/notes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ use winter_maybe_async::{maybe_async, maybe_await};

use crate::{
rpc::{NodeRpcClient, NoteDetails},
store::{
InputNoteRecord, NoteFilter, NoteRecordDetails, NoteStatus, OutputNoteRecord, Store,
StoreError,
},
store::{InputNoteRecord, NoteFilter, NoteStatus, OutputNoteRecord, Store, StoreError},
Client, ClientError, IdPrefixFetchError,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ use core::fmt::{self, Debug, Display, Formatter};

use miden_objects::accounts::AccountId;

use crate::rpc::{
tonic_client::generated::account::AccountId as ProtoAccountId, RpcConversionError,
};
#[cfg(feature = "tonic")]
use crate::rpc::tonic_client::generated::account::AccountId as ProtoAccountId;
#[cfg(feature = "web-tonic")]
use crate::rpc::web_tonic_client::generated::account::AccountId as ProtoAccountId;
use crate::rpc::RpcConversionError;

// ACCOUNT ID
// ================================================================================================
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
use miden_objects::BlockHeader;

use super::MissingFieldHelper;
use crate::rpc::{web_tonic_client::generated::block_header, RpcConversionError};
#[cfg(feature = "tonic")]
use crate::rpc::tonic_client::generated::block_header;
#[cfg(feature = "web-tonic")]
use crate::rpc::web_tonic_client::generated::block_header;
use crate::rpc::RpcConversionError;

// BLOCK HEADER
// ================================================================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ use core::fmt::{self, Debug, Display, Formatter};
use hex::ToHex;
use miden_objects::{notes::NoteId, Digest, Felt, StarkField};

use crate::rpc::{tonic_client::generated::digest, RpcConversionError};
#[cfg(feature = "tonic")]
use crate::rpc::tonic_client::generated::digest;
#[cfg(feature = "web-tonic")]
use crate::rpc::web_tonic_client::generated::digest;
use crate::rpc::RpcConversionError;

// CONSTANTS
// ================================================================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ use miden_objects::{
Digest,
};

use crate::rpc::{web_tonic_client::generated, RpcConversionError};
#[cfg(feature = "tonic")]
use crate::rpc::tonic_client::generated;
#[cfg(feature = "web-tonic")]
use crate::rpc::web_tonic_client::generated;
use crate::rpc::RpcConversionError;

// MERKLE PATH
// ================================================================================================
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ use miden_objects::{
};

use super::MissingFieldHelper;
use crate::rpc::{
web_tonic_client::generated::note::NoteMetadata as ProtoNoteMetadata, RpcConversionError,
};
#[cfg(feature = "tonic")]
use crate::rpc::tonic_client::generated::note::NoteMetadata as ProtoNoteMetadata;
#[cfg(feature = "web-tonic")]
use crate::rpc::web_tonic_client::generated::note::NoteMetadata as ProtoNoteMetadata;
use crate::rpc::RpcConversionError;

impl TryFrom<ProtoNoteMetadata> for NoteMetadata {
type Error = RpcConversionError;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
use miden_objects::{crypto::hash::rpo::RpoDigest, notes::Nullifier};

use crate::rpc::{web_tonic_client::generated::digest::Digest, RpcConversionError};
#[cfg(feature = "tonic")]
use crate::rpc::tonic_client::generated::digest::Digest;
#[cfg(feature = "web-tonic")]
use crate::rpc::web_tonic_client::generated::digest::Digest;
use crate::rpc::RpcConversionError;

// INTO NULLIFIER
// ================================================================================================
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
use miden_objects::{crypto::hash::rpo::RpoDigest, transaction::TransactionId};

use crate::rpc::{
web_tonic_client::generated::{
digest::Digest, transaction::TransactionId as ProtoTransactionId,
},
RpcConversionError,
#[cfg(feature = "tonic")]
use crate::rpc::tonic_client::generated::{
digest::Digest, transaction::TransactionId as ProtoTransactionId,
};
#[cfg(feature = "web-tonic")]
use crate::rpc::web_tonic_client::generated::{
digest::Digest, transaction::TransactionId as ProtoTransactionId,
};
use crate::rpc::RpcConversionError;

// INTO TRANSACTION ID
// ================================================================================================
Expand Down
6 changes: 6 additions & 0 deletions crates/rust-client/src/rpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ use miden_objects::{
BlockHeader, Digest,
};

#[cfg(all(feature = "tonic", feature = "web-tonic"))]
compile_error!("features `tonic` and `web-tonic` are mutually exclusive");

#[cfg(any(feature = "tonic", feature = "web-tonic"))]
mod domain;

#[cfg(feature = "tonic")]
mod tonic_client;
#[cfg(test)]
Expand Down
78 changes: 0 additions & 78 deletions crates/rust-client/src/rpc/tonic_client/domain/blocks.rs

This file was deleted.

43 changes: 0 additions & 43 deletions crates/rust-client/src/rpc/tonic_client/domain/merkle.rs

This file was deleted.

25 changes: 0 additions & 25 deletions crates/rust-client/src/rpc/tonic_client/domain/notes.rs

This file was deleted.

15 changes: 0 additions & 15 deletions crates/rust-client/src/rpc/tonic_client/domain/nullifiers.rs

This file was deleted.

Loading

0 comments on commit 6c59bb5

Please sign in to comment.