Use custom class for representing a txn to avoid protobuf overheads.