1. check transaction has valid program_id before using it to avoid possible panic; 2. change calculate_cost function signature to return Result; 3. add CostModelError enum, update return type from Result<_, str> to Result<_, CostModelError>
1. check transaction has valid program_id before using it to avoid possible panic; 2. change calculate_cost function signature to return Result; 3. add CostModelError enum, update return type from Result<_, str> to Result<_, CostModelError>