There's a utility function in the master branch that can be used instead of hardcoding.
--- a/src/test/musig2_tests.cpp
+++ b/src/test/musig2_tests.cpp
@@ -81,12 +81,7 @@ BOOST_AUTO_TEST_CASE(bip328)
BOOST_CHECK_MESSAGE(combined_keys == test.expected_aggregate_pubkey, "Test vector " << i << ": Aggregate pubkey mismatch");
// Create extended public key
- CExtPubKey extpub;
- extpub.nDepth = 0;
- std::fill(std::begin(extpub.vchFingerprint), std::end(extpub.vchFingerprint), 0);
- extpub.nChild = 0;
- extpub.pubkey = m_aggregate_pubkey.value();
- extpub.chaincode = MUSIG_CHAINCODE;
+ CExtPubKey extpub = CreateMuSig2SyntheticXpub(m_aggregate_pubkey.value());
// Check xpub
std::string xpub = EncodeExtPubKey(extpub);