[avalanche] Simplify the peermanager tests by factoring the buildProof lambdas
Summary: This turns the lambdas into a couple of static functions to reduce the code and have a single maintenance point. There is no change in behavior.
Reviewers: #bitcoin_abc, PiRK
Reviewed By: #bitcoin_abc, PiRK
Differential Revision: https://reviews.bitcoinabc.org/D11356