Skip to content

Commit

Permalink
Remove test_account_deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
JimmyFate committed Mar 23, 2024
1 parent 3aeb70b commit 692869b
Showing 1 changed file with 3 additions and 41 deletions.
44 changes: 3 additions & 41 deletions bin/sozo/tests/test_account.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
mod utils;

use std::{env, fs};
use std::fs;

use assert_fs::fixture::PathChild;
use starknet_crypto::FieldElement;
use sozo_ops::account;
use starknet::accounts::Account;
use utils::snapbox::get_snapbox;

use sozo_ops::account::{self, FeeSetting};

use starknet::{
accounts::Account,
signers::{LocalWallet, SigningKey},
};

#[test]
fn test_account_new() {
let pt = assert_fs::TempDir::new().unwrap();
Expand All @@ -35,38 +29,6 @@ fn test_account_new() {
assert!(pt.child("account.json").exists());
}

#[katana_runner::katana_test(1, true)]
async fn test_account_deploy() {
let account_path = fs::canonicalize("./tests/test_data/account/account.json").unwrap();
let keystore_path = fs::canonicalize("./tests/test_data/keystore/keystore.json").unwrap();

let pt = assert_fs::TempDir::new().unwrap();
fs::copy(account_path.clone(), pt.child("account.json")).unwrap();

let signer = LocalWallet::from_signing_key(
SigningKey::from_keystore(keystore_path, "password").unwrap(),
);

let contents = fs::read_to_string(pt.child("account.json")).unwrap();
assert!(contents.contains(r#""status": "undeployed""#));

env::set_var("PASS_STDIN", "1");
account::deploy(
runner.owned_provider(),
signer,
FeeSetting::Manual(FieldElement::from(1000_u32)),
false,
None,
1000,
account_path,
)
.await
.unwrap();

let contents = fs::read_to_string(pt.child("account.json")).unwrap();
assert!(contents.contains(r#""status": "deployed""#));
}

#[katana_runner::katana_test(1, true)]
async fn test_account_fetch() {
let pt = assert_fs::TempDir::new().unwrap();
Expand Down

0 comments on commit 692869b

Please sign in to comment.