cargo test. Each
function takes the raw input bytes and returns Result<Vec<u8>, String>, so you
call it directly and assert on the error string — there is no ContractError
enum or test harness to set up. Functions that call the host (http, kv-store)
only run on wasm32; natively they return an error, so unit tests focus on input
parsing and validation.
- Happy path:
search-offers→book-offerreturns{ id, pnr, status }. - Input hygiene:
book-offeraccepts onlyoffer_id,passenger_id,total_amount,total_currency— any payload carrying passenger PII is rejected. - PII never in output:
passport,date_of_birth, and name fields do not appear in any return value or log line. - The
{{profile.*}}markers stay literal in the contract — resolution happens host-side, so they never appear resolved in WASM memory.