Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
lambda-0x committed Jul 31, 2024
1 parent 3ba4859 commit 2420ac4
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 53 deletions.
100 changes: 55 additions & 45 deletions crates/sozo/ops/src/tests/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,17 @@ async fn call_with_bad_address() {
let provider = sequencer.provider();
let world_reader = WorldContractReader::new(world.address, provider);

assert!(call::call(
world_reader,
"0xBadCoffeeBadCode".to_string(),
ENTRYPOINT.to_string(),
vec![Felt::ZERO, Felt::ZERO],
None
)
.await
.is_err());
assert!(
call::call(
world_reader,
"0xBadCoffeeBadCode".to_string(),
ENTRYPOINT.to_string(),
vec![Felt::ZERO, Felt::ZERO],
None
)
.await
.is_err()
);
}

#[tokio::test]
Expand All @@ -42,15 +44,17 @@ async fn call_with_bad_name() {
let provider = sequencer.provider();
let world_reader = WorldContractReader::new(world.address, provider);

assert!(call::call(
world_reader,
"BadName".to_string(),
ENTRYPOINT.to_string(),
vec![Felt::ZERO, Felt::ZERO],
None
)
.await
.is_err());
assert!(
call::call(
world_reader,
"BadName".to_string(),
ENTRYPOINT.to_string(),
vec![Felt::ZERO, Felt::ZERO],
None
)
.await
.is_err()
);
}

#[tokio::test]
Expand All @@ -61,15 +65,17 @@ async fn call_with_bad_entrypoint() {
let provider = sequencer.provider();
let world_reader = WorldContractReader::new(world.address, provider);

assert!(call::call(
world_reader,
CONTRACT_TAG.to_string(),
"BadEntryPoint".to_string(),
vec![Felt::ZERO, Felt::ZERO],
None
)
.await
.is_err());
assert!(
call::call(
world_reader,
CONTRACT_TAG.to_string(),
"BadEntryPoint".to_string(),
vec![Felt::ZERO, Felt::ZERO],
None
)
.await
.is_err()
);
}

#[tokio::test]
Expand All @@ -80,15 +86,17 @@ async fn call_with_bad_calldata() {
let provider = sequencer.provider();
let world_reader = WorldContractReader::new(world.address, provider);

assert!(call::call(
world_reader,
CONTRACT_TAG.to_string(),
ENTRYPOINT.to_string(),
vec![Felt::ZERO],
None
)
.await
.is_err());
assert!(
call::call(
world_reader,
CONTRACT_TAG.to_string(),
ENTRYPOINT.to_string(),
vec![Felt::ZERO],
None
)
.await
.is_err()
);
}

#[tokio::test]
Expand Down Expand Up @@ -120,13 +128,15 @@ async fn call_with_contract_address() {
.await
.unwrap();

assert!(call::call(
world_reader,
format!("{:#x}", contract_address),
ENTRYPOINT.to_string(),
vec![],
None,
)
.await
.is_ok());
assert!(
call::call(
world_reader,
format!("{:#x}", contract_address),
ENTRYPOINT.to_string(),
vec![],
None,
)
.await
.is_ok()
);
}
18 changes: 10 additions & 8 deletions crates/sozo/ops/src/tests/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,16 @@ async fn migrate_with_small_fee_multiplier_will_fail() {

let account = sequencer.account(0);

assert!(execute_strategy(
&ws,
&migration,
&account,
TxnConfig { fee_estimate_multiplier: Some(0.2f64), ..Default::default() },
)
.await
.is_err());
assert!(
execute_strategy(
&ws,
&migration,
&account,
TxnConfig { fee_estimate_multiplier: Some(0.2f64), ..Default::default() },
)
.await
.is_err()
);
}

#[tokio::test]
Expand Down

0 comments on commit 2420ac4

Please sign in to comment.