These functions used to be split into multiple files, but since the code was reorganized there is no longer any reason to split them.
This commit add tests the error paths when encoding and decoding MsgPing.