Skip to content

Commit

Permalink
test: reduce coprocessor test time
Browse files Browse the repository at this point in the history
  • Loading branch information
rudy-6-4 committed Feb 18, 2025
1 parent 43d7518 commit 609cc35
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion fhevm-engine/coprocessor/src/tests/operators_from_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,21 @@ use fhevm_listener::contracts::TfheContract::TfheContractEvents;
use fhevm_listener::database::tfhe_event_propagate::{Database as ListenerDatabase, Handle, ToType};


use crate::tests::operators::{generate_binary_test_cases, generate_unary_test_cases, supported_types};
use crate::tests::operators::{generate_binary_test_cases, generate_unary_test_cases};
use crate::tests::utils::{default_api_key, setup_test_app, TestInstance};
use crate::tests::utils::{decrypt_ciphertexts, wait_until_all_ciphertexts_computed};

use crate::tests::operators::BinaryOperatorTestCase;
use crate::tests::operators::UnaryOperatorTestCase;

pub fn supported_types() -> &'static [i32] {
&[
0, // bool
8, // 256 bit
9, // ebytes 64
]
}

fn tfhe_event(data: TfheContractEvents) -> Log<TfheContractEvents> {
let address = "0x0000000000000000000000000000000000000000".parse().unwrap();
Log::<TfheContractEvents>{address, data}
Expand Down Expand Up @@ -106,6 +114,9 @@ async fn test_fhe_binary_operands_events() -> Result<(), Box<dyn std::error::Err
.await?;
let mut listener_event_to_db = listener_event_to_db(&app).await;
for op in generate_binary_test_cases() {
if !supported_types().contains(&op.input_types) {
break;
}
let support_bytes = match S::try_from(op.operand).unwrap() {
S::FheEq | S::FheNe => true,
_ => false
Expand Down Expand Up @@ -195,6 +206,9 @@ async fn test_fhe_unary_operands_events() -> Result<(), Box<dyn std::error::Erro
let mut listener_event_to_db = listener_event_to_db(&app).await;

for op in &ops {
if !supported_types().contains(&op.input_types) {
break;
}
let input_handle = next_handle();
let output_handle = next_handle();

Expand Down

0 comments on commit 609cc35

Please sign in to comment.