Skip to content

Commit f33d10b

Browse files
committed
fixup: adopt to latest changes in protocol
1 parent a7339f5 commit f33d10b

39 files changed

Lines changed: 207 additions & 177 deletions

Cargo.lock

Lines changed: 11 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,7 @@ pub async fn show_account<AUTH>(
172172
},
173173
Asset::NonFungible(non_fungible_asset) => {
174174
// TODO: Display non-fungible assets more clearly.
175-
(
176-
"Non Fungible Asset",
177-
non_fungible_asset.faucet_id().to_hex(),
178-
1.0.to_string(),
179-
)
175+
("Non Fungible Asset", non_fungible_asset.faucet_id().to_hex(), 1.0.to_string())
180176
},
181177
};
182178
table.add_row(vec![asset_type, &faucet, &amount.clone()]);

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

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ async fn execute_transaction<AUTH: Keystore + Sync + 'static>(
400400
let output_notes = executed_transaction
401401
.output_notes()
402402
.iter()
403-
.map(|note| note.id())
403+
.map(miden_client::transaction::RawOutputNote::id)
404404
.collect::<Vec<_>>();
405405

406406
println!("Proving transaction...");
@@ -513,18 +513,10 @@ fn print_transaction_details(executed_tx: &ExecutedTransaction) -> Result<(), Cl
513513
for (asset, action) in account_delta.vault().non_fungible().iter() {
514514
match action {
515515
NonFungibleDeltaAction::Add => {
516-
table.add_row(vec![
517-
"Non Fungible Asset",
518-
&asset.faucet_id().to_hex(),
519-
"1",
520-
]);
516+
table.add_row(vec!["Non Fungible Asset", &asset.faucet_id().to_hex(), "1"]);
521517
},
522518
NonFungibleDeltaAction::Remove => {
523-
table.add_row(vec![
524-
"Non Fungible Asset",
525-
&asset.faucet_id().to_hex(),
526-
"-1",
527-
]);
519+
table.add_row(vec!["Non Fungible Asset", &asset.faucet_id().to_hex(), "-1"]);
528520
},
529521
}
530522
}

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -267,11 +267,9 @@ async fn show_note<AUTH: Keystore + Sync>(
267267
let (faucet, amount) = faucet_details_map.format_fungible_asset(fungible_asset)?;
268268
("Fungible Asset", faucet, amount)
269269
},
270-
Asset::NonFungible(non_fungible_asset) => (
271-
"Non Fungible Asset",
272-
non_fungible_asset.faucet_id().to_hex(),
273-
1.0.to_string(),
274-
),
270+
Asset::NonFungible(non_fungible_asset) => {
271+
("Non Fungible Asset", non_fungible_asset.faucet_id().to_hex(), 1.0.to_string())
272+
},
275273
};
276274
table.add_row(vec![asset_type, &faucet, &amount.clone()]);
277275
}

bin/miden-cli/tests/cli.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use miden_client::testing::common::{
3333
execute_tx_and_sync,
3434
insert_new_wallet,
3535
};
36-
use miden_client::transaction::{OutputNote, TransactionRequestBuilder};
36+
use miden_client::transaction::{RawOutputNote, TransactionRequestBuilder};
3737
use miden_client::utils::Serializable;
3838
use miden_client::{self, Client, DebugMode, Felt};
3939
use miden_client_cli::MIDEN_DIR;
@@ -714,7 +714,7 @@ async fn debug_mode_outputs_logs() -> Result<()> {
714714
// Send transaction and wait for it to be committed
715715
client.sync_state().await?;
716716
let transaction_request = TransactionRequestBuilder::new()
717-
.own_output_notes(vec![OutputNote::Full(note.clone())])
717+
.own_output_notes(vec![RawOutputNote::Full(note.clone())])
718718
.build()?;
719719
execute_tx_and_sync(&mut client, account.id(), transaction_request).await?;
720720

@@ -906,7 +906,7 @@ async fn new_wallet_with_deploy_flag() -> Result<()> {
906906
// Verify that the nonce is non-zero (account was deployed)
907907
// By convention, a nonce of 0 indicates an undeployed account
908908
assert!(
909-
nonce.as_int() > 0,
909+
nonce.as_canonical_u64() > 0,
910910
"Account nonce should be non-zero after deployment, but got: {nonce}"
911911
);
912912

@@ -1320,7 +1320,7 @@ fn create_account_with_acl_auth() {
13201320
// Create init storage data file for acl-auth with a test public key
13211321
let init_storage_data_toml = r#"
13221322
"miden::standards::auth::singlesig_acl::pub_key" = "0x0000000000000000000000000000000000000000000000000000000000000001"
1323-
"miden::standards::auth::singlesig_acl::scheme" = "Falcon512Rpo"
1323+
"miden::standards::auth::singlesig_acl::scheme" = "Falcon512Poseidon2"
13241324
"miden::standards::auth::singlesig_acl::config.num_tracked_procs" = "1"
13251325
"miden::standards::auth::singlesig_acl::config.allow_unauthorized_output_notes" = "0"
13261326
"miden::standards::auth::singlesig_acl::config.allow_unauthorized_input_notes" = "0"

crates/rust-client/src/account/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,7 @@ impl<AUTH> Client<AUTH> {
189189
return Err(ClientError::AccountAlreadyTracked(account.id()));
190190
}
191191

192-
if tracked_account.nonce().as_canonical_u64()
193-
> account.nonce().as_canonical_u64()
194-
{
192+
if tracked_account.nonce().as_canonical_u64() > account.nonce().as_canonical_u64() {
195193
// If the new account is older than the one being tracked, return an error
196194
return Err(ClientError::AccountNonceTooLow);
197195
}

crates/rust-client/src/errors.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ use miden_standards::account::interface::AccountInterfaceError;
1818
// ================================================================================================
1919
pub use miden_standards::errors::CodeBuilderError;
2020
pub use miden_tx::AuthenticationError;
21-
use miden_tx::utils::{DeserializationError, HexParseError};
21+
use miden_tx::utils::HexParseError;
22+
use miden_tx::utils::serde::DeserializationError;
2223
use miden_tx::{NoteCheckerError, TransactionExecutorError, TransactionProverError};
2324
use thiserror::Error;
2425

crates/rust-client/src/keystore/fs_keystore.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ use miden_protocol::account::AccountId;
1313
use miden_protocol::account::auth::{AuthSecretKey, PublicKey, PublicKeyCommitment, Signature};
1414
use miden_tx::AuthenticationError;
1515
use miden_tx::auth::{SigningInputs, TransactionAuthenticator};
16+
use miden_tx::utils::serde::{Deserializable, Serializable};
1617
use miden_tx::utils::sync::RwLock;
17-
use miden_tx::utils::{Deserializable, Serializable};
1818
use serde::{Deserialize, Serialize};
1919

2020
use super::{KeyStoreError, Keystore};

crates/rust-client/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,8 @@ pub mod vm {
285285
PackageExport,
286286
PackageKind,
287287
PackageManifest,
288-
Program,
289288
ProcedureExport,
289+
Program,
290290
QualifiedProcedureName,
291291
Section,
292292
SectionId,

crates/rust-client/src/note_transport/mod.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@ use miden_protocol::address::Address;
1212
use miden_protocol::note::{Note, NoteDetails, NoteFile, NoteHeader, NoteTag};
1313
use miden_protocol::utils::serde::Serializable;
1414
use miden_tx::auth::TransactionAuthenticator;
15-
use miden_tx::utils::serde::{ByteReader, ByteWriter, Deserializable, DeserializationError, SliceReader};
15+
use miden_tx::utils::serde::{
16+
ByteReader,
17+
ByteWriter,
18+
Deserializable,
19+
DeserializationError,
20+
SliceReader,
21+
};
1622

1723
pub use self::errors::NoteTransportError;
1824
use crate::{Client, ClientError};

0 commit comments

Comments
 (0)