sign: Add GetMuSig2ParticipantPubkeys to SigningProvider

This commit is contained in:
Ava Chow
2024-01-22 16:43:26 -05:00
parent fac0ee0bfc
commit 8ecea91bf2
2 changed files with 17 additions and 0 deletions

View File

@@ -52,6 +52,11 @@ bool HidingSigningProvider::GetTaprootBuilder(const XOnlyPubKey& output_key, Tap
{
return m_provider->GetTaprootBuilder(output_key, builder);
}
std::vector<CPubKey> HidingSigningProvider::GetMuSig2ParticipantPubkeys(const CPubKey& pubkey) const
{
if (m_hide_origin) return {};
return m_provider->GetMuSig2ParticipantPubkeys(pubkey);
}
bool FlatSigningProvider::GetCScript(const CScriptID& scriptid, CScript& script) const { return LookupHelper(scripts, scriptid, script); }
bool FlatSigningProvider::GetPubKey(const CKeyID& keyid, CPubKey& pubkey) const { return LookupHelper(pubkeys, keyid, pubkey); }
@@ -82,6 +87,13 @@ bool FlatSigningProvider::GetTaprootBuilder(const XOnlyPubKey& output_key, Tapro
return LookupHelper(tr_trees, output_key, builder);
}
std::vector<CPubKey> FlatSigningProvider::GetMuSig2ParticipantPubkeys(const CPubKey& pubkey) const
{
std::vector<CPubKey> participant_pubkeys;
LookupHelper(aggregate_pubkeys, pubkey, participant_pubkeys);
return participant_pubkeys;
}
FlatSigningProvider& FlatSigningProvider::Merge(FlatSigningProvider&& b)
{
scripts.merge(b.scripts);
@@ -89,6 +101,7 @@ FlatSigningProvider& FlatSigningProvider::Merge(FlatSigningProvider&& b)
keys.merge(b.keys);
origins.merge(b.origins);
tr_trees.merge(b.tr_trees);
aggregate_pubkeys.merge(b.aggregate_pubkeys);
return *this;
}