Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI #265

Merged
merged 1 commit into from
Apr 19, 2024
Merged
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
46 changes: 36 additions & 10 deletions tests/tests/ecpairing_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,12 @@ async fn ecpairing_fuzz_positive() {
];
for input in inputs {
let input_bytes = Some(Bytes::from(hex::decode(input).unwrap()));
let eth_response = eth_call(ECPAIRING_PRECOMPILE_ADDRESS, None, input_bytes.clone()).await.unwrap();
let era_response = era_call(ECPAIRING_PRECOMPILE_ADDRESS, None, input_bytes).await.unwrap();
let eth_response = eth_call(ECPAIRING_PRECOMPILE_ADDRESS, None, input_bytes.clone())
.await
.unwrap();
let era_response = era_call(ECPAIRING_PRECOMPILE_ADDRESS, None, input_bytes)
.await
.unwrap();
let (era_output, gas_used) = parse_call_result(&era_response);
write_ecpairing_gas_result(gas_used);
assert_eq!(era_output.len(), 32);
Expand All @@ -385,8 +389,12 @@ async fn ecpairing_fuzz_negative() {
];
for input in inputs {
let input_bytes = Some(Bytes::from(hex::decode(input).unwrap()));
let eth_response = eth_call(ECPAIRING_PRECOMPILE_ADDRESS, None, input_bytes.clone()).await.unwrap();
let era_response = era_call(ECPAIRING_PRECOMPILE_ADDRESS, None, input_bytes).await.unwrap();
let eth_response = eth_call(ECPAIRING_PRECOMPILE_ADDRESS, None, input_bytes.clone())
.await
.unwrap();
let era_response = era_call(ECPAIRING_PRECOMPILE_ADDRESS, None, input_bytes)
.await
.unwrap();
let (era_output, gas_used) = parse_call_result(&era_response);
write_ecpairing_gas_result(gas_used);
assert_eq!(era_output.len(), 32);
Expand Down Expand Up @@ -414,8 +422,14 @@ async fn ecpairing_fuzz_invalid_g1_point() {
];
for input in inputs {
let input_bytes = Some(Bytes::from(hex::decode(input).unwrap()));
assert!(eth_call(ECPAIRING_PRECOMPILE_ADDRESS, None, input_bytes.clone()).await.is_err());
assert!(era_call(ECPAIRING_PRECOMPILE_ADDRESS, None, input_bytes).await.is_err());
assert!(
eth_call(ECPAIRING_PRECOMPILE_ADDRESS, None, input_bytes.clone())
.await
.is_err()
);
assert!(era_call(ECPAIRING_PRECOMPILE_ADDRESS, None, input_bytes)
.await
.is_err());
}
}

Expand All @@ -439,8 +453,14 @@ async fn ecpairing_fuzz_invalid_g2_point() {
];
for input in inputs {
let input_bytes = Some(Bytes::from(hex::decode(input).unwrap()));
assert!(eth_call(ECPAIRING_PRECOMPILE_ADDRESS, None, input_bytes.clone()).await.is_err());
assert!(era_call(ECPAIRING_PRECOMPILE_ADDRESS, None, input_bytes).await.is_err());
assert!(
eth_call(ECPAIRING_PRECOMPILE_ADDRESS, None, input_bytes.clone())
.await
.is_err()
);
assert!(era_call(ECPAIRING_PRECOMPILE_ADDRESS, None, input_bytes)
.await
.is_err());
}
}

Expand Down Expand Up @@ -529,7 +549,13 @@ async fn ecpairing_fuzz_invalid_g2_subgroup() {
];
for input in inputs {
let input_bytes = Some(Bytes::from(hex::decode(input).unwrap()));
assert!(eth_call(ECPAIRING_PRECOMPILE_ADDRESS, None, input_bytes.clone()).await.is_err());
assert!(era_call(ECPAIRING_PRECOMPILE_ADDRESS, None, input_bytes).await.is_err());
assert!(
eth_call(ECPAIRING_PRECOMPILE_ADDRESS, None, input_bytes.clone())
.await
.is_err()
);
assert!(era_call(ECPAIRING_PRECOMPILE_ADDRESS, None, input_bytes)
.await
.is_err());
}
}
Loading