There are many disparate sources of truth for transaction info logging in transaction_particpant.cpp and transaction_participant_test.cpp. TransactionParticipant has 3 methods (transactionInfoForLog - 2x, transactionInfoBsonForLog). Two of the three are just for tests.
In transaction_participant_test, we also have buildTransactionInfoBSON and buildTransactionInfoString, which construct similar objects. Overall, there are ~5 places that need to be updated when changes are made to transaction logging. There are comments scattered around the code to keep the methods in sync, but that's a suboptimal solution. We should clean this up to establish fewer (ideally one?) source of truth for testing and another for the actual code path.
Examples:
- https://github.com/10gen/mongo/blob/639a262b8967c19dde1addaab627b988a4cd03e1/src/mongo/db/transaction/transaction_participant_test.cpp#L4332
- https://github.com/10gen/mongo/blob/639a262b8967c19dde1addaab627b988a4cd03e1/src/mongo/db/transaction/transaction_participant.cpp#L2966