use anyhow::Result; use ethereum_types::U256; use crate::cpu::kernel::aggregator::combined_kernel; use crate::cpu::kernel::interpreter::run_with_kernel; #[test] fn test_field() -> Result<()> { let kernel = combined_kernel(); let initial_offset = kernel.global_labels["test_mul_Fp12"]; let initial_stack: Vec = vec![ 1, 1, 0, 0, 1, 0, 3, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 3, 0, 0, 1, 0, 0, ] .iter() .map(|&x| U256::from(x as u32)) .rev() .collect(); let final_stack: Vec = run_with_kernel(&kernel, initial_offset, initial_stack)? .stack() .to_vec(); let expected: Vec = vec![5, 5, 9, 0, 5, 3, 17, 12, 100, 1, 3, 0] .iter() .map(|&x| U256::from(x as u32)) .rev() .collect(); assert_eq!(final_stack, expected); Ok(()) }