Skip to content
Open
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
14 changes: 0 additions & 14 deletions crates/sncast/tests/e2e/account/deploy.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::helpers::constants::{DEVNET_OZ_CLASS_HASH_CAIRO_0, URL};
use crate::helpers::env::set_keystore_password_env;
use crate::helpers::fee::apply_test_resource_bounds_flags;
use crate::helpers::fixtures::copy_file;
use crate::helpers::fixtures::{
get_address_from_keystore, get_transaction_hash, get_transaction_receipt, mint_token,
Expand Down Expand Up @@ -41,7 +40,6 @@ pub async fn test_happy_case(class_hash: &str, account_type: &str) {
"--name",
"my_account",
];
let args = apply_test_resource_bounds_flags(args);

let snapbox = runner(&args)
.env("SNCAST_FORCE_SHOW_EXPLORER_LINKS", "1")
Expand Down Expand Up @@ -79,7 +77,6 @@ pub async fn test_happy_case_max_fee() {
"--name",
"my_account",
];
let args = apply_test_resource_bounds_flags(args);

let snapbox = runner(&args)
.env("SNCAST_FORCE_SHOW_EXPLORER_LINKS", "1")
Expand Down Expand Up @@ -117,7 +114,6 @@ pub async fn test_happy_case_add_profile() {
"--name",
"my_account",
];
let args = apply_test_resource_bounds_flags(args);

let snapbox = runner(&args)
.env("SNCAST_FORCE_SHOW_EXPLORER_LINKS", "1")
Expand Down Expand Up @@ -152,7 +148,6 @@ fn test_account_deploy_error(accounts_content: &str, error: &str) {
"--name",
"my_account",
];
let args = apply_test_resource_bounds_flags(args);

let snapbox = runner(&args).current_dir(temp_dir.path());
let output = snapbox.assert();
Expand All @@ -175,7 +170,6 @@ pub async fn test_valid_class_hash() {
"--name",
"my_account",
];
let args = apply_test_resource_bounds_flags(args);

let snapbox = runner(&args)
.env("SNCAST_FORCE_SHOW_EXPLORER_LINKS", "1")
Expand Down Expand Up @@ -305,7 +299,6 @@ pub async fn test_happy_case_keystore(account_type: &str) {
"--url",
URL,
];
let args = apply_test_resource_bounds_flags(args);

let snapbox = runner(&args)
.env("SNCAST_FORCE_SHOW_EXPLORER_LINKS", "1")
Expand Down Expand Up @@ -356,7 +349,6 @@ pub async fn test_keystore_already_deployed() {
"--url",
URL,
];
let args = apply_test_resource_bounds_flags(args);

let snapbox = runner(&args).current_dir(tempdir.path());
let output = snapbox.assert().success();
Expand Down Expand Up @@ -398,7 +390,6 @@ pub async fn test_keystore_key_mismatch() {
"--url",
URL,
];
let args = apply_test_resource_bounds_flags(args);

let snapbox = runner(&args).current_dir(tempdir.path());
let output = snapbox.assert().success();
Expand Down Expand Up @@ -435,7 +426,6 @@ pub async fn test_deploy_keystore_inexistent_keystore_file() {
"--url",
URL,
];
let args = apply_test_resource_bounds_flags(args);

let snapbox = runner(&args).current_dir(tempdir.path());
let output = snapbox.assert().success();
Expand Down Expand Up @@ -472,7 +462,6 @@ pub async fn test_deploy_keystore_inexistent_account_file() {
"--url",
URL,
];
let args = apply_test_resource_bounds_flags(args);

let snapbox = runner(&args).current_dir(tempdir.path());
let output = snapbox.assert().success();
Expand Down Expand Up @@ -513,7 +502,6 @@ pub async fn test_deploy_keystore_no_status() {
"--url",
URL,
];
let args = apply_test_resource_bounds_flags(args);

let snapbox = runner(&args).current_dir(tempdir.path());
let output = snapbox.assert().success();
Expand Down Expand Up @@ -571,7 +559,6 @@ pub async fn test_deploy_keystore_other_args() {
"--name",
"some-name",
];
let args = apply_test_resource_bounds_flags(args);

let snapbox = runner(&args)
.env("SNCAST_FORCE_SHOW_EXPLORER_LINKS", "1")
Expand Down Expand Up @@ -602,7 +589,6 @@ pub async fn test_json_output_format() {
"--name",
"my_account",
];
let args = apply_test_resource_bounds_flags(args);

let snapbox = runner(&args)
.env("SNCAST_FORCE_SHOW_EXPLORER_LINKS", "1")
Expand Down
20 changes: 3 additions & 17 deletions crates/sncast/tests/e2e/declare.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::helpers::constants::{CONTRACTS_DIR, DEVNET_OZ_CLASS_HASH_CAIRO_0, URL};
use crate::helpers::fee::apply_test_resource_bounds_flags;
use crate::helpers::fixtures::{
copy_directory_to_tempdir, create_and_deploy_account, create_and_deploy_oz_account,
duplicate_contract_directory_with_salt, get_accounts_path, get_transaction_by_hash,
Expand Down Expand Up @@ -39,7 +38,6 @@ async fn test_happy_case_human_readable() {
"--contract-name",
"Map",
];
let args = apply_test_resource_bounds_flags(args);

let snapbox = runner(&args)
.env("SNCAST_FORCE_SHOW_EXPLORER_LINKS", "1")
Expand Down Expand Up @@ -86,7 +84,6 @@ async fn test_happy_case_json_output() {
"--contract-name",
"Map",
];
let args = apply_test_resource_bounds_flags(args);

let snapbox = runner(&args)
.env("SNCAST_FORCE_SHOW_EXPLORER_LINKS", "1")
Expand Down Expand Up @@ -131,7 +128,6 @@ async fn test_happy_case(class_hash: Felt, account_type: AccountType) {
"--contract-name",
"Map",
];
let args = apply_test_resource_bounds_flags(args);

let snapbox = runner(&args).current_dir(tempdir.path());
let output = snapbox.assert().success().get_output().stdout.clone();
Expand Down Expand Up @@ -163,7 +159,6 @@ async fn test_contract_with_constructor_params() {
"--contract-name",
"ContractWithConstructorParams",
];
let args = apply_test_resource_bounds_flags(args);

let snapbox = runner(&args)
.env("SNCAST_FORCE_SHOW_EXPLORER_LINKS", "1")
Expand Down Expand Up @@ -308,7 +303,6 @@ async fn test_happy_case_specify_package() {
"--package",
"main_workspace",
];
let args = apply_test_resource_bounds_flags(args);

let snapbox = runner(&args).current_dir(tempdir.path());

Expand Down Expand Up @@ -340,7 +334,6 @@ async fn test_contract_already_declared() {
"--contract-name",
"Map",
];
let args = apply_test_resource_bounds_flags(args);

runner(&args).current_dir(tempdir.path()).assert().success();

Expand Down Expand Up @@ -413,17 +406,16 @@ async fn test_invalid_nonce() {
"--nonce",
"12345",
];
let args = apply_test_resource_bounds_flags(args);

let snapbox = runner(&args).current_dir(contract_path.path());
let output = snapbox.assert().success();

assert_stderr_contains(
output,
indoc! {r"
indoc! {r#"
Command: declare
Error: Invalid transaction nonce
"},
Error: Transaction execution error = TransactionExecutionErrorData { transaction_index: 0, execution_error: Message("Account transaction nonce is invalid.") }
"#},
);
}

Expand Down Expand Up @@ -610,7 +602,6 @@ fn test_scarb_no_casm_artifact() {
"--contract-name",
"minimal_contract",
];
let args = apply_test_resource_bounds_flags(args);

let snapbox = runner(&args).current_dir(tempdir.path());
let output = snapbox.assert().success();
Expand Down Expand Up @@ -645,7 +636,6 @@ async fn test_many_packages_default() {
"--contract-name",
"supercomplexcode2",
];
let args = apply_test_resource_bounds_flags(args);

let snapbox = runner(&args).current_dir(tempdir.path());
let output = snapbox.assert().failure();
Expand Down Expand Up @@ -674,7 +664,6 @@ async fn test_workspaces_package_specified_virtual_fibonacci() {
"--contract-name",
"FibonacciContract",
];
let args = apply_test_resource_bounds_flags(args);

let snapbox = runner(&args)
.env("SNCAST_FORCE_SHOW_EXPLORER_LINKS", "1")
Expand Down Expand Up @@ -704,7 +693,6 @@ async fn test_workspaces_package_no_contract() {
"--contract-name",
"whatever",
];
let args = apply_test_resource_bounds_flags(args);

let snapbox = runner(&args).current_dir(tempdir.path());
let output = snapbox.assert().success();
Expand Down Expand Up @@ -739,7 +727,6 @@ async fn test_no_scarb_profile() {
"--contract-name",
"Map",
];
let args = apply_test_resource_bounds_flags(args);

let snapbox = runner(&args)
.env("SNCAST_FORCE_SHOW_EXPLORER_LINKS", "1")
Expand Down Expand Up @@ -787,7 +774,6 @@ async fn test_no_explorer_links_on_localhost() {
"--contract-name",
"Map",
];
let args = apply_test_resource_bounds_flags(args);

let snapbox = runner(&args).current_dir(tempdir.path());
let output = snapbox.assert().success();
Expand Down
12 changes: 0 additions & 12 deletions crates/sncast/tests/e2e/declare_from.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::helpers::constants::{
CONTRACTS_DIR, MAP_CONTRACT_CLASS_HASH_SEPOLIA, SEPOLIA_RPC_URL, URL,
};
use crate::helpers::fee::apply_test_resource_bounds_flags;
use crate::helpers::fixtures::{
create_and_deploy_oz_account, duplicate_contract_directory_with_salt, get_accounts_path,
join_tempdirs,
Expand Down Expand Up @@ -35,7 +34,6 @@ async fn test_happy_case() {
"--url",
URL,
];
let args = apply_test_resource_bounds_flags(args);

let snapbox = runner(&args)
.env("SNCAST_FORCE_SHOW_EXPLORER_LINKS", "1")
Expand Down Expand Up @@ -80,7 +78,6 @@ async fn test_happy_case_with_block_id() {
"--block-id",
"latest",
];
let args = apply_test_resource_bounds_flags(args);

let snapbox = runner(&args)
.env("SNCAST_FORCE_SHOW_EXPLORER_LINKS", "1")
Expand Down Expand Up @@ -120,7 +117,6 @@ async fn test_contract_already_declared() {
"--url",
URL,
];
let args = apply_test_resource_bounds_flags(args);

let snapbox = runner(&args).current_dir(temp_dir.path());
let output = snapbox.assert().success();
Expand Down Expand Up @@ -152,7 +148,6 @@ async fn test_class_hash_does_not_exist_on_source_network() {
"--url",
URL,
];
let args = apply_test_resource_bounds_flags(args);

let snapbox = runner(&args).current_dir(temp_dir.path());
let output = snapbox.assert().success();
Expand Down Expand Up @@ -182,7 +177,6 @@ async fn test_source_rpc_args_not_passed() {
"--url",
URL,
];
let args = apply_test_resource_bounds_flags(args);

let snapbox = runner(&args).current_dir(temp_dir.path());
let output = snapbox.assert().failure();
Expand Down Expand Up @@ -213,7 +207,6 @@ async fn test_invalid_block_id() {
"--block-id",
"0x10101",
];
let args = apply_test_resource_bounds_flags(args);

let snapbox = runner(&args).current_dir(temp_dir.path());
let output = snapbox.assert().failure();
Expand Down Expand Up @@ -267,7 +260,6 @@ async fn test_declare_from_sierra_happy_case() {
"--url",
URL,
];
let args = apply_test_resource_bounds_flags(args);

let snapbox = runner(&args)
.env("SNCAST_FORCE_SHOW_EXPLORER_LINKS", "1")
Expand Down Expand Up @@ -305,7 +297,6 @@ async fn test_declare_from_sierra_does_not_exist() {
"--url",
URL,
];
let args = apply_test_resource_bounds_flags(args);
let snapbox = runner(&args).current_dir(temp_dir.path());
let output = snapbox.assert().success();

Expand Down Expand Up @@ -337,7 +328,6 @@ async fn test_declare_from_sierra_invalid_json() {
"--url",
URL,
];
let args = apply_test_resource_bounds_flags(args);
let snapbox = runner(&args).current_dir(temp_dir.path());
let output = snapbox.assert().success();

Expand Down Expand Up @@ -384,7 +374,6 @@ async fn test_declare_from_sierra_already_declared() {
"--url",
URL,
];
let args = apply_test_resource_bounds_flags(args);

runner(&args).current_dir(tempdir.path()).assert().success();

Expand All @@ -399,7 +388,6 @@ async fn test_declare_from_sierra_already_declared() {
"--url",
URL,
];
let args = apply_test_resource_bounds_flags(args);
let snapbox = runner(&args).current_dir(tempdir.path());
let output = snapbox.assert().success();

Expand Down
Loading
Loading