Skip to content

Commit

Permalink
chore: Move to latest next (#677)
Browse files Browse the repository at this point in the history
* refactor: Use BlockNumber instead of u32 and update miden-base

* chore: Update base revision
  • Loading branch information
igamigo authored Jan 21, 2025
1 parent 5f455b8 commit 0ce5fe7
Show file tree
Hide file tree
Showing 89 changed files with 853 additions and 508 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* Limited the number of decimals that an asset can have (#666).
* [BREAKING] Removed the `testing` feature from the CLI (#670).
* Added per transaction prover support to the web client (#674).
* [BREAKING] Added `BlockNumber` structure (#677).

### Fixes

Expand Down
64 changes: 31 additions & 33 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ async-trait = "0.1"
miden-lib = { git = "https://github.com/0xPolygonMiden/miden-base", branch = "next", default-features = false }
miden-objects = { git = "https://github.com/0xPolygonMiden/miden-base", branch = "next", default-features = false }
miden-tx = { git = "https://github.com/0xPolygonMiden/miden-base", branch = "next", default-features = false, features = ["async"] }
miden-remote-provers = { git = "https://github.com/0xPolygonMiden/miden-base", branch = "next", features = ["tx-prover"] }
miden-proving-service-client = { git = "https://github.com/0xPolygonMiden/miden-base", branch = "next", features = ["tx-prover"] }
rand = { version = "0.8" }
serde = { version = "1.0", features = ["derive"] }
thiserror = { version = "2.0", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion bin/miden-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ comfy-table = { version = "7.1" }
figment = { version = "0.10", features = ["toml", "env"] }
miden-client = { version = "0.6", path = "../../crates/rust-client", features = ["sqlite", "tonic"] }
miden-lib = { workspace = true }
miden-remote-provers = { workspace = true }
miden-proving-service-client = { workspace = true , features = ["std", "tx-prover"]}
rand = { workspace = true }
serde = { version = "1.0", features = ["derive"] }
tokio = { workspace = true }
Expand Down
8 changes: 5 additions & 3 deletions bin/miden-cli/src/commands/new_transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ use miden_client::{
accounts::AccountId,
assets::{FungibleAsset, NonFungibleDeltaAction},
crypto::{Digest, FeltRng},
notes::{build_swap_tag, get_input_note_with_id_prefix, NoteType as MidenNoteType},
notes::{
build_swap_tag, get_input_note_with_id_prefix, BlockNumber, NoteType as MidenNoteType,
},
transactions::{
PaymentTransactionData, SwapTransactionData, TransactionRequest, TransactionRequestBuilder,
TransactionResult,
},
Client,
};
use miden_remote_provers::RemoteTransactionProver;
use miden_proving_service_client::RemoteTransactionProver;
use tracing::info;

use crate::{
Expand Down Expand Up @@ -142,7 +144,7 @@ impl SendCmd {

let transaction_request = TransactionRequestBuilder::pay_to_id(
payment_transaction,
self.recall_height,
self.recall_height.map(BlockNumber::from),
(&self.note_type).into(),
client.rng(),
)
Expand Down
2 changes: 1 addition & 1 deletion bin/miden-cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use miden_cli::Cli;

extern crate alloc;
extern crate std;

#[tokio::main]
async fn main() -> Result<(), String> {
Expand Down
2 changes: 1 addition & 1 deletion bin/miden-cli/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ async fn debug_mode_outputs_logs() {
// Export the note
let note_file: NoteFile = NoteFile::NoteDetails {
details: note.clone().into(),
after_block_num: 0,
after_block_num: 0.into(),
tag: Some(note.metadata().tag()),
};

Expand Down
14 changes: 7 additions & 7 deletions crates/rust-client/src/accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,19 +184,19 @@ impl<R: FeltRng> Client<R> {
pub struct AccountUpdates {
/// Updated public accounts.
updated_public_accounts: Vec<Account>,
/// Node account hashes that don't match the tracked information.
mismatched_offchain_accounts: Vec<(AccountId, Digest)>,
/// Node account hashes that don't match the current tracked state for private accounts.
mismatched_private_accounts: Vec<(AccountId, Digest)>,
}

impl AccountUpdates {
/// Creates a new instance of `AccountUpdates`.
pub fn new(
updated_public_accounts: Vec<Account>,
mismatched_offchain_accounts: Vec<(AccountId, Digest)>,
mismatched_private_accounts: Vec<(AccountId, Digest)>,
) -> Self {
Self {
updated_public_accounts,
mismatched_offchain_accounts,
mismatched_private_accounts,
}
}

Expand All @@ -205,9 +205,9 @@ impl AccountUpdates {
&self.updated_public_accounts
}

/// Returns the mismatched offchain accounts.
pub fn mismatched_offchain_accounts(&self) -> &[(AccountId, Digest)] {
&self.mismatched_offchain_accounts
/// Returns the mismatched private accounts.
pub fn mismatched_private_accounts(&self) -> &[(AccountId, Digest)] {
&self.mismatched_private_accounts
}
}

Expand Down
4 changes: 2 additions & 2 deletions crates/rust-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ pub mod auth {
}

/// Provides types for working with blocks within the Miden rollup network.
pub mod blocks {
pub use miden_objects::BlockHeader;
pub mod block {
pub use miden_objects::block::BlockHeader;
}

/// Provides cryptographic types and utilities used within the Miden rollup
Expand Down
Loading

0 comments on commit 0ce5fe7

Please sign in to comment.