Skip to content
Merged
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
72 changes: 51 additions & 21 deletions Cargo.lock

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

8 changes: 5 additions & 3 deletions bin/network-monitor/src/deploy/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ use std::path::Path;

use anyhow::Result;
use miden_node_utils::crypto::get_rpo_random_coin;
use miden_protocol::account::auth::AuthSecretKey;
use miden_protocol::account::auth::{AuthScheme, AuthSecretKey};
use miden_protocol::account::{Account, AccountFile, AccountStorageMode, AccountType};
use miden_protocol::crypto::dsa::falcon512_rpo::SecretKey;
use miden_standards::AuthScheme;
use miden_standards::AuthMethod;
use miden_standards::account::wallets::create_basic_wallet;
use rand::{Rng, SeedableRng};
use rand_chacha::ChaCha20Rng;
Expand All @@ -22,7 +22,9 @@ use crate::COMPONENT;
pub fn create_wallet_account() -> Result<(Account, SecretKey)> {
let mut rng = ChaCha20Rng::from_seed(rand::random());
let secret_key = SecretKey::with_rng(&mut get_rpo_random_coin(&mut rng));
let auth = AuthScheme::Falcon512Rpo { pub_key: secret_key.public_key().into() };
let auth = AuthMethod::SingleSig {
approver: (secret_key.public_key().into(), AuthScheme::Falcon512Rpo),
};
let init_seed: [u8; 32] = rng.random();

let wallet_account = create_basic_wallet(
Expand Down
3 changes: 2 additions & 1 deletion bin/network-monitor/src/remote_prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use std::time::Duration;
use anyhow::Context;
use miden_node_proto::clients::{Builder as ClientBuilder, RemoteProverClient};
use miden_node_proto::generated as proto;
use miden_protocol::account::auth::AuthScheme;
use miden_protocol::asset::{Asset, FungibleAsset};
use miden_protocol::note::NoteType;
use miden_protocol::testing::account_id::{ACCOUNT_ID_PUBLIC_FUNGIBLE_FAUCET, ACCOUNT_ID_SENDER};
Expand Down Expand Up @@ -277,7 +278,7 @@ pub async fn generate_mock_transaction() -> anyhow::Result<TransactionInputs> {

// Create an account with basic authentication
let account = mock_chain_builder
.add_existing_wallet(Auth::BasicAuth)
.add_existing_wallet(Auth::BasicAuth { auth_scheme: AuthScheme::Falcon512Rpo })
.context("Failed to add wallet to mock chain")?;

// Create a fungible asset
Expand Down
9 changes: 7 additions & 2 deletions bin/remote-prover/src/server/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use std::time::Duration;

use assert_matches::assert_matches;
use miden_protocol::MIN_PROOF_SECURITY_LEVEL;
use miden_protocol::account::auth::AuthScheme;
use miden_protocol::asset::{Asset, FungibleAsset};
use miden_protocol::batch::{ProposedBatch, ProvenBatch};
use miden_protocol::note::NoteType;
Expand Down Expand Up @@ -61,7 +62,9 @@ impl ProofRequest {
async fn mock_tx() -> ExecutedTransaction {
// Create a mock transaction to send to the server
let mut mock_chain_builder = MockChainBuilder::new();
let account = mock_chain_builder.add_existing_wallet(Auth::BasicAuth).unwrap();
let account = mock_chain_builder
.add_existing_wallet(Auth::BasicAuth { auth_scheme: AuthScheme::Falcon512Rpo })
.unwrap();

let fungible_asset_1: Asset =
FungibleAsset::new(ACCOUNT_ID_PUBLIC_FUNGIBLE_FAUCET.try_into().unwrap(), 100)
Expand Down Expand Up @@ -91,7 +94,9 @@ impl ProofRequest {
async fn mock_batch() -> ProposedBatch {
// Create a mock transaction to send to the server
let mut mock_chain_builder = MockChainBuilder::new();
let account = mock_chain_builder.add_existing_wallet(Auth::BasicAuth).unwrap();
let account = mock_chain_builder
.add_existing_wallet(Auth::BasicAuth { auth_scheme: AuthScheme::Falcon512Rpo })
.unwrap();

let fungible_asset_1: Asset =
FungibleAsset::new(ACCOUNT_ID_PUBLIC_FUNGIBLE_FAUCET.try_into().unwrap(), 100)
Expand Down
10 changes: 7 additions & 3 deletions bin/stress-test/src/seeding/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use miden_node_proto::domain::batch::BatchInputs;
use miden_node_proto::generated::store::rpc_client::RpcClient;
use miden_node_store::{DataDirectory, GenesisState, Store};
use miden_node_utils::tracing::grpc::OtelInterceptor;
use miden_protocol::account::auth::AuthScheme;
use miden_protocol::account::delta::AccountUpdateDetails;
use miden_protocol::account::{
Account,
Expand Down Expand Up @@ -46,7 +47,7 @@ use miden_protocol::transaction::{
};
use miden_protocol::utils::Serializable;
use miden_protocol::{Felt, ONE, Word};
use miden_standards::account::auth::AuthFalcon512Rpo;
use miden_standards::account::auth::AuthSingleSig;
use miden_standards::account::faucets::BasicFungibleFaucet;
use miden_standards::account::wallets::BasicWallet;
use miden_standards::note::P2idNote;
Expand Down Expand Up @@ -325,7 +326,7 @@ fn create_account(public_key: PublicKey, index: u64, storage_mode: AccountStorag
AccountBuilder::new(init_seed.try_into().unwrap())
.account_type(AccountType::RegularAccountImmutableCode)
.storage_mode(storage_mode)
.with_auth_component(AuthFalcon512Rpo::new(public_key.into()))
.with_auth_component(AuthSingleSig::new(public_key.into(), AuthScheme::Falcon512Rpo))
.with_component(BasicWallet)
.build()
.unwrap()
Expand All @@ -343,7 +344,10 @@ fn create_faucet() -> Account {
.account_type(AccountType::FungibleFaucet)
.storage_mode(AccountStorageMode::Private)
.with_component(BasicFungibleFaucet::new(token_symbol, 2, Felt::new(u64::MAX)).unwrap())
.with_auth_component(AuthFalcon512Rpo::new(key_pair.public_key().into()))
.with_auth_component(AuthSingleSig::new(
key_pair.public_key().into(),
AuthScheme::Falcon512Rpo,
))
.build()
.unwrap()
}
Expand Down
9 changes: 6 additions & 3 deletions crates/ntx-builder/src/db/models/queries/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,9 +540,9 @@ fn note_script_insert_is_idempotent() {
///
/// Uses `AccountBuilder` with minimal components needed for serialization.
fn mock_account(_account_id: NetworkAccountId) -> miden_protocol::account::Account {
use miden_protocol::account::auth::PublicKeyCommitment;
use miden_protocol::account::auth::{AuthScheme, PublicKeyCommitment};
use miden_protocol::account::{AccountBuilder, AccountComponent};
use miden_standards::account::auth::AuthFalcon512Rpo;
use miden_standards::account::auth::AuthSingleSig;

let component_code = miden_standards::code_builder::CodeBuilder::default()
.compile_component_code("test::interface", "pub proc test_proc push.1.2 add end")
Expand All @@ -559,7 +559,10 @@ fn mock_account(_account_id: NetworkAccountId) -> miden_protocol::account::Accou
.account_type(AccountType::RegularAccountImmutableCode)
.storage_mode(AccountStorageMode::Network)
.with_component(component)
.with_auth_component(AuthFalcon512Rpo::new(PublicKeyCommitment::from(Word::default())))
.with_auth_component(AuthSingleSig::new(
PublicKeyCommitment::from(Word::default()),
AuthScheme::Falcon512Rpo,
))
.build_existing()
.unwrap()
}
Expand Down
1 change: 1 addition & 0 deletions crates/store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ fs-err = { workspace = true }
miden-agglayer = { branch = "next", features = ["testing"], git = "https://github.com/0xMiden/miden-base" }
miden-node-rocksdb-cxx-linkage-fix = { workspace = true }
miden-protocol = { features = ["std"], workspace = true }
miden-standards = { workspace = true }

[dev-dependencies]
assert_matches = { workspace = true }
Expand Down
Loading
Loading