Skip to content

Commit

Permalink
feat: 🐛 Small change on functions / for optimization use the run scri…
Browse files Browse the repository at this point in the history
…pt pls
  • Loading branch information
Tbelleng committed Apr 2, 2024
1 parent a436604 commit e289a36
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion unit_tests/src/constants.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Max block number used for testing
pub const MAX_BLOCK: u64 = 3000;
pub const MAX_BLOCK: u64 = 5000;

pub const DEOXYS: &str = "deoxys";
pub const PATHFINDER: &str = "pathfinder";
Expand Down
11 changes: 8 additions & 3 deletions unit_tests/tests/test_call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,13 @@ async fn fail_too_many_call_data(clients: HashMap<String, JsonRpcClient<HttpTran
entry_point_selector: get_selector_from_name("name").unwrap(),
calldata: vec![FieldElement::ZERO],
},
BlockId::Tag(BlockTag::Latest),
BlockId::Number(MAX_BLOCK),
)
.await
.err();

println!("{:?}", response_deoxys);

assert!(
response_deoxys.is_some(),
"Expected an error, but got a result"
Expand Down Expand Up @@ -302,7 +304,7 @@ async fn work_correct_call(clients: HashMap<String, JsonRpcClient<HttpTransport>
entry_point_selector: get_selector_from_name("name").unwrap(),
calldata: vec![],
},
BlockId::Tag(BlockTag::Latest),
BlockId::Number(MAX_BLOCK),
)
.await
.expect("Error waiting for response from Deoxys node");
Expand All @@ -314,13 +316,16 @@ async fn work_correct_call(clients: HashMap<String, JsonRpcClient<HttpTransport>
entry_point_selector: get_selector_from_name("name").unwrap(),
calldata: vec![],
},
BlockId::Tag(BlockTag::Latest),
BlockId::Number(MAX_BLOCK),
)
.await
.expect("Error waiting for response from Pathfinder node");

let response_expected = short_string!("Ether");

println!("{:?}", response_deoxys);
println!("{:?}", response_pathfinder);

assert_eq!(response_deoxys, vec![response_expected]);
assert_eq!(response_deoxys, response_pathfinder);
}
Expand Down
4 changes: 2 additions & 2 deletions unit_tests/tests/test_get_block_with_txs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ async fn work_with_latest_block(clients: HashMap<String, JsonRpcClient<HttpTrans
}

let response_deoxys = deoxys
.get_block_with_txs(block_tag)
.get_block_with_txs(block_number)
.await
.expect("Error waiting for response from Deoxys node");

let response_pathfinder = pathfinder
.get_block_with_txs(block_tag)
.get_block_with_txs(block_number)
.await
.expect("Error waiting for response from Pathfinder node");

Expand Down
2 changes: 1 addition & 1 deletion unit_tests/tests/test_get_class_at.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ async fn work_contract_v0(
let pathfinder = &clients[PATHFINDER];

if MAX_BLOCK < BLOCK_LEGACY {
return;
return Ok(());
}

let response_deoxys = deoxys
Expand Down

0 comments on commit e289a36

Please sign in to comment.