Skip to content

Commit 53f9fe3

Browse files
Merge branch 'next' into fabrizioorsi-multicall-cli
Signed-off-by: Tomas Fabrizio Orsi <tomas.orsi@lambdaclass.com>
2 parents 4f954c2 + e799083 commit 53f9fe3

File tree

171 files changed

+1963
-1739
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

171 files changed

+1963
-1739
lines changed

bin/miden-cli/build.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
use std::{
2-
env, fs,
3-
path::{Path, PathBuf},
4-
};
1+
use std::path::{Path, PathBuf};
2+
use std::{env, fs};
53

64
use miden_client::account::component::{
7-
AccountComponentMetadata, AccountComponentTemplate, COMPONENT_TEMPLATE_EXTENSION,
5+
AccountComponentMetadata,
6+
AccountComponentTemplate,
7+
COMPONENT_TEMPLATE_EXTENSION,
88
};
9-
use miden_lib::{
10-
account::components::{
11-
basic_fungible_faucet_library, basic_wallet_library, rpo_falcon_512_library,
12-
},
13-
utils::Serializable,
9+
use miden_lib::account::components::{
10+
basic_fungible_faucet_library,
11+
basic_wallet_library,
12+
rpo_falcon_512_library,
1413
};
14+
use miden_lib::utils::Serializable;
1515
use miden_objects::assembly::Library;
1616

1717
fn main() {

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

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
11
use clap::Parser;
22
use comfy_table::{Cell, ContentArrangement, presets};
3-
use miden_client::{
4-
Client, ZERO,
5-
account::{Account, AccountId, AccountType, StorageSlot},
6-
asset::Asset,
7-
rpc::{NodeRpcClient, TonicRpcClient},
8-
};
3+
use miden_client::account::{Account, AccountId, AccountType, StorageSlot};
4+
use miden_client::asset::Asset;
5+
use miden_client::rpc::{NodeRpcClient, TonicRpcClient};
6+
use miden_client::{Client, ZERO};
97
use miden_objects::PrettyPrint;
108

11-
use crate::{
12-
client_binary_name,
13-
config::CliConfig,
14-
create_dynamic_table,
15-
errors::CliError,
16-
utils::{load_config_file, load_faucet_details_map, parse_account_id, update_config},
17-
};
9+
use crate::config::CliConfig;
10+
use crate::errors::CliError;
11+
use crate::utils::{load_config_file, load_faucet_details_map, parse_account_id, update_config};
12+
use crate::{client_binary_name, create_dynamic_table};
1813

1914
// ACCOUNT COMMAND
2015
// ================================================================================================

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
use std::{collections::BTreeSet, path::PathBuf};
1+
use std::collections::BTreeSet;
2+
use std::path::PathBuf;
23

34
use clap::Parser;
4-
use miden_client::{Client, Felt, Word, auth::TransactionAuthenticator};
5+
use miden_client::auth::TransactionAuthenticator;
6+
use miden_client::{Client, Felt, Word};
57
use miden_objects::vm::AdviceInputs;
68
use serde::{Deserialize, Deserializer, Serialize, de};
79

8-
use crate::{errors::CliError, utils::get_input_acc_id_by_prefix_or_default};
10+
use crate::errors::CliError;
11+
use crate::utils::get_input_acc_id_by_prefix_or_default;
912

1013
// EXEC COMMAND
1114
// ================================================================================================

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
use std::{fs::File, io::Write, path::PathBuf};
2-
3-
use miden_client::{
4-
Client, Word,
5-
account::{Account, AccountFile},
6-
auth::TransactionAuthenticator,
7-
store::NoteExportType,
8-
transaction::AccountInterface,
9-
utils::Serializable,
10-
};
1+
use std::fs::File;
2+
use std::io::Write;
3+
use std::path::PathBuf;
4+
5+
use miden_client::account::{Account, AccountFile};
6+
use miden_client::auth::TransactionAuthenticator;
7+
use miden_client::store::NoteExportType;
8+
use miden_client::transaction::AccountInterface;
9+
use miden_client::utils::Serializable;
10+
use miden_client::{Client, Word};
1111
use miden_lib::AuthScheme;
1212
use tracing::info;
1313

14-
use crate::{
15-
CliKeyStore, Parser, errors::CliError, get_output_note_with_id_prefix, utils::parse_account_id,
16-
};
14+
use crate::errors::CliError;
15+
use crate::utils::parse_account_id;
16+
use crate::{CliKeyStore, Parser, get_output_note_with_id_prefix};
1717

1818
#[derive(Debug, Parser, Clone)]
1919
#[command(about = "Export client output notes, or account data")]

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

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
1-
use std::{
2-
fs::{self, File},
3-
io::Read,
4-
path::PathBuf,
5-
};
6-
7-
use miden_client::{
8-
Client, ClientError,
9-
account::{AccountFile, AccountId},
10-
auth::TransactionAuthenticator,
11-
note::NoteFile,
12-
utils::Deserializable,
13-
};
1+
use std::fs::{self, File};
2+
use std::io::Read;
3+
use std::path::PathBuf;
4+
5+
use miden_client::account::{AccountFile, AccountId};
6+
use miden_client::auth::TransactionAuthenticator;
7+
use miden_client::note::NoteFile;
8+
use miden_client::utils::Deserializable;
9+
use miden_client::{Client, ClientError};
1410
use tracing::info;
1511

16-
use crate::{
17-
CliKeyStore, Parser, commands::account::maybe_set_default_account, errors::CliError,
18-
utils::load_config_file,
19-
};
12+
use crate::commands::account::maybe_set_default_account;
13+
use crate::errors::CliError;
14+
use crate::utils::load_config_file;
15+
use crate::{CliKeyStore, Parser};
2016

2117
#[derive(Debug, Parser, Clone)]
2218
#[command(about = "Import notes or accounts")]

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

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
1-
use std::{
2-
fs::{self, File},
3-
io::Write,
4-
path::PathBuf,
5-
};
1+
use std::fs::{self, File};
2+
use std::io::Write;
3+
use std::path::PathBuf;
64

75
use clap::Parser;
86
use tracing::info;
97

10-
use crate::{
11-
CLIENT_CONFIG_FILE_NAME,
12-
config::{CliConfig, CliEndpoint, Network},
13-
errors::CliError,
14-
};
8+
use crate::CLIENT_CONFIG_FILE_NAME;
9+
use crate::config::{CliConfig, CliEndpoint, Network};
10+
use crate::errors::CliError;
1511

1612
/// Contains the account component template file generated on build.rs, corresponding to the basic
1713
/// wallet component.

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

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,31 @@
1-
use std::{
2-
collections::BTreeMap,
3-
fs::{self, File},
4-
io::{Read, Write},
5-
path::PathBuf,
6-
vec,
7-
};
1+
use std::collections::BTreeMap;
2+
use std::fs::{self, File};
3+
use std::io::{Read, Write};
4+
use std::path::PathBuf;
5+
use std::vec;
86

97
use clap::{Parser, ValueEnum};
10-
use miden_client::{
11-
Client,
12-
account::{
13-
Account, AccountBuilder, AccountStorageMode, AccountType,
14-
component::COMPONENT_TEMPLATE_EXTENSION,
15-
},
16-
auth::{AuthSecretKey, TransactionAuthenticator},
17-
crypto::SecretKey,
18-
transaction::TransactionRequestBuilder,
19-
utils::Deserializable,
20-
};
8+
use miden_client::Client;
9+
use miden_client::account::component::COMPONENT_TEMPLATE_EXTENSION;
10+
use miden_client::account::{Account, AccountBuilder, AccountStorageMode, AccountType};
11+
use miden_client::auth::{AuthSecretKey, TransactionAuthenticator};
12+
use miden_client::crypto::SecretKey;
13+
use miden_client::transaction::TransactionRequestBuilder;
14+
use miden_client::utils::Deserializable;
2115
use miden_lib::account::auth::AuthRpoFalcon512;
2216
use miden_objects::account::{
23-
AccountComponent, AccountComponentTemplate, InitStorageData, StorageValueName,
17+
AccountComponent,
18+
AccountComponentTemplate,
19+
InitStorageData,
20+
StorageValueName,
2421
};
2522
use rand::RngCore;
2623
use tracing::debug;
2724

28-
use crate::{
29-
CliKeyStore, client_binary_name, commands::account::maybe_set_default_account,
30-
errors::CliError, utils::load_config_file,
31-
};
25+
use crate::commands::account::maybe_set_default_account;
26+
use crate::errors::CliError;
27+
use crate::utils::load_config_file;
28+
use crate::{CliKeyStore, client_binary_name};
3229

3330
// CLI TYPES
3431
// ================================================================================================

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

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,37 @@
1-
use std::{io, sync::Arc};
1+
use std::io;
2+
use std::sync::Arc;
23

34
use clap::{Parser, ValueEnum};
4-
use miden_client::{
5-
Client, RemoteTransactionProver,
6-
account::AccountId,
7-
asset::{FungibleAsset, NonFungibleDeltaAction},
8-
auth::TransactionAuthenticator,
9-
note::{BlockNumber, NoteType as MidenNoteType, build_swap_tag, get_input_note_with_id_prefix},
10-
store::NoteRecordError,
11-
transaction::{
12-
InputNote, OutputNote, PaymentNoteDescription, SwapTransactionData, TransactionRequest,
13-
TransactionRequestBuilder, TransactionResult,
14-
},
5+
use miden_client::account::AccountId;
6+
use miden_client::asset::{FungibleAsset, NonFungibleDeltaAction};
7+
use miden_client::auth::TransactionAuthenticator;
8+
use miden_client::note::{
9+
BlockNumber,
10+
NoteType as MidenNoteType,
11+
build_swap_tag,
12+
get_input_note_with_id_prefix,
1513
};
14+
use miden_client::store::NoteRecordError;
15+
use miden_client::transaction::{
16+
InputNote,
17+
OutputNote,
18+
PaymentNoteDescription,
19+
SwapTransactionData,
20+
TransactionRequest,
21+
TransactionRequestBuilder,
22+
TransactionResult,
23+
};
24+
use miden_client::{Client, RemoteTransactionProver};
1625
use tracing::info;
1726

18-
use crate::{
19-
create_dynamic_table,
20-
errors::CliError,
21-
utils::{
22-
SHARED_TOKEN_DOCUMENTATION, get_input_acc_id_by_prefix_or_default, load_config_file,
23-
load_faucet_details_map, parse_account_id,
24-
},
27+
use crate::create_dynamic_table;
28+
use crate::errors::CliError;
29+
use crate::utils::{
30+
SHARED_TOKEN_DOCUMENTATION,
31+
get_input_acc_id_by_prefix_or_default,
32+
load_config_file,
33+
load_faucet_details_map,
34+
parse_account_id,
2535
};
2636

2737
#[derive(Debug, Clone, Copy, ValueEnum)]

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

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
use clap::ValueEnum;
22
use comfy_table::{Attribute, Cell, ContentArrangement, Table, presets};
3-
use miden_client::{
4-
Client, ClientError, IdPrefixFetchError,
5-
asset::Asset,
6-
auth::TransactionAuthenticator,
7-
note::{
8-
NoteConsumability, NoteInputs, NoteMetadata, WellKnownNote, get_input_note_with_id_prefix,
9-
},
10-
store::{InputNoteRecord, NoteFilter as ClientNoteFilter, OutputNoteRecord},
3+
use miden_client::asset::Asset;
4+
use miden_client::auth::TransactionAuthenticator;
5+
use miden_client::note::{
6+
NoteConsumability,
7+
NoteInputs,
8+
NoteMetadata,
9+
WellKnownNote,
10+
get_input_note_with_id_prefix,
1111
};
12+
use miden_client::store::{InputNoteRecord, NoteFilter as ClientNoteFilter, OutputNoteRecord};
13+
use miden_client::{Client, ClientError, IdPrefixFetchError};
1214
use miden_objects::PrettyPrint;
1315

14-
use crate::{
15-
Parser, create_dynamic_table,
16-
errors::CliError,
17-
get_output_note_with_id_prefix,
18-
utils::{load_faucet_details_map, parse_account_id},
19-
};
16+
use crate::errors::CliError;
17+
use crate::utils::{load_faucet_details_map, parse_account_id};
18+
use crate::{Parser, create_dynamic_table, get_output_note_with_id_prefix};
2019

2120
#[derive(Clone, Debug, ValueEnum)]
2221
pub enum NoteFilter {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use clap::Parser;
2-
use miden_client::{Client, auth::TransactionAuthenticator};
2+
use miden_client::Client;
3+
use miden_client::auth::TransactionAuthenticator;
34

45
use crate::errors::CliError;
56

0 commit comments

Comments
 (0)