add line number in generated txn testcases
move around some helper functions