#[test]
fn test_order_matching() {
let mut env = FheTestEnv::new();
env.deploy_program(PROGRAM_ID, include_bytes!("../program.so"));
let payer = env.create_funded_keypair();
// Setup: buy_price=100, sell_price=95
// Expected: can_match=true, fill_price=95
let buy_price_hash = env.encrypt_and_submit_u8(100);
let sell_price_hash = env.encrypt_and_submit_u8(95);
let buy_qty_hash = env.encrypt_and_submit_u8(50);
let sell_qty_hash = env.encrypt_and_submit_u8(30);
// ... build and send transaction ...
env.sync_data_store_to_syscalls();
// ... send transaction ...
env.sync_data_store_from_syscalls();
// Read result from account
let result_account = env.svm.get_account(&result_pubkey).unwrap();
let fill_price_hash: [u8; 32] = result_account.data[0..32].try_into().unwrap();
let fill_qty_hash: [u8; 32] = result_account.data[32..64].try_into().unwrap();
// Verify: fill_price = sell_price = 95
env.assert_encrypted_eq_u8(&fill_price_hash, 95);
// Verify: fill_qty = min(50, 30) = 30
env.assert_encrypted_eq_u8(&fill_qty_hash, 30);
}